:root {
    --primary-color: #1173d4;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --chart-grid: rgba(156, 163, 175, 0.1);
    --tooltip-bg: rgba(255, 255, 255, 0.95);
    --tooltip-text: #111827;
    --tooltip-border: #e5e7eb;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Layout */
.layout-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    background-color: var(--bg-secondary);
    min-height: 4rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.header-logo {
    color: var(--primary-color);
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
}

.header-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.25;
    letter-spacing: -0.025em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.notification-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.notification-btn:hover {
    background-color: var(--border-color);
}


.pdf-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    min-width: 2.5rem;
    min-height: 2.5rem;
    touch-action: manipulation;
}

.pdf-download-btn:hover {
    background-color: var(--border-color);
}

.pdf-download-btn:active {
    transform: scale(0.95);
}

.profile-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

.layout-content-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 0 1rem;
}

/* Small screens */
@media (min-width: 640px) {
    .layout-content-container {
        max-width: 42rem;
        padding: 0;
    }
}

/* Medium screens */
@media (min-width: 1024px) {
    .layout-content-container {
        max-width: 64rem;
    }
}

/* Large screens */
@media (min-width: 1280px) {
    .layout-content-container {
        max-width: 80rem;
    }
}

/* Extra large screens */
@media (min-width: 1536px) {
    .layout-content-container {
        max-width: 96rem;
    }
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-title {
    color: var(--text-primary);
    font-size: 1.875rem;
    font-weight: bold;
    line-height: 1.25;
    min-width: 18rem;
    transition: color 0.3s ease;
}

@media (min-width: 768px) {
    .page-title {
        font-size: 2.25rem;
    }
}

/* User Info Card */
.user-info-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    text-align: center;
}

/* Tablet size */
@media (min-width: 640px) {
    .user-info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Desktop size */
@media (min-width: 1024px) {
    .user-info-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .user-info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

.user-info-item h3 {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0 0 0.125rem 0;
    transition: color 0.3s ease;
}

.user-info-item p {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

/* Monitoring Summary Card */
.monitoring-summary-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.summary-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

/* Monitoring Table */
.monitoring-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
}

/* Table optimization for small screens */
@media (max-width: 640px) {
    .monitoring-table {
        font-size: 0.8rem;
    }
    
    .monitoring-table th,
    .monitoring-table td {
        padding: 0.5rem;
    }
}

/* Table optimization for very small screens */
@media (max-width: 480px) {
    .monitoring-table {
        font-size: 0.75rem;
    }
    
    .monitoring-table th,
    .monitoring-table td {
        padding: 0.375rem;
    }
}

.monitoring-table thead {
    background-color: var(--primary-color);
}

.monitoring-table th {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.monitoring-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

.monitoring-table tbody tr:last-child td {
    border-bottom: none;
}

.monitoring-table tbody tr:nth-child(even) {
    background-color: var(--bg-primary);
}

.monitoring-table tbody tr:hover {
    background-color: var(--border-color);
}

.monitoring-note {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

.monitoring-note strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Vital Monitoring Section */
.vital-monitoring-section {
    margin-bottom: 2rem;
}

.vital-section-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0 0 1.5rem 0;
    transition: color 0.3s ease;
}

/* Normal Range */
.normal-range {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.normal-range strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: 0.5rem;
}

.normal-range span {
    color: var(--text-secondary);
    margin-right: 1rem;
}

/* Chart Summary */
.chart-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.summary-item {
    margin-bottom: 0.75rem;
}

.summary-item:last-child {
    margin-bottom: 0;
}

.summary-item strong {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.summary-item div {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 0.5rem;
    transition: color 0.3s ease;
}

/* Health Cards Grid - Always vertical only */
.health-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.health-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    overflow: hidden;
}

.health-card h3 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0;
    transition: color 0.3s ease;
}

.health-value {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.health-value .value {
    color: var(--primary-color);
    font-size: 2.25rem;
    font-weight: bold;
    line-height: 1.25;
}

.health-value .unit {
    color: var(--text-tertiary);
    font-size: 1.125rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.health-chart {
    height: 200px;
    width: 100%;
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

@media (max-width: 768px) {
    .health-chart {
        height: 150px;
    }
}

@media (max-width: 480px) {
    .health-chart {
        height: 120px;
    }
}

.health-description {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    margin: 0;
    transition: color 0.3s ease;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Step Chart */
.step-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.75rem;
    align-items: end;
    padding-top: 1rem;
    height: 150px;
}

.step-bar {
    background-color: var(--primary-color);
    border-radius: 0.125rem 0.125rem 0 0;
    width: 100%;
}

/* No Data State */
.no-data-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-tertiary);
    gap: 1rem;
    padding: 2.5rem 0;
    transition: color 0.3s ease;
    min-height: 120px;
}

.no-data-icon {
    width: 4rem;
    height: 4rem;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.no-data-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.no-data-description {
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.5;
    max-width: 100%;
    word-wrap: break-word;
}

/* Body Composition Section */
.body-composition-section {
    margin-bottom: 2rem;
}

.composition-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.composition-table thead {
    background-color: var(--primary-color);
}

.composition-table th {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.composition-table th:last-child {
    border-right: none;
}

.composition-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transition: color 0.3s ease;
    vertical-align: middle;
}

.composition-table td:last-child {
    border-right: none;
}

.composition-table tbody tr:last-child td {
    border-bottom: none;
}

.composition-table tbody tr:nth-child(even) {
    background-color: var(--bg-primary);
}

/* Range Bar */
.range-bar {
    position: relative;
    height: 40px;
    margin: 0.5rem 0;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    transition: color 0.3s ease;
}

.range-segments {
    display: flex;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.segment {
    height: 100%;
    transition: all 0.3s ease;
}

.segment.below {
    background-color: #ef4444;
}

.segment.standard {
    background-color: #22c55e;
}

.segment.above {
    background-color: #f59e0b;
}

.current-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 40px;
    background-color: var(--text-primary);
    transform: translateX(-50%);
    z-index: 10;
}

.current-marker::before {
    content: 'T';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: bold;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
}

.current-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    transition: color 0.3s ease;
}

/* Obesity Analysis Section */
.obesity-analysis-section {
    margin-bottom: 2rem;
}

.bmi-note {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background-color: var(--bg-primary);
    border-radius: 0.25rem;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Body Change Section */
.body-change-section {
    margin-bottom: 2rem;
}

.body-change-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.body-change-chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--card-shadow);
}

.body-change-chart-card h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.body-change-chart {
    height: 200px;
    width: 100%;
    position: relative;
}

.chart-note {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    margin-top: 0.5rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Exercise Analysis Section */
.exercise-analysis-section {
    margin-bottom: 2rem;
}

.exercise-chart-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    transition: color 0.3s ease;
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.legend-line {
    width: 20px;
    height: 2px;
    border-radius: 1px;
}

.legend-line.blue {
    background-color: #1173d4;
}

.legend-line.orange {
    background-color: #f59e0b;
}

.legend-bar {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-bar.orange {
    background-color: #f59e0b;
}

.legend-bar.dark-blue {
    background-color: #1e40af;
}

.normal-range-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    transition: color 0.3s ease;
}

.normal-range-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.normal-range-info div {
    margin-top: 0.25rem;
}

.exercise-chart, .sleep-chart {
    height: 200px;
    width: 100%;
    position: relative;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.average-value {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    transition: color 0.3s ease;
}

/* Sleep Analysis Section */
.sleep-analysis-section {
    margin-bottom: 2rem;
}

.sleep-chart-card {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

/* Reference Section */
.reference-section {
    margin-bottom: 2rem;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1rem;
}

.reference-table thead {
    background-color: var(--primary-color);
}

.reference-table th {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.75rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    vertical-align: middle;
}

.reference-table th:last-child {
    border-right: none;
}

.reference-table td {
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    transition: color 0.3s ease;
    vertical-align: top;
}

.reference-table td:last-child {
    border-right: none;
}

.reference-table tbody tr:last-child td {
    border-bottom: none;
}

.reference-table tbody tr:nth-child(even) {
    background-color: var(--bg-primary);
}

.reference-table tbody tr:hover {
    background-color: var(--border-color);
}

.reference-sources {
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 1rem;
    background-color: var(--bg-primary);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.reference-sources p {
    margin: 0.25rem 0;
    line-height: 1.4;
}

.reference-sources strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Reference Subsection */
.reference-subsection {
    margin-bottom: 2rem;
}

.reference-subsection h4 {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

/* Formula Box */
.formula-box {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.formula-box strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* BMI Scale */
.bmi-scale {
    display: flex;
    gap: 0.25rem;
    margin-top: 1rem;
    border-radius: 0.375rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.scale-item {
    flex: 1;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    line-height: 1.2;
}

.scale-item.underweight {
    background-color: #3b82f6;
}

.scale-item.normal {
    background-color: #22c55e;
}

.scale-item.overweight {
    background-color: #f59e0b;
}

.scale-item.obese {
    background-color: #ef4444;
}

.scale-item.severe-obese {
    background-color: #dc2626;
}

/* Body Type Matrix */
.body-type-matrix {
    position: relative;
    margin-top: 1rem;
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 0.25rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.matrix-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    text-align: center;
    border-radius: 0.25rem;
    padding: 0.5rem;
    line-height: 1.2;
}

.matrix-cell.lean-obesity {
    background-color: #84cc16;
}

.matrix-cell.hidden-obesity {
    background-color: #fbbf24;
}

.matrix-cell.obesity {
    background-color: #ef4444;
}

.matrix-cell.slightly-lean {
    background-color: #60a5fa;
}

.matrix-cell.standard {
    background-color: #22c55e;
}

.matrix-cell.chubby {
    background-color: #f59e0b;
}

.matrix-cell.lean {
    background-color: #1e40af;
}

.matrix-cell.muscular-lean {
    background-color: #059669;
}

.matrix-cell.muscular {
    background-color: #1e40af;
}

.matrix-labels {
    position: relative;
    margin-top: 1rem;
}

.y-axis-label {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.x-axis-label {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Section Title */
.section-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0 0 1.5rem 0;
    transition: color 0.3s ease;
}

/* Analysis Section */
.analysis-section {
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.analysis-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.25;
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-text {
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.analysis-highlight {
    color: var(--primary-color);
    font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
    padding: 1rem;
}

.loading-content {
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    max-width: 20rem;
    width: 100%;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.loading-text h3 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.loading-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
    animation: pulse 2s ease-in-out infinite;
    transition: color 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.loading-overlay.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        min-height: 3.5rem;
    }
    
    .header-title {
        font-size: 1.125rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        min-width: auto;
    }
    
    /* Monitoring summary table adjustment for mobile */
    .monitoring-summary-card {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .summary-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    .monitoring-note {
        font-size: 0.8rem;
    }
    
    /* Vital monitoring section adjustment for mobile */
    .vital-section-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .normal-range {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .chart-summary {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }
    
    .summary-item {
        margin-bottom: 0.5rem;
    }
    
    .summary-item strong {
        font-size: 0.8rem;
    }
    
    .summary-item div {
        font-size: 0.75rem;
    }
    
    /* Prevent text overlap on mobile */
    .no-data-container {
        gap: 0.75rem;
        padding: 2rem 0;
        min-height: 100px;
    }
    
    .no-data-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
    }
    
    .no-data-description {
        font-size: 0.8rem;
        line-height: 1.4;
        padding: 0 0.5rem;
    }
    
    .health-description {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-top: 0.5rem;
    }
    
    /* Action button optimization for mobile */
    .action-buttons {
        justify-content: center;
        margin-bottom: 1.5rem;
    }
    
    .action-btn {
        min-height: 3rem;
        min-width: 3rem;
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }
    
    /* Loading overlay optimization for mobile */
    .loading-content {
        padding: 1.5rem 1rem;
        max-width: 18rem;
    }
    
    .loading-text h3 {
        font-size: 1rem;
    }
    
    .loading-text p {
        font-size: 0.8rem;
    }
}

/* Small mobile screens */
@media (max-width: 480px) {
    header {
        padding: 0.75rem;
        min-height: 3rem;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    .no-data-container {
        gap: 0.5rem;
        padding: 1.5rem 0;
        min-height: 80px;
    }
    
    /* Monitoring summary table adjustment for small screens */
    .monitoring-summary-card {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .summary-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .monitoring-table th,
    .monitoring-table td {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    .monitoring-note {
        font-size: 0.75rem;
    }
    
    /* Vital monitoring section adjustment for small screens */
    .vital-section-title {
        font-size: 1.125rem;
        margin-bottom: 0.75rem;
    }
    
    .normal-range {
        padding: 0.375rem;
        font-size: 0.75rem;
    }
    
    .chart-summary {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }
    
    .summary-item {
        margin-bottom: 0.375rem;
    }
    
    .summary-item strong {
        font-size: 0.75rem;
    }
    
    .summary-item div {
        font-size: 0.7rem;
    }
    
    .no-data-title {
        font-size: 0.9rem;
        line-height: 1.2;
        margin-bottom: 0.2rem;
    }
    
    .no-data-description {
        font-size: 0.75rem;
        line-height: 1.3;
        padding: 0 0.25rem;
    }
    
    .health-description {
        font-size: 0.75rem;
        line-height: 1.3;
        margin-top: 0.25rem;
    }
    
    .health-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    /* Action button optimization for small screens */
    .action-btn {
        min-height: 2.75rem;
        min-width: 2.75rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Loading overlay optimization for small screens */
    .loading-content {
        padding: 1.25rem 0.75rem;
        max-width: 16rem;
    }
    
    .loading-text h3 {
        font-size: 0.9rem;
    }
    
    .loading-text p {
        font-size: 0.75rem;
    }
    
    /* User info card optimization for small screens */
    .user-info-card {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .user-info-grid {
        gap: 0.375rem;
    }
    
    .user-info-item h3 {
        font-size: 0.7rem;
    }
    
    .user-info-item p {
        font-size: 0.8rem;
    }
}

/* Blazor specific styles */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

.loading-animation lottie-player {
    width: 140px !important;
    height: 140px !important;
    display: block !important;
}

/* Alternative animation styles */
.fallback-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 140px;
    height: 140px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    min-height: 140px;
}
