:root {
    --bg-main: #f2f3f5;
    --bg-card: #ffffff;
    --text-dark: #202124;
    --text-muted: #5f6368;
    --border-color: #f1f3f4;
    --hover-bg: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
}

/* Header */
.app-header {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.menu-btn {
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: 0.2s;
}

.menu-btn:hover {
    color: var(--text-dark);
    background: var(--hover-bg);
}

/* --- Mobile-Optimized Circular Calendar --- */
.calendar-wrapper {
    max-width: 500px; 
    margin: 0 auto;
    padding: 15px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.calendar-header button {
    background: none; 
    border: none;
    font-size: 18px; 
    cursor: pointer;
    color: #888; 
    padding: 10px;
}

/* Weekday Pills */
.weekdays-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 15px;
}

.weekday-pill {
    background: #e8eaed; 
    color: #5f6368;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 6px 0;
}

/* Circular Dates & Opacity States */
.days-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px; /* Tight gap for mobile */
}

.calendar-day {
    border-radius: 50%; /* Perfect circles */
    aspect-ratio: 1; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: #444;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.calendar-day:hover {
    transform: scale(1.08);
}

/* The Time-Based Classes */
.past-date {
    opacity: 0.6;
}

.future-date {
    opacity: 0.35;
}

.today-date {
    opacity: 1;
    transform: scale(1.1);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 2px solid rgba(255,255,255,0.8);
}

.today-date:hover {
    transform: scale(1.15);
}

/* The Pastel Palette */
.pastel-blue { 
    background-color: #bde0fe; 
}

.pastel-purple { 
    background-color: #e5b3fe; 
}

.pastel-yellow { 
    background-color: #fdf09d; 
}

.pastel-orange { 
    background-color: #ffd6a5; 
}

.pastel-mint { 
    background-color: #caffbf; 
}

.pastel-pink { 
    background-color: #ffc8dd; 
}

/* Dashboard Sidebar */
.dashboard {
    position: fixed;
    top: 0; 
    right: -450px; 
    width: 400px; 
    height: 100vh;
    background: var(--bg-main);
    transition: right 0.3s ease;
    padding: 20px; 
    z-index: 100;
    overflow-y: auto;
}

.dashboard.active { 
    right: 0; 
}

@media (max-width: 500px) {
    .dashboard { 
        width: 100%; 
        right: -100%; 
    }
}

.dashboard-header {
    display: flex; 
    justify-content: space-between;
    align-items: flex-start; 
    margin-bottom: 30px;
}

.dash-title { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.icon-circle {
    width: 45px; 
    height: 45px; 
    background: #e6f4ea;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px;
}

.dash-title h2 { 
    font-size: 20px; 
    font-weight: 600; 
}

.dash-title p { 
    color: var(--text-muted); 
    font-size: 14px; 
}

.close-btn {
    background: var(--bg-card); 
    border: 1px solid var(--border-color);
    width: 35px; 
    height: 35px; 
    border-radius: 10px; 
    cursor: pointer; 
    color: var(--text-muted);
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid; 
    grid-template-columns: 1fr 1fr;
    gap: 15px; 
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-card); 
    padding: 20px;
    border-radius: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.stat-icon { 
    font-size: 20px; 
    margin-bottom: 15px; 
}

.stat-card h3 { 
    font-size: 24px; 
    margin-bottom: 4px; 
}

.stat-card p { 
    color: var(--text-muted); 
    font-size: 13px; 
}

/* Dashboard List Items */
.dash-list {
    background: var(--bg-card); 
    border-radius: 16px;
    padding: 5px 20px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.02); 
    margin-bottom: 30px;
}

.list-item {
    display: flex; 
    justify-content: space-between;
    padding: 15px 0; 
    border-bottom: 1px solid var(--border-color); 
    font-size: 14px;
}

.list-item:last-child { 
    border-bottom: none; 
}

.list-left { 
    color: var(--text-muted); 
    display: flex; 
    align-items: center; 
    gap: 10px; 
}

.list-right { 
    font-weight: 500; 
}

.dash-footer { 
    text-align: center; 
    color: #9aa0a6; 
    font-size: 12px; 
    margin-top: 20px; 
}

/* Universal Modal Styles */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.4); 
    display: none;
    justify-content: center; 
    align-items: center; 
    z-index: 200;
}

.modal-overlay.active { 
    display: flex; 
}

.modal-content {
    background: var(--bg-main); 
    padding: 30px;
    border-radius: 20px; 
    width: 90%; 
    max-width: 650px;
    max-height: 90vh; 
    overflow-y: auto;
}

.modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px;
}

/* Settings Modal Specifics */
.settings-section {
    margin-bottom: 25px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child { 
    border-bottom: none; 
    margin-bottom: 0; 
}

.custom-input {
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    font-size: 15px; 
    color: var(--text-dark); 
    font-family: inherit;
}

.custom-input:focus { 
    outline: none; 
    border-color: #61afef; 
}

.hint-text { 
    font-size: 13px; 
    color: var(--text-muted); 
    margin-top: 8px; 
}

/* Settings - Timetable Manager */
.timetable-day {
    background: #ffffff; 
    border: 1px solid var(--border-color);
    border-radius: 12px; 
    margin-bottom: 15px; 
    overflow: hidden;
}

.timetable-day-header {
    background: #f8f9fa; 
    padding: 12px 16px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-weight: 600; 
    border-bottom: 1px solid var(--border-color);
}

.timetable-subjects { 
    padding: 5px 16px; 
}

.timetable-subject-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 0; 
    border-bottom: 1px dashed #e0e0e0; 
    font-size: 14px;
}

.timetable-subject-row:last-child { 
    border-bottom: none; 
}

.add-sub-btn {
    background: #ffffff; 
    border: 1px solid #dadce0; 
    width: 28px; 
    height: 28px;
    border-radius: 6px; 
    cursor: pointer; 
    color: #5f6368; 
    transition: 0.2s;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.add-sub-btn:hover { 
    background: #e8eaed; 
    color: #202124; 
}

/* Settings - Danger Zone */
.danger-zone {
    background: #fce8e6; 
    padding: 20px; 
    border-radius: 12px; 
    border: 1px solid #fad2cf;
}

.danger-btn {
    background: #d93025; 
    color: white; 
    border: none; 
    padding: 12px 20px;
    border-radius: 8px; 
    font-size: 14px; 
    font-weight: 500; 
    cursor: pointer;
    width: 100%; 
    transition: background 0.2s;
}

.danger-btn:hover { 
    background: #b3261e; 
}

/* Daily Log Modal Specifics */
.header-title-group { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.holiday-toggle {
    background: var(--bg-card); 
    padding: 15px; 
    border-radius: 12px;
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 20px; 
    font-weight: 500;
}

/* Tree View (Daily Log Folders) */
.tree-container { 
    margin-top: 15px; 
}

.tree-item { 
    margin-bottom: 8px; 
}

.tree-header {
    display: flex; 
    align-items: center; 
    background: var(--bg-card);
    padding: 12px 16px; 
    border-radius: 12px; 
    cursor: pointer;
    font-weight: 500; 
    border: 1px solid transparent;
}

.tree-header:hover { 
    border-color: var(--border-color); 
}

/* Actions inside Settings Timetable & Daily Log */
.subject-actions { 
    margin-left: auto; 
    display: flex; 
    gap: 5px; 
}

.subject-actions i {
    padding: 8px; 
    color: #bdc1c6; 
    font-size: 14px;
    border-radius: 4px; 
    cursor: pointer; 
    transition: color 0.2s, background 0.2s;
}

.subject-actions i:hover { 
    background: #f1f3f4; 
    color: #202124; 
}

/* Inside the open folder */
.tree-content {
    display: none; 
    margin-left: 18px; 
    padding-left: 24px;
    border-left: 1px dashed #d2d6da; 
    padding-top: 10px; 
    padding-bottom: 15px;
}

.tree-content.active { 
    display: block; 
}

.details-card {
    background: var(--bg-card); 
    border-radius: 12px;
    padding: 20px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.card-row { 
    display: flex; 
    gap: 15px; 
    margin-bottom: 15px; 
}

@media (max-width: 500px) {
    .card-row { 
        flex-direction: column; 
        gap: 10px; 
    }
}

/* Custom Radio Buttons */
.custom-checkbox { 
    font-size: 14px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    color: #5f6368;
}

.custom-checkbox input { 
    cursor: pointer; 
}

.details-card textarea {
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color);
    border-radius: 8px; 
    resize: vertical; 
    min-height: 80px;
    font-family: inherit; 
    font-size: 14px;
}

.details-card textarea:focus { 
    outline: none; 
    border-color: #a8e6cf; 
}

/* notunnnnnnnnnnnnnnnnnnnn keeeeeeeeeeee */



/* =====================================================
    PROFILE MENU & LOGIN POPUP
    ===================================================== */
    .profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    pointer-events: auto; /* This makes it clickable! */
    }

    #profile-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid #dadce0;
    }

    #profile-popup {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: white;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: max-content;
    z-index: 999;
    }

    .google-sync-btn {
    background-color: white;
    color: #3c4043;
    border: 1px solid #dadce0;
    padding: 10px 16px;
    border-radius: 4px;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    
    /* These 3 lines perfectly align the icon and text */
    display: flex;
    align-items: center;
    gap: 12px;
    }

    .logout-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    }