:root {
    --bg-color: #f8fafc; 
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    --text-main: #000000; 
    --text-muted: #6b7280;
    --accent-primary: #10b981; /* Emerald Green */
    --accent-hover: #059669;
    --border-color: #e5e7eb;
    --danger: #ef4444;
    --border-radius: 20px;
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.03); 
}

/* 🟢 TRUE PROFESSIONAL DARK MODE */
.dark-mode {
    --bg-color: #121212; 
    --card-bg: #1A1A1A; 
    --sidebar-bg: #1A1A1A; 
    --text-main: #FFFFFF; 
    --text-muted: #A0A0A0; 
    --border-color: #2D2D2D; 
    --shadow-sm: 0 4px 15px rgba(0,0,0,0.5);
}

body, .card, .sidebar, .topbar, input, button, .modal-content, .login-card, .mobile-nav {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    height: 100vh;
    overflow: hidden; 
    letter-spacing: -0.01em;
}

/* 🟢 CARD LIFT & GLOW EFFECT (GLASSMORPHISM) */
.glass-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
}

/* 🟢 RICH HOVER PREVIEW (NOTION STYLE) */
.hover-preview { position: relative; cursor: help; }
.hover-preview::after {
    content: attr(data-preview);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: #1A1A1A;
    color: #FFFFFF;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    border: 1px solid #10B981;
    z-index: 100;
}
.hover-preview::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #10B981 transparent transparent transparent;
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 100;
}
.hover-preview:hover::after, .hover-preview:hover::before {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Animations & Page Routing */
.app-view { display: none; opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
.app-view.active-view { display: block; opacity: 1; transform: translateY(0); animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.page { display: none !important; }
#login-page.active { display: flex !important; justify-content: center; align-items: center; height: 100vh; width: 100vw; background-color: var(--bg-color); }
#dashboard-page.active { display: flex !important; height: 100vh; width: 100vw; }

/* Login Page */
.login-card { background: var(--card-bg); padding: 40px; border-radius: var(--border-radius); box-shadow: var(--shadow-sm); width: 100%; max-width: 420px; border: 1px solid var(--border-color); }
.brand-title { font-size: 2.5rem; margin: 0 0 10px 0; font-weight: 800; letter-spacing: -1.5px; text-align: center; }
.subtitle { color: var(--text-muted); margin-bottom: 30px; text-align: center; line-height: 1.5; }
.features-list { margin-bottom: 25px; }
.feature-item { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.feature-item p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background-color: transparent; color: var(--text-main); border: 1px solid var(--border-color); font-size: 1rem; }
.google-btn:hover { background-color: var(--border-color); }
.full-width { width: 100%; padding: 12px; }

/* SEO Text */
.seo-text { margin-top: 25px; text-align: center; font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; border-top: 1px solid var(--border-color); padding-top: 15px; }
.seo-text strong { color: var(--text-main); font-weight: 600; }

/* Layout */
.sidebar { width: 260px; background-color: var(--sidebar-bg); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; padding: 20px 0; z-index: 10; }
.sidebar-header { padding: 0 24px 20px 24px; border-bottom: 1px solid var(--border-color); }
.sidebar-header h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -1px;}
.sidebar-nav { list-style: none; padding: 20px 12px; margin: 0; flex: 1; }
.sidebar-nav li { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 5px; border-radius: 8px; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.sidebar-nav li svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav li.active { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-primary); }
.sidebar-nav li:hover:not(.active) { background-color: var(--bg-color); color: var(--text-main); }
.sidebar-footer { 
    padding: 0 16px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
}
.sidebar-btn { 
    width: 100%; 
    background: transparent; 
    color: var(--text-main); 
    border: none; 
    padding: 12px 16px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    /* This makes the icon and text sit side-by-side perfectly */
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.sidebar-btn:hover { 
    background-color: var(--bg-color); 
}
/* THIS IS THE MAGIC LINE: It forces the giant icons to be small */
.sidebar-btn svg { 
    width: 20px; 
    height: 20px; 
    flex-shrink: 0; 
}
.text-danger { 
    color: var(--danger) !important; 
}

/* Mobile Navigation */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: var(--sidebar-bg); border-top: 1px solid var(--border-color); padding: 15px 0; justify-content: space-around; z-index: 100; box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
.mobile-nav .nav-item { padding: 10px 20px; border-radius: 12px; cursor: pointer; transition: background 0.2s; color: var(--text-muted); }
.mobile-nav .nav-item svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.mobile-nav .nav-item.active { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-primary); }

.main-content { flex: 1; display: flex; flex-direction: column; background-color: var(--bg-color); }
.topbar { height: 70px; background-color: var(--card-bg); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; }
.topbar h3 { margin: 0; font-weight: 700; font-size: 1.2rem; }
.date-display { color: var(--text-muted); font-size: 0.9rem; font-weight: 600; }
.content-scroll { flex: 1; overflow-y: auto; padding: 40px; padding-bottom: 100px; } 

/* Professional Icon Headers */
.card-header-with-icon { display: flex; align-items: center; gap: 10px; color: var(--text-main); font-weight: 700; font-size: 1.05rem; margin-bottom: 15px; }
.icon-box { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(16, 185, 129, 0.1); color: var(--accent-primary); }
.icon-box svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* Components */
button { font-family: 'Inter', sans-serif; font-weight: 600; border-radius: 10px; cursor: pointer; border: none; padding: 10px 16px; }
.btn-primary { background-color: var(--accent-primary); color: white; }
.btn-primary:hover { background-color: var(--accent-hover); }
.btn-secondary { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
input { background: transparent; color: var(--text-main); }

.card { background: var(--card-bg); padding: 24px; border-radius: var(--border-radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 24px; }
.stat-value { font-size: 3rem; margin: 0; font-weight: 800; letter-spacing: -2px; }
.time-unit { font-size: 1.5rem; color: var(--text-muted); font-weight: 600; margin-right: 8px; letter-spacing: 0; }
.highlight-green { color: var(--accent-primary); }

/* Motivation Section */
.motivation-section { margin-bottom: 40px; }
.motivation-card { text-align: center; padding: 40px 20px; position: relative; }
.motivation-header { position: absolute; top: 20px; left: 20px; }
.serif-quote { font-family: 'Playfair Display', serif; font-style: italic; font-size: 2rem; font-weight: 600; color: var(--text-main); margin: 20px 0 10px 0; letter-spacing: 0; line-height: 1.3; }
.quote-author { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; padding-bottom: 40px; }
.subject-card { background: var(--card-bg); padding: 24px; border-radius: var(--border-radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); display: flex; flex-direction: column; }
.subject-header { border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px; }
.subject-header h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.stopwatch-controls { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.time-display { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -1px; }

/* Planner & Tests */
.tests-section { display: flex; flex-direction: column; gap: 24px; }
.planner-input-group { display: flex; gap: 10px; margin-bottom: 20px; }
.planner-input-group input { flex: 1; padding: 12px; border: 1px solid var(--border-color); border-radius: 10px; font-family: 'Inter', sans-serif; }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--border-color); }
.task-item:last-child { border-bottom: none; }
.task-text { font-size: 1rem; font-weight: 500; }
.task-delete { background: #fee2e2; color: var(--danger); padding: 6px 12px; font-size: 0.85rem; border-radius: 6px; }
.chart-card { max-width: 100%; margin: 0; padding: 30px; }

/* Modal */
.modal-overlay { display: none !important; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); justify-content: center; align-items: center; backdrop-filter: blur(4px); z-index: 50; }
.modal-overlay.active { display: flex !important; }
.modal-content { background: var(--card-bg); padding: 30px; border-radius: var(--border-radius); width: 90%; max-width: 400px; border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); }
.modal-content input { width: 100%; padding: 12px; margin: 15px 0; border: 1px solid var(--border-color); border-radius: 10px; box-sizing: border-box; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Analytics Layout */
.analytics-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; align-items: start; }
.full-month-card { max-width: 100%; margin-top: 0; }

/* Calendar */
.calendar-card { display: flex; flex-direction: column; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 1.1rem; color: var(--text-main); margin-bottom: 15px; }
.icon-btn { background: transparent; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; padding: 5px 12px; border-radius: 8px; font-weight: 800; border: 1px solid transparent; transition: 0.2s; }
.icon-btn:hover { background: var(--bg-color); color: var(--text-main); }
.calendar-grid-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; font-size: 0.85rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-day { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 8px; font-weight: 600; font-size: 0.95rem; border: 1px solid transparent; color: var(--text-main); background: var(--bg-color); transition: 0.2s; }
.cal-day.empty { background: transparent; }
.cal-day.past:not(.streak) { opacity: 0.4; } 
.cal-day.streak { background: var(--accent-primary); color: white; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4); opacity: 1; }
.cal-day.today:not(.streak) { border: 2px solid var(--text-main); }

/* 🟢 AI TUTOR & PRO BADGE STYLES */
.pro-badge {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    font-weight: 800;
    letter-spacing: 1px;
}
.drop-zone {
    max-width: 100%;
    height: 250px;
    padding: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text-muted);
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    background: rgba(16, 185, 129, 0.02);
    transition: all 0.3s ease;
}
.drop-zone:hover, .drop-zone--over {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--accent-primary);
}
.drop-zone__input { display: none; }
.ai-response {
    margin-top: 25px;
    padding: 25px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-primary);
    line-height: 1.6;
    color: var(--text-main);
}
@keyframes pulseText { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }
.loading-pulse { animation: pulseText 1.5s infinite ease-in-out; }

@media (max-width: 850px) {
    .sidebar { display: none; }
    .mobile-nav { display: flex; }
    .topbar { padding: 0 20px; }
    .content-scroll { padding: 20px; padding-bottom: 100px; }
    .planner-input-group { flex-direction: column; }
    .stat-value { font-size: 2.5rem; }
    .serif-quote { font-size: 1.5rem; margin-top: 40px; }
    .analytics-top-row { grid-template-columns: 1fr; }
}