/* ==========================================================================
   고등학교 1학년 올인원 스터디 플래너 (High School Study Planner)
   Author: DeepMind Antigravity
   Design: Modern Clean Pastel & Dark Themes
   ========================================================================== */

:root {
    /* Font */
    --font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Transitions & Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Subject Colors */
    --sub-korean: #ef4444;
    --sub-math: #3b82f6;
    --sub-english: #10b981;
    --sub-history: #f59e0b;
    --sub-society: #8b5cf6;
    --sub-science: #06b6d4;
    --sub-etc: #ec4899;
}

/* 1. Theme: Sky Blue (Default) */
body[data-theme="sky"] {
    --primary: #2563eb;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --secondary: #6366f1;
    --accent: #f43f5e;
    --bg-main: #f0f4f8;
    --bg-card: #ffffff;
    --bg-card-alt: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-sub: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 2px 8px rgba(37, 99, 235, 0.05);
    --shadow-md: 0 4px 20px rgba(37, 99, 235, 0.08);
    --shadow-lg: 0 10px 30px rgba(37, 99, 235, 0.12);
}

/* 2. Theme: Lavender Purple */
body[data-theme="lavender"] {
    --primary: #7c3aed;
    --primary-light: #ede9fe;
    --primary-hover: #6d28d9;
    --secondary: #a855f7;
    --accent: #ec4899;
    --bg-main: #f5f3ff;
    --bg-card: #ffffff;
    --bg-card-alt: #faf5ff;
    --bg-sidebar: #ffffff;
    --text-main: #1e1b4b;
    --text-muted: #6b7280;
    --text-sub: #9ca3af;
    --border-color: #e9d5ff;
    --border-light: #f3e8ff;
    --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.05);
    --shadow-md: 0 4px 20px rgba(124, 58, 237, 0.08);
    --shadow-lg: 0 10px 30px rgba(124, 58, 237, 0.12);
}

/* 3. Theme: Sage Mint */
body[data-theme="mint"] {
    --primary: #059669;
    --primary-light: #d1fae5;
    --primary-hover: #047857;
    --secondary: #0d9488;
    --accent: #f97316;
    --bg-main: #f0fdf4;
    --bg-card: #ffffff;
    --bg-card-alt: #f4fbf7;
    --bg-sidebar: #ffffff;
    --text-main: #064e3b;
    --text-muted: #4b5563;
    --text-sub: #9ca3af;
    --border-color: #a7f3d0;
    --border-light: #ecfdf5;
    --shadow-sm: 0 2px 8px rgba(5, 150, 105, 0.05);
    --shadow-md: 0 4px 20px rgba(5, 150, 105, 0.08);
    --shadow-lg: 0 10px 30px rgba(5, 150, 105, 0.12);
}

/* 4. Theme: Warm Peach */
body[data-theme="peach"] {
    --primary: #ea580c;
    --primary-light: #ffedd5;
    --primary-hover: #c2410c;
    --secondary: #f43f5e;
    --accent: #8b5cf6;
    --bg-main: #fff7ed;
    --bg-card: #ffffff;
    --bg-card-alt: #fffaf5;
    --bg-sidebar: #ffffff;
    --text-main: #431407;
    --text-muted: #78716c;
    --text-sub: #a8a29e;
    --border-color: #fed7aa;
    --border-light: #ffedd5;
    --shadow-sm: 0 2px 8px rgba(234, 88, 12, 0.05);
    --shadow-md: 0 4px 20px rgba(234, 88, 12, 0.08);
    --shadow-lg: 0 10px 30px rgba(234, 88, 12, 0.12);
}

/* 5. Theme: Dark Mode */
body[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-light: #0c4a6e;
    --primary-hover: #0ea5e9;
    --secondary: #818cf8;
    --accent: #fb7185;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-card-alt: #172033;
    --bg-sidebar: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-sub: #64748b;
    --border-color: #334155;
    --border-light: #1e293b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout App Container */
.app-container {
    display: flex;
    width: 100vw;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px 8px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logo-text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.logo-text .sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-item.active i {
    color: #ffffff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.quick-timer-box {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.quick-timer-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.quick-timer-display {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 28px 36px 60px 36px;
    max-width: 1300px;
}

/* Top Header Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.date-greeting h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.quote-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ==========================================================================
   Common Components (Cards, Buttons, Badges, Inputs)
   ========================================================================== */
.section-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-info {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-card-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger-outline {
    background-color: transparent;
    border-color: #fca5a5;
    color: #ef4444;
}

.btn-danger-outline:hover {
    background-color: #fef2f2;
    border-color: #ef4444;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-icon:hover {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-circle {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.3rem;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px;
}

.btn-full {
    width: 100%;
    margin-top: 14px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background-color: var(--bg-card-alt);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
    border-color: transparent;
}

.badge-accent {
    background-color: #ffe4e6;
    color: #e11d48;
    border-color: transparent;
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-group.half {
    flex: 1;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    background-color: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background-color: var(--bg-card);
}

.mini-input {
    width: 65px;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card-alt);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    outline: none;
}

/* Utilities */
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }
.text-warning { color: #f59e0b !important; }
.text-danger { color: #ef4444 !important; }
.mt-3 { margin-top: 16px; }

/* ==========================================================================
   TAB 1: Dashboard Styles
   ========================================================================== */
.dday-section {
    padding: 18px 22px;
}

.dday-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.dday-card {
    min-width: 190px;
    flex: 1;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dday-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.dday-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.dday-cat {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-light);
    color: var(--primary);
}

.dday-delete-btn {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: var(--transition);
}

.dday-card:hover .dday-delete-btn {
    opacity: 1;
}

.dday-delete-btn:hover {
    color: #ef4444;
}

.dday-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 8px 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dday-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dday-count {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 10px;
    color: var(--primary);
}

.dday-count.urgent {
    color: #ef4444;
}

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

.dash-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.dash-card-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--bg-card-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--border-color);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-percentage {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
}

.quick-todo-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.quick-todo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.quick-todo-item.done {
    text-decoration: line-through;
    opacity: 0.55;
}

.donut-chart-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0;
}

.donut-center-text {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.donut-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.donut-val {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-main);
}

.subject-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.urgent-assess-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.urgent-assess-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
}

.assess-info-left strong {
    font-size: 0.85rem;
    display: block;
    color: var(--text-main);
}

.assess-info-left span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 16px 0;
}

.today-timetable-mini {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.mini-period-slot {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 2px;
}

.mini-period-num {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 700;
}

.mini-period-subject {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   TAB 2: Daily Planner Styles
   ========================================================================== */
.planner-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 22px;
    margin-bottom: 20px;
}

.date-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-picker-input {
    font-size: 1.05rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card-alt);
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.daily-meta-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.9rem;
}

.daily-meta-info .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.planner-two-col {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 20px;
}

/* Subject Filter Bar */
.subject-filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 14px;
    padding-bottom: 4px;
}

.filter-chip {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card-alt);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-chip:hover, .filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* To-Do List */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    transition: var(--transition);
}

.todo-item:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.todo-item.completed {
    background-color: var(--border-light);
    opacity: 0.6;
}

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-left-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.todo-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.todo-subject-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    color: #ffffff;
}

.todo-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
}

.todo-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 6px;
}

.todo-actions {
    display: flex;
    gap: 6px;
}

.todo-btn-icon {
    background: none;
    border: none;
    color: var(--text-sub);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
}

.todo-btn-icon:hover {
    color: #ef4444;
}

/* Daily Memo */
.daily-memo-textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    font-size: 0.88rem;
    background-color: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    resize: none;
    outline: none;
    line-height: 1.5;
}

.daily-memo-textarea:focus {
    border-color: var(--primary);
    background-color: var(--bg-card);
}

/* 10-Minute Timetable */
.timeline-palette {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    background: var(--bg-card-alt);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.palette-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
}

.palette-items {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.palette-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    background-color: var(--sub-color, #64748b);
    color: #ffffff;
    cursor: pointer;
    transition: var(--transition);
}

.palette-btn.erase-btn {
    background-color: #64748b;
}

.palette-btn.active {
    box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--sub-color, #64748b);
    transform: scale(1.05);
}

.timeline-grid-wrapper {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.timeline-header-row {
    display: grid;
    grid-template-columns: 50px repeat(6, 1fr);
    gap: 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-hour-row {
    display: grid;
    grid-template-columns: 50px repeat(6, 1fr);
    gap: 4px;
    align-items: center;
}

.timeline-hour-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
    user-select: none;
}

.timeline-block {
    height: 22px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.timeline-block:hover {
    border-color: var(--primary);
    transform: scale(1.06);
    z-index: 2;
}

/* ==========================================================================
   TAB 3: Stopwatch & Pomodoro Timer Styles
   ========================================================================== */
.timer-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 30px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.timer-mode-selector {
    display: inline-flex;
    background: var(--bg-card-alt);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.mode-btn {
    padding: 8px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.timer-subject-select-box {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.timer-subject-select-box label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.timer-subject-select-box select {
    width: auto;
    min-width: 140px;
}

.timer-circle-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 0 auto 30px auto;
}

.timer-progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg-circle {
    fill: none;
    stroke: var(--bg-card-alt);
    stroke-width: 10;
}

.timer-fg-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 660;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.5s ease;
}

.timer-display-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-status-tag {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.timer-numbers {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 1px;
    margin: 4px 0;
    font-variant-numeric: tabular-nums;
}

.timer-subject-tag {
    font-size: 0.82rem;
    font-weight: 700;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
}

.pomodoro-settings-box {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    padding: 14px;
    background: var(--bg-card-alt);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.pomo-setting-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.btn-timer-main {
    width: 70px;
    height: 70px;
    font-size: 1.6rem;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn-timer-main:hover {
    transform: scale(1.06);
}

.btn-timer-sub {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-timer-sub:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.focus-tips-card {
    background: var(--bg-card-alt);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: left;
}

.tip-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.focus-tips-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   TAB 4: Assessment & GPA Calculator Styles
   ========================================================================== */
.sub-tab-switcher {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.sub-tab-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.sub-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.subtab-pane {
    display: none;
}

.subtab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.assess-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.assess-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.assess-card {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    transition: var(--transition);
}

.assess-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.assess-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.assess-subject-badge {
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
}

.assess-dday-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: #ffe4e6;
    color: #e11d48;
}

.assess-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.assess-meta-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.assess-memo-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.assess-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

/* Custom Table (GPA & Timetable) */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.custom-table th, .custom-table td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.custom-table th {
    background-color: var(--bg-card-alt);
    font-weight: 700;
    color: var(--text-muted);
}

.custom-table td input {
    width: 100%;
    max-width: 90px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-card-alt);
    color: var(--text-main);
    outline: none;
    font-weight: 600;
}

.custom-table td input:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}

.action-btn-group {
    display: flex;
    gap: 8px;
}

.grade-result-banner {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 24px;
}

.result-item {
    text-align: center;
}

.result-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

.result-item.highlight .result-value {
    font-size: 1.8rem;
}

/* ==========================================================================
   TAB 5: Weekly Timetable Styles
   ========================================================================== */
.weekly-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.weekly-table th, .weekly-table td {
    border: 1px solid var(--border-color);
    padding: 10px 8px;
}

.weekly-table th {
    background-color: var(--bg-card-alt);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.period-header {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    background-color: var(--bg-card-alt);
    width: 90px;
}

.schedule-cell-input {
    width: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    outline: none;
    padding: 6px 0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.schedule-cell-input:focus {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ==========================================================================
   TAB 6: Statistics Styles
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stats-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
}

.bg-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.stat-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-details h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 2px;
}

/* ==========================================================================
   TAB 7: Settings & Backup Styles
   ========================================================================== */
.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.theme-picker-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.theme-card {
    background: var(--bg-card-alt);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.theme-card:hover, .theme-card.active {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-card.active {
    background-color: var(--primary-light);
}

.theme-preview {
    width: 100%;
    height: 44px;
    border-radius: var(--radius-sm);
}

.bg-sky-grad { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.bg-lavender-grad { background: linear-gradient(135deg, #c084fc, #7c3aed); }
.bg-mint-grad { background: linear-gradient(135deg, #34d399, #059669); }
.bg-peach-grad { background: linear-gradient(135deg, #fb923c, #ea580c); }
.bg-dark-grad { background: linear-gradient(135deg, #334155, #0f172a); }

.theme-card span {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.backup-actions {
    margin-top: 8px;
}

.backup-actions .desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.file-input-label {
    cursor: pointer;
}

.cf-guide-box {
    margin-top: 24px;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
}

.cf-guide-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cf-guide-box ol {
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.cf-guide-box li {
    margin-bottom: 6px;
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-sub);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    background: var(--bg-card-alt);
    border-top: 1px solid var(--border-color);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 78px;
        padding: 20px 10px;
    }
    .logo-text, .nav-item span, .sidebar-footer {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 14px 0;
    }
    .main-content {
        margin-left: 78px;
        padding: 20px 24px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .planner-two-col {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-cards-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .sidebar {
        width: 100vw;
        height: 60px;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--border-color);
        flex-direction: row;
        padding: 0;
        justify-content: space-around;
        align-items: center;
    }
    .sidebar-header {
        display: none;
    }
    .nav-menu {
        flex-direction: row;
        margin: 0;
        width: 100%;
        justify-content: space-around;
    }
    .nav-item {
        padding: 10px;
    }
    .main-content {
        margin-left: 0;
        margin-bottom: 70px;
        padding: 16px;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    .planner-header-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .grade-result-banner {
        flex-direction: column;
        gap: 14px;
    }
}