/* ==========================================================================
   Circadian Lab - Comprehensive Glassmorphic Theme (Sticky Nav & Tabs)
   ========================================================================== */

/* 1. Design Tokens & Variables */
:root {
    --bg-dark: #070913;
    --bg-card: rgba(13, 17, 34, 0.65);
    --bg-card-hover: rgba(20, 26, 50, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary-glow: rgba(59, 130, 246, 0.15);
    --accent-orange: #ff9f43;
    --accent-orange-glow: rgba(255, 159, 67, 0.2);
    --accent-blue: #3b82f6;
    --accent-purple: #a78bfa;
    --accent-yellow: #fcd34d;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    
    --font-main: 'Plus Jakarta Sans', 'Noto Sans KR', sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

/* 2. Global Resets & Document Setup */
html {
    font-size: 18.5px; /* Increases general text sizes overall */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

strong {
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255, 159, 67, 0.15);
    font-size: 1.13em; /* Make emphasized text even larger */
    font-weight: 800;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Decorative Background Glows */
.background-decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.35;
    mix-blend-mode: screen;
    animation: orbFloat 15s ease-in-out infinite alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    right: -100px;
}

.orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(167,139,250,0.2) 0%, rgba(0,0,0,0) 70%);
    bottom: 10%;
    left: -200px;
    animation-delay: -5s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,159,67,0.15) 0%, rgba(0,0,0,0) 70%);
    top: 30%;
    right: 10%;
    animation-delay: -10s;
}

@keyframes orbFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(40px) scale(1.1); }
}

/* 3. Sticky Top Navigation Bar */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 9, 19, 0.85);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.nav-container {
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-blue);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    outline: none;
    transition: opacity var(--transition-smooth);
}

.nav-logo:hover {
    opacity: 0.85;
}

.nav-logo svg {
    filter: drop-shadow(0 0 4px var(--accent-blue));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 18px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-smooth);
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: white;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.nav-link.highlight {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.nav-link.highlight:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.4);
}

.nav-link.highlight.active {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border: 1px solid white;
}

/* 4. Page Layout Structure & Animation */
.page-container {
    padding-top: 40px;
    padding-bottom: 60px;
    min-height: calc(100vh - 220px);
}

.page-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
}

.page-section.active {
    display: block;
    animation: sectionFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sectionFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 5. Typography & Elements Utility */
.page-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2.3rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 0.98rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50px;
    margin-bottom: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.gap-32 { gap: 32px; }
.gap-24 { gap: 24px; }
.gap-20 { gap: 20px; }
.gap-16 { gap: 16px; }
.gap-12 { gap: 12px; }

.mt-32 { margin-top: 32px; }
.mt-24 { margin-top: 24px; }
.mt-16 { margin-top: 16px; }
.mb-40 { margin-bottom: 40px; }
.mb-24 { margin-bottom: 24px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.lead-text { font-size: 1.05rem; line-height: 1.7; color: white; font-weight: 500; }

/* 6. Card Foundations */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 28px;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.card-title-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.card-title-box h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.card-title-box .icon {
    font-size: 1.4rem;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.justify-between {
    justify-content: space-between;
}

/* Specific Card Accents */
.border-blue { border-left: 4px solid var(--accent-blue); }
.border-orange { border-left: 4px solid var(--accent-orange); }

/* 7. Mathematics formula block */
.math-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.math-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.math-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.math-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.math-formula {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: #e0f2fe;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.highlight-formula {
    color: var(--accent-purple);
    font-size: 1.05rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

.math-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.border-highlight {
    background: rgba(167, 139, 250, 0.04);
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
}

.formula-banner {
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.formula-banner code {
    color: #93c5fd;
    font-weight: 700;
}

/* 8. Chronotype Page Trait Boxes & Compare Table */
.trait-box {
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-top: auto;
}

.bg-orange-dim {
    background: rgba(255, 159, 67, 0.05);
    border: 1px solid rgba(255, 159, 67, 0.1);
    color: #ffe6cc;
}

.bg-orange-dim h4 { color: var(--accent-orange); margin-bottom: 10px; font-size: 0.9rem; }

.bg-blue-dim {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    color: #e0f2fe;
}

.bg-blue-dim h4 { color: #60a5fa; margin-bottom: 10px; font-size: 0.9rem; }

.trait-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.trait-box li {
    position: relative;
    padding-left: 12px;
}

.trait-box li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: inherit;
}

.table-responsive {
    overflow-x: auto;
    margin-top: 16px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.compare-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding: 14px 16px;
    color: white;
    font-weight: 700;
}

.compare-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.compare-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 9. Timeline for Circadian Rhythm Page */
.circadian-timeline {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    margin-left: 10px;
    gap: 20px;
}

.timeline-row {
    display: flex;
    align-items: center;
    position: relative;
}

.timeline-row::before {
    content: '';
    position: absolute;
    left: -25px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-dark);
}

.timeline-row:hover::before {
    background-color: var(--accent-orange);
    box-shadow: 0 0 8px var(--accent-orange);
}

.time-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--accent-purple);
    width: 60px;
    flex-shrink: 0;
}

.event-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.event-desc strong {
    color: var(--accent-purple);
}

/* 10. Self-Diagnosis View (Inputs & Dashboard) */
.form-container-box {
    max-width: 900px;
    margin: 0 auto;
}

.app-header {
    margin-bottom: 32px;
    text-align: center;
}

.app-header h1 {
    font-size: 1.8rem;
    font-family: var(--font-display);
    font-weight: 800;
    color: white;
}

.app-header .subtitle {
    font-size: 0.82rem;
    letter-spacing: 2px;
}

/* Form Styling */
.form-card {
    padding: 36px;
}

.input-group-box {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.input-group-box h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid var(--accent-purple);
    padding-left: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: white;
}

.input-field .desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: -3px;
    margin-bottom: 2px;
}

input[type="time"], select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    color: white;
    padding: 10px 12px;
    font-family: var(--font-main);
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition-smooth);
}

input[type="time"]:focus, select:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

select option {
    background-color: #0b0f19; /* Solid Midnight Navy */
    color: var(--text-primary); /* Light text color */
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* Switches */
.switch-container {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.12);
    transition: .3s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .switch-slider {
    background-color: var(--accent-blue);
}

input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.checkbox-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.warning-alert {
    background: rgba(244, 63, 94, 0.08);
    border: 1px solid rgba(244, 63, 94, 0.15);
    border-radius: var(--border-radius-sm);
    color: #fda4af;
    font-size: 0.76rem;
    padding: 8px 12px;
    margin-top: 10px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-huge {
    padding: 16px 48px;
    font-size: 1.1rem;
    border-radius: 50px;
    max-width: 320px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-sm);
}

.btn-group-center {
    display: flex;
    justify-content: center;
}

.btn-group-left {
    display: flex;
    justify-content: flex-start;
}

.pulse-animation {
    animation: buttonPulse 2.2s infinite;
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* 11. Diagnosis Results Grid & Cards */
.results-container-box {
    animation: resultsEntry 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes resultsEntry {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hidden-view {
    display: none !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 170px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 3px;
}

#chronotype-card::before { background: linear-gradient(90deg, var(--accent-purple), var(--accent-rose)); }
#jetlag-card::before { background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); }
#sleep-debt-card::before { background: linear-gradient(90deg, var(--accent-orange), var(--accent-yellow)); }
#biomarkers-card::before { background: linear-gradient(90deg, var(--accent-emerald), var(--accent-blue)); }

.metric-value {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.metric-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Spectrum Indicator */
.chronotype-spectrum {
    margin-top: 14px;
}

.spectrum-bar {
    height: 6px;
    background: linear-gradient(90deg, #fd5e53, #f7d070, #5c62d6);
    border-radius: 3px;
    position: relative;
}

.spectrum-indicator {
    width: 12px;
    height: 12px;
    background-color: white;
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
    position: absolute;
    top: -3px; left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.spectrum-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
}

/* Social Jetlag gauge */
.jetlag-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.jetlag-fill-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-rose));
    border-radius: 3px;
    transition: width 0.5s ease-out;
}

/* Biomarker Predictions list */
.biomarker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.biomarker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.biomarker-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.biomarker-item .label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.biomarker-item .value {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-display);
}

/* 12. Dashboard Tabs System Layout */
.tab-card {
    padding: 0;
    overflow: hidden;
}

.tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 16px 20px;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-bottom: 2px solid transparent;
    text-align: center;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: white;
    border-bottom-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.04);
}

.tab-content {
    display: none;
    padding: 28px;
    animation: tabFadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tab 1: Circadian clock */
.clock-visualization-container {
    display: flex;
    align-items: center;
    gap: 32px;
}

.clock-display {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#svg-clock-wrapper {
    width: 300px;
    height: 300px;
}

.clock-legend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clock-legend-info h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

.helper-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.info-hover-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-md);
    padding: 16px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-left: 3px solid var(--accent-orange);
}

.info-hover-card h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: white;
}

.info-hover-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Tab 2: 2-Process Model Canvas Chart */
.chart-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    padding: 10px;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}



/* Tab 3: Entrainment Planner schedule cards */
.day-schedule-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 80px 130px 1fr;
    align-items: center;
    gap: 16px;
}

.day-schedule-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.day-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-purple);
}

.day-sleep-times {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-sleep-times .label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.day-sleep-times .time {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    font-family: var(--font-display);
}

.day-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.action-block {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    font-size: 0.76rem;
}

.action-block.light-expo {
    border-left: 3px solid var(--accent-orange);
    color: #ffb066;
}

.action-block.light-avoid {
    border-left: 3px solid var(--accent-blue);
    color: #93c5fd;
}

.action-block .action-title {
    font-weight: 700;
    display: block;
    font-size: 0.65rem;
    opacity: 0.8;
}

.action-block .action-time {
    font-weight: 600;
    font-family: var(--font-display);
}

.planner-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.note-box {
    border-radius: var(--border-radius-md);
    padding: 16px;
    font-size: 0.8rem;
    line-height: 1.45;
}

.note-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.note-box p {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.positive-note {
    background: rgba(255, 159, 67, 0.04);
    border: 1px solid rgba(255, 159, 67, 0.08);
    color: #ffe8d1;
}

.positive-note h4 { color: var(--accent-orange); }

.negative-note {
    background: rgba(59, 130, 246, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.08);
    color: #e0f2fe;
}

.negative-note h4 { color: #60a5fa; }

/* 13. Footer Styling */
.app-footer {
    border-top: 1px solid var(--border-color);
    background: rgba(5, 6, 12, 0.95);
    padding: 48px 0 32px;
    font-size: 13.5px; /* Locks base footer text size */
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.disclaimer {
    border-left: 3px solid var(--accent-rose);
    padding-left: 16px;
}

.disclaimer h4 {
    color: #fda4af;
    font-size: 14.5px;
    margin-bottom: 8px;
}

.disclaimer p {
    font-size: 12.5px; /* Locks text size in pixels */
    color: var(--text-secondary);
    line-height: 1.5;
}

.references h4 {
    font-size: 14.5px;
    color: white;
    margin-bottom: 12px;
}

.references ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.references li {
    font-size: 12.5px; /* Locks text size in pixels */
    color: var(--text-secondary);
}

.references em {
    color: var(--accent-purple);
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 20px;
    font-size: 12px; /* Locks text size in pixels */
    color: var(--text-muted);
}

/* 14. Responsive Layout Queries */
@media (max-width: 1024px) {
    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .grid-3-col {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-links {
        gap: 4px;
    }
    
    .nav-link {
        padding: 6px 10px;
        font-size: 0.76rem;
    }
    
    .clock-visualization-container {
        flex-direction: column;
    }
    
    .day-schedule-card {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: center;
    }
    
    .day-sleep-times {
        align-items: center;
    }
    
    .day-actions {
        grid-template-columns: 1fr;
    }
    
    .planner-notes {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 1.8rem;
    }
    
    .tab-headers {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 12px;
        border-bottom: none;
        border-left: 2px solid transparent;
    }
    
    .tab-btn.active {
        border-left-color: var(--accent-blue);
    }
}

/* ==========================================================================
   Custom Time Picker Layout Styles
   ========================================================================== */
.custom-time-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
    padding: 6px 8px 6px 12px;
    height: 44px;
    position: relative;
    transition: var(--transition-smooth);
}

.custom-time-picker:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.time-display {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    user-select: none;
    cursor: default; /* Text click does nothing, cursor is default */
}

.btn-time-set {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    width: auto; /* override global button styles */
}

.btn-time-set:hover {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.hidden-time-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ==========================================================================
   Diagnosis Loader Styles (Active for 5s)
   ========================================================================== */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
    width: 100%;
    animation: loaderFadeIn 0.5s ease forwards;
}

@keyframes loaderFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.loader-card {
    max-width: 500px;
    width: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
}

.loader-icon-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
}

.loader-spinner {
    animation: rotateSpinner 2s linear infinite;
    position: absolute;
    width: 100%;
    height: 100%;
}

.loader-spinner .path {
    stroke: var(--accent-blue);
    stroke-linecap: round;
    animation: dashSpinner 1.5s ease-in-out infinite;
}

.center-icon {
    font-size: 2.2rem;
    animation: pulseCenter 1.5s ease-in-out infinite;
}

@keyframes rotateSpinner {
    100% { transform: rotate(360deg); }
}

@keyframes dashSpinner {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

@keyframes pulseCenter {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px var(--accent-blue)); }
}

.loader-card h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, white, var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textPulse 1.5s infinite alternate;
}

@keyframes textPulse {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.loader-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
    border-radius: 10px;
    transition: width 0.1s linear;
}

.progress-percent {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--accent-purple);
}
