:root {
    /* NEW BACKGROUND: Warm Cream into Soft Mist (Soothing, not stark white) */
    --bg-gradient: linear-gradient(135deg, #FFFDF5 0%, #F0F7F4 100%);
    
    --surface: #FFFFFF;
    
    --primary: #8EB8A6;        /* Sage Green */
    --primary-dark: #6B9C87;   /* Deep Sage */
    --primary-light: #E0F2EB;  /* Very light green */
    
    /* ... keep the rest of your variables the same ... */
    --accent: #E8C1C6;
    --accent-pop: #D69EA5;
    --text-main: #2D3A36;
    --text-muted: #849690;
    --shadow-soft: 0 8px 30px rgba(100, 116, 107, 0.08);
    --shadow-float: 0 15px 35px rgba(100, 116, 107, 0.12);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Quicksand', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Header --- */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 18px;
}
.icon-logo { color: var(--accent-pop); }

.greeting {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.app-content {
    padding: 0 20px;
    max-width: 500px;
    margin: 0 auto;
}

/* --- Cards & Glass Effect --- */
.glass-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* --- Typography --- */
h1 { font-size: 36px; font-weight: 700; color: var(--text-main); }
h2 { font-size: 24px; font-weight: 700; margin-bottom: 5px; color: var(--text-main); }
h3 { font-size: 18px; font-weight: 700; margin-bottom: 15px; color: var(--text-main); }
p { line-height: 1.6; color: var(--text-main); font-size: 15px; }

.page-header { margin-bottom: 24px; margin-top: 10px; }
.page-header p { color: var(--text-muted); }

/* --- Buttons --- */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 10px 20px rgba(116, 180, 155, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:active { transform: scale(0.97); }

.btn-text {
    background: none; border: none; 
    color: var(--primary-dark); font-weight: 700; 
    margin-top: 20px; font-size: 16px; cursor: pointer;
}

/* --- Hero Section (Home) --- */
.affirmation-bubble {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 20px 24px;
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 0;
    margin-bottom: 25px;
    position: relative;
}
.quote-icon { font-size: 32px; opacity: 0.3; position: absolute; top: 15px; left: 15px; }
.affirmation-bubble p { font-size: 18px; font-weight: 600; padding-left: 25px; color: var(--primary-dark); line-height: 1.4; }

.streak-card { text-align: center; }
.streak-circle { 
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
    width: 120px; height: 120px; 
    background: white; border-radius: 50%; 
    border: 4px solid var(--primary-light);
    margin-bottom: 15px;
}
.fire-icon { font-size: 28px; color: var(--accent-pop); margin-bottom: -5px; }
.streak-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 20px; }

/* --- Syllabus --- */
.toggle-switch {
    background: #EAEAEA;
    padding: 4px;
    border-radius: 50px;
    display: flex;
    position: relative;
    margin-bottom: 25px;
}
.toggle-btn {
    flex: 1; border: none; background: none; padding: 12px;
    font-family: inherit; font-weight: 600; color: var(--text-muted);
    z-index: 2; transition: color 0.3s;
}
.toggle-btn.active { color: var(--text-main); }
/* We use a pseudo element logic via JS or simplistic CSS for active bg. 
   Here we keep it simple with direct styling on active class for reliability */
.toggle-btn.active {
    background: white; border-radius: 40px; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.list-container { display: flex; flex-direction: column; gap: 12px; }

.checklist-item {
    background: white; padding: 18px 20px; border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    cursor: pointer; transition: 0.2s; border: 1px solid transparent;
}
.checklist-item:active { transform: scale(0.98); }

.status-indicator { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #EEE; flex-shrink: 0; }
.checklist-item.status-1 .status-indicator { background: var(--accent-pop); border-color: var(--accent-pop); } /* Learning */
.checklist-item.status-2 .status-indicator { background: var(--primary); border-color: var(--primary); } /* Done */
.checklist-item.status-2 span { text-decoration: line-through; color: var(--text-muted); }

.legend { font-size: 12px; color: var(--text-muted); margin-bottom: 15px; display: flex; gap: 15px; justify-content: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.dot.grey { background: #eee; } .dot.yellow { background: var(--accent-pop); } .dot.green { background: var(--primary); }

/* --- Inputs --- */
.input-row { display: flex; gap: 10px; margin-bottom: 10px; }
input {
    width: 100%; padding: 16px; background: #F7F9F8; border: none;
    border-radius: var(--radius-sm); font-family: inherit; font-size: 16px;
    color: var(--text-main); outline: none; transition: 0.2s;
}
input:focus { background: white; box-shadow: 0 0 0 2px var(--primary-light); }
#mock-reflection { margin-bottom: 20px; }

/* --- Emotions Grid --- */
.emotion-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.emotion-card {
    background: white; border: none; padding: 25px; border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft); display: flex; flex-direction: column;
    align-items: center; gap: 10px; color: var(--text-main);
    font-family: inherit; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.emotion-card span.material-symbols-rounded { font-size: 32px; color: var(--primary); }
.emotion-card:active { transform: scale(0.95); }

/* --- FIXED MESSAGE OVERLAY (Scrollable Text) --- */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* Darker dim for focus */
    backdrop-filter: blur(8px);   /* Stronger blur */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px; /* Safety padding from screen edges */
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: #FFFFFF;
    width: 100%;
    max-width: 340px; /* Keeps it nice and slim */
    
    /* VITAL: Prevents it from being taller than the screen */
    max-height: 80vh; 
    
    border-radius: 24px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    
    /* NEW: Flexbox layout to manage long text */
    display: flex;
    flex-direction: column;
    position: relative;
    animation: zoomIn 0.3s ease;
}

/* The actual text container */
#message-text {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 25px;
    margin-top: 10px;
    
    /* SCROLLING MAGIC */
    overflow-y: auto;     /* Scroll if too long */
    flex-grow: 1;         /* Take up available space */
    padding-right: 5px;   /* Space for scrollbar */
    text-align: left;     /* Easier to read paragraphs */
    white-space: pre-wrap; /* Keeps paragraph breaks */
}

/* Make the scrollbar look cute/subtle */
#message-text::-webkit-scrollbar {
    width: 4px;
}
#message-text::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 4px;
}

/* The Close Button - Always visible at bottom */
.close-btn {
    background: var(--text-main);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    align-self: center; /* Center the button horizontally */
    flex-shrink: 0;     /* Prevent button from getting squished */
    width: 100%;        /* Full width button is easier to tap */
}
.overlay:not(.hidden) { opacity: 1; pointer-events: auto; }
.message-popup {
    background: white; padding: 40px 30px; border-radius: 30px;
    text-align: center; max-width: 400px; width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2); transform: translateY(20px); transition: transform 0.3s;
}
.overlay:not(.hidden) .message-popup { transform: translateY(0); }
.icon-large { font-size: 48px; color: var(--accent-pop); margin-bottom: 20px; display: block; }
.message-popup p { font-size: 18px; font-weight: 600; }
/* --- Navigation Bar --- */
.glass-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 450px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    border-radius: 40px;
    box-shadow: var(--shadow-float);
    display: flex; justify-content: space-between;
    z-index: 90;
    border: 1px solid rgba(255,255,255,0.5);
}

.nav-item {
    background: none; border: none; display: flex; flex-direction: column;
    align-items: center; gap: 4px; color: var(--text-muted);
    font-family: inherit; cursor: pointer; transition: 0.3s;
}
.nav-label { font-size: 10px; font-weight: 600; }
.nav-item span.material-symbols-rounded { font-size: 26px; transition: 0.3s; }

.nav-item.active { color: var(--primary-dark); }
.nav-item.active span.material-symbols-rounded { transform: translateY(-2px); }

/* --- Accordion & Links --- */
.accordion-item { background: white; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 10px; box-shadow: var(--shadow-soft); }
.accordion-head { padding: 20px; font-weight: 700; display: flex; justify-content: space-between; cursor: pointer; }
.accordion-body { padding: 0 20px 20px 20px; display: none; color: var(--text-muted); }
.accordion-item.open .accordion-body { display: block; }
.accordion-item.open .arrow { transform: rotate(180deg); }

.info-badge { background: var(--primary-light); display: inline-flex; flex-direction: column; padding: 8px 15px; border-radius: 10px; margin-bottom: 15px; }
.info-badge .label { font-size: 10px; text-transform: uppercase; color: var(--primary-dark); }
.info-badge .value { font-size: 18px; font-weight: 700; color: var(--primary-dark); }

.link-card { display: flex; align-items: center; gap: 15px; cursor: pointer; }
.link-text { flex: 1; display: flex; flex-direction: column; }
.link-text span { font-size: 12px; color: var(--text-muted); }

/* Utilities */
.page { display: none; opacity: 0; animation: fadeUp 0.4s forwards; }
.page.active { display: block; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } from { opacity: 0; transform: translateY(10px); } }
.hidden { display: none; }

/* --- New Home Page Styles --- */
.card-header-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-box span {
    font-size: 24px;
}

/* --- New Mock Page Styles --- */
.mock-welcome-card {
    background: #FFF8E1; /* Soft Coffee/Cream color */
    color: #795548;
    padding: 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(121, 85, 72, 0.1);
    border: 1px solid rgba(121, 85, 72, 0.1);
}
.mock-welcome-card span { font-size: 28px; }
.mock-welcome-card p { font-size: 15px; font-weight: 600; margin: 0; color: #5D4037; }

.chart-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.chart-stat { display: flex; flex-direction: column; }
.chart-stat .label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.chart-stat .value { font-size: 20px; font-weight: 700; color: var(--primary-dark); }

/* --- History Log Styles --- */
.history-section {
    margin-top: 30px;
}
.history-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    font-weight: 600;
    color: var(--text-main);
    font-size: 14px;
}

.history-score {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.history-note {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    padding-top: 8px;
    border-top: 1px dashed #eee;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
}

/* --- Message Page Intro Note --- */
.intro-note {
    background: linear-gradient(135deg, #ffffff 0%, #fffbf2 100%); /* Very subtle warm tint */
    border-left: 4px solid #D69EA5; /* Dusty Rose accent line */
    padding: 24px;
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

/* A subtle decoration in the background */
.intro-note::after {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: #D69EA5;
    opacity: 0.1;
    border-radius: 50%;
}

.note-icon {
    color: #D69EA5;
    font-size: 24px;
    margin-top: 2px; /* Align with first line of text */
}

.note-content p {
    font-size: 15px;
    line-height: 1.7; /* More breathing room for text */
    color: #5D4037;   /* Softer brown-grey text */
    margin-bottom: 12px;
}

.note-content p:last-child {
    margin-bottom: 0;
}

/* The last sentence gets special treatment */
.highlight-text {
    font-weight: 600;
    color: #8EB8A6; /* Sage green for the 'pause and breathe' part */
    font-style: italic;
}

/* --- Focus/Journal Card --- */
/* --- Focus/Journal Card (Redesigned to Blend In) --- */
.focus-card {
    /* Soft Sage Gradient - Blends beautifully with the warm background */
    background: linear-gradient(135deg, var(--primary-light) 0%, #FFFFFF 100%);
    border: 1px solid rgba(142, 184, 166, 0.2); /* Subtle green border */
    color: var(--text-main);
    text-align: center;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(142, 184, 166, 0.15); /* Soft green glow */
}

.focus-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* Icon is now Dark Sage to pop against the light background */
.focus-icon { font-size: 36px; color: var(--primary-dark); }

.focus-stats { display: flex; flex-direction: column; text-align: left; }
.focus-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.focus-value { font-size: 24px; font-weight: 700; color: var(--primary-dark); }

.log-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Input is now White (Glassy) instead of Dark */
.dark-input {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--text-main);
    padding: 14px;
    border-radius: 12px;
    width: 80px;
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    outline: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.dark-input::placeholder { color: var(--text-muted); font-size: 14px; font-weight: 400; }
.dark-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(142, 184, 166, 0.2); }

.time-btn {
    background: var(--primary-dark); /* Dark Sage Button */
    color: white; /* White text */
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(107, 156, 135, 0.3);
}
.time-btn:active { transform: scale(0.96); }

/* --- Syllabus Subject Headers --- */
.subject-group {
    margin-bottom: 25px;
}

.subject-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid var(--accent-pop);
    line-height: 1;
}

/* --- Subject Filter Chips --- */
.chip-container {
    display: flex;
    gap: 10px;
    overflow-x: auto; /* Allows horizontal scrolling if list is long */
    padding-bottom: 5px; /* Space for scrollbar if any */
    margin-bottom: 20px;
    scrollbar-width: none; /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
}
.chip-container::-webkit-scrollbar { display: none; }

.chip {
    padding: 10px 20px;
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 30px;
    font-size: 13px;
    white-space: nowrap; /* Keep text on one line */
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    font-family: inherit;
}

.chip.active {
    background: var(--primary); /* Sage Green */
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(142, 184, 166, 0.3);
    transform: translateY(-1px);
}

/* --- 100 Reasons Section --- */
.reasons-section {
    margin-top: 40px;
    border-top: 1px dashed #E0E0E0;
    padding-top: 30px;
    text-align: center;
}

.reasons-header h3 {
    font-size: 18px;
    color: var(--primary-dark);
    margin-bottom: 5px;
}
.reasons-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.reasons-list {
    list-style: none;
    text-align: left;
    margin-bottom: 20px;
    padding: 0 10px;
}

.reasons-list li {
    background: white;
    margin-bottom: 10px;
    padding: 12px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: popIn 0.3s ease forwards;
    border: 1px solid rgba(0,0,0,0.03);
}

.reasons-list li::before {
    content: '❤️';
    font-size: 10px;
}

.small-btn {
    width: auto;
    padding: 10px 25px;
    margin: 0 auto;
    background: var(--accent-pop); /* Dusty Rose for this button */
}

.end-msg {
    background: #FFF8E1;
    padding: 20px;
    border-radius: 15px;
    color: #795548;
    font-weight: 600;
    margin-top: 20px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }

}

/* Fix for Long Messages in Popups */
.message-content {
    max-height: 60vh; /* Maximum height is 60% of screen */
    overflow-y: auto; /* Add scrollbar if text is too long */
    text-align: left; /* Easier to read long text */
    padding-right: 10px; /* Space for scrollbar */
    line-height: 1.6; /* Better readability */
    white-space: pre-wrap; /* Preserves paragraphs */
}


