/* ==========================================================================
   StudyMate AI - Design System & Modern Aesthetics
   ========================================================================== */

:root {
    /* Color Tokens (Dark Mode Default) */
    --bg-canvas: #090a14;
    --bg-surface: #101222;
    --bg-surface-elevated: #171a32;
    --bg-card: rgba(20, 23, 44, 0.72);
    --bg-card-hover: rgba(28, 32, 60, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(124, 92, 252, 0.4);

    --text-main: #f3f4fd;
    --text-muted: #8e92bc;
    --text-dim: #60648c;

    --primary: #7c5cfc;
    --primary-light: #9d85fd;
    --primary-dark: #6243df;
    --primary-glow: rgba(124, 92, 252, 0.28);
    --primary-gradient: linear-gradient(135deg, #7c5cfc 0%, #4f46e5 100%);

    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-pink: #ec4899;
    --accent-purple: #a855f7;

    --gradient-purple: linear-gradient(135deg, #8b5cf6, #6366f1);
    --gradient-blue: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gradient-green: linear-gradient(135deg, #10b981, #059669);
    --gradient-orange: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-pink: linear-gradient(135deg, #ec4899, #8b5cf6);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 28px rgba(124, 92, 252, 0.25);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --sidebar-width: 270px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-canvas: #f4f5fc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8f9ff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-hover: rgba(99, 102, 241, 0.45);

    --text-main: #141527;
    --text-muted: #5e6080;
    --text-dim: #9294b0;

    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.2);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    --shadow-sm: 0 2px 8px rgba(18, 20, 48, 0.06);
    --shadow-md: 0 8px 24px rgba(18, 20, 48, 0.08);
    --shadow-lg: 0 16px 40px rgba(18, 20, 48, 0.12);
    --shadow-glow: 0 0 28px rgba(99, 102, 241, 0.18);
}

/* ==========================================================================
   Base & Resets
   ========================================================================== */

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
}

button, input, textarea, select {
    font-family: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

a {
    color: var(--primary-light);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(140, 144, 185, 0.25);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(140, 144, 185, 0.45);
}

/* Confetti Layer */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
}

/* Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 24px 18px 20px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-normal), background-color 0.3s;
    overflow-y: auto;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: #ffffff;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.ai-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(124, 92, 252, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(124, 92, 252, 0.3);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mobile-close-btn {
    display: none;
    font-size: 20px;
    color: var(--text-muted);
    padding: 4px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    margin-bottom: 22px;
}

.avatar-ring {
    position: relative;
    padding: 2px;
    border-radius: 50%;
    background: var(--primary-gradient);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: grid;
    place-items: center;
    font-size: 14px;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.user-status {
    font-size: 11px;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: var(--text-dim);
    margin: 6px 8px 12px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 600;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
    transform: translateX(3px);
}

.nav-item.active {
    color: #ffffff;
    background: var(--primary-gradient);
    box-shadow: 0 4px 16px var(--primary-glow);
}

.nav-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
}

.nav-title {
    flex: 1;
    text-align: left;
}

.nav-pill {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.new-pill {
    background: var(--gradient-pink);
}

.badge-count {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.nav-item:not(.active) .badge-count {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.streak-card {
    padding: 14px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(239, 68, 68, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.streak-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.streak-icon {
    font-size: 22px;
}

.streak-label {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: var(--accent-amber);
}

.streak-days {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.streak-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 8px;
}

.streak-bar-fill {
    height: 100%;
    background: var(--gradient-orange);
    border-radius: var(--radius-full);
}

.streak-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    line-height: 1.3;
}

.sidebar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.icon-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.icon-tool-btn:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    background: var(--bg-card-hover);
}

/* ==========================================================================
   Main Content & Topbar
   ========================================================================== */

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 36px 36px;
    max-width: 1540px;
}

.topbar {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    padding: 0;
}

.menu-toggle span {
    display: block;
    height: 2.5px;
    width: 100%;
    background: var(--text-main);
    border-radius: 4px;
}

.breadcrumbs {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: var(--text-dim);
    display: block;
    margin-bottom: 2px;
}

.page-main-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.topbar-pill-btn:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
    transform: translateY(-1px);
}

.primary-glow-btn {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.primary-glow-btn:hover {
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(124, 92, 252, 0.4);
}

.level-badge {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-light);
    font-family: var(--font-heading);
}

/* Page Transition */
.page {
    display: none;
    animation: fadeInPage 0.25s ease-out;
}

.page.active-page {
    display: block;
}

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

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(124, 92, 252, 0.4);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-large {
    padding: 14px 26px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.btn-glow {
    position: relative;
}

.btn-sm-primary {
    padding: 6px 14px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    color: white;
}

.btn-sm-secondary {
    padding: 6px 14px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-sm-ghost {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-sm-ghost:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

.btn-text-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
}
.btn-text-link:hover {
    text-decoration: underline;
}

.btn-icon-subtle {
    color: var(--text-dim);
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    transition: color 0.2s;
}
.btn-icon-subtle:hover {
    color: var(--primary-light);
}

/* Inputs & Form Elements */
input, textarea, select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-size: 13px;
    transition: all var(--transition-fast);
    outline: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.styled-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e92bc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 32px;
}

/* ==========================================================================
   Dashboard Page Aesthetics
   ========================================================================== */

/* Welcome Hero Banner */
.welcome-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(31, 23, 71, 0.7) 0%, rgba(20, 24, 52, 0.8) 50%, rgba(13, 33, 62, 0.7) 100%);
    border: 1px solid rgba(124, 92, 252, 0.3);
    border-radius: var(--radius-xl);
    padding: 38px 42px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 36px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .welcome-banner {
    background: linear-gradient(135deg, #eef0fd 0%, #f3e8ff 50%, #e0f2fe 100%);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 0 16px 40px rgba(18, 20, 48, 0.08);
}

.welcome-content {
    flex: 1;
    max-width: 680px;
    z-index: 2;
}

.welcome-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(124, 92, 252, 0.15);
    border: 1px solid rgba(124, 92, 252, 0.3);
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 14px;
}

.pulse-sparkle {
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

.welcome-content h2 {
    font-size: clamp(26px, 3.4vw, 38px);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.18;
    margin-bottom: 12px;
}

.welcome-content h2 span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 580px;
}

.welcome-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.daily-quote-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.quote-mark {
    font-size: 18px;
    color: var(--primary-light);
    font-weight: 800;
    line-height: 1;
}

.quote-author {
    font-weight: 600;
    color: var(--text-main);
    font-style: normal;
}

/* Hero Visual Art */
.welcome-visual {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.illustration-frame {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    background: rgba(16, 18, 34, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    animation: floatBob 4s ease-in-out infinite;
}

.badge-top {
    top: -10px;
    right: -10px;
}

.badge-bottom {
    bottom: -10px;
    left: -10px;
    animation-delay: -2s;
}

@keyframes floatBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Stats Overview Bar */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    transition: all var(--transition-normal);
}

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

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 20px;
}

.fire-bg { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.timer-bg { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.task-bg { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.quiz-bg { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }

.stat-data {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-name {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.stat-tag.positive {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.25);
}

/* Study Toolkit Grid */
.section-title-bar {
    margin-bottom: 18px;
}

.section-title-bar h3 {
    font-size: 18px;
    letter-spacing: -0.3px;
    margin-bottom: 4px;
}

.section-title-bar p {
    font-size: 12.5px;
    color: var(--text-muted);
}

.toolkit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}

.toolkit-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.toolkit-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.toolkit-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.toolkit-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 18px;
}

.purple-gradient { background: var(--gradient-purple); }
.blue-gradient { background: var(--gradient-blue); }
.cyan-gradient { background: linear-gradient(135deg, #06b6d4, #0284c7); }
.orange-gradient { background: var(--gradient-orange); }
.green-gradient { background: var(--gradient-green); }
.pink-gradient { background: var(--gradient-pink); }

.toolkit-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.toolkit-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
    flex: 1;
}

.toolkit-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.arrow-glyph {
    transition: transform var(--transition-fast);
}

.toolkit-card:hover .arrow-glyph {
    transform: translateX(4px);
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 18px;
}

.progress-panel, .tips-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
}

.panel-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.panel-header-inline h4 {
    font-size: 16px;
    margin-bottom: 4px;
}

.panel-header-inline p {
    font-size: 12px;
    color: var(--text-muted);
}

.percentage-pill {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(124, 92, 252, 0.12);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.progress-bar-container {
    height: 10px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.progress-footer-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
}

.progress-footer-stats .label {
    color: var(--text-muted);
    margin-right: 6px;
}

.tips-panel h4 {
    font-size: 15px;
    color: var(--primary-light);
    margin-bottom: 12px;
}

.tips-panel p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ==========================================================================
   Tool Header Banner
   ========================================================================== */

.tool-banner {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tool-banner-info {
    max-width: 650px;
}

.tool-num-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: var(--primary-light);
    margin-bottom: 6px;
}

.tool-banner-info h2 {
    font-size: 26px;
    letter-spacing: -0.6px;
    margin-bottom: 6px;
}

.tool-banner-info h2 span {
    color: var(--primary-light);
}

.tool-banner-info p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.55;
}

.sample-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    margin-bottom: 6px;
    display: block;
}

.sample-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip-btn {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.chip-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: var(--bg-surface-elevated);
}

/* ==========================================================================
   Notes Summarizer Aesthetics
   ========================================================================== */

.summarizer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.editor-card, .result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

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

.editor-label {
    font-size: 13px;
    font-weight: 700;
}

.editor-actions {
    display: flex;
    gap: 8px;
}

.file-upload-btn {
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.file-upload-btn:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

textarea#notesInput {
    width: 100%;
    resize: vertical;
    min-height: 240px;
    line-height: 1.7;
    margin-bottom: 14px;
    font-size: 13px;
}

.editor-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.meta-counters {
    font-size: 11.5px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot-sep {
    color: var(--border-color);
}

.summary-options-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.option-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.option-group .styled-select {
    padding: 6px 28px 6px 10px;
    font-size: 11.5px;
}

.editor-submit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.engine-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    color: var(--text-dim);
}

.ai-spark-icon {
    color: var(--accent-amber);
}

/* Result Section */
.result-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title-group h3 {
    font-size: 16px;
}

.result-mode-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(124, 92, 252, 0.15);
    color: var(--primary-light);
}

.result-empty-placeholder {
    margin: auto 0;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-dim);
}

.result-empty-placeholder .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.result-empty-placeholder h4 {
    font-size: 16px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.result-empty-placeholder p {
    font-size: 12.5px;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.6;
}

.result-content {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    padding-right: 6px;
}

.result-section-block {
    margin-bottom: 20px;
}

.result-section-block h4 {
    font-size: 13.5px;
    color: var(--primary-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-executive-box {
    background: var(--bg-surface-elevated);
    border-left: 3px solid var(--primary);
    padding: 14px 16px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 18px;
}

.key-points-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.key-points-list li {
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.bullet-icon {
    color: var(--accent-cyan);
    font-weight: 800;
    margin-top: 2px;
}

.glossary-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glossary-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
}

.glossary-term {
    font-weight: 700;
    color: var(--text-main);
}

.glossary-def {
    color: var(--text-muted);
}

.summary-bridges-row {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bridge-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   Quiz Generator Aesthetics
   ========================================================================== */

.quiz-container {
    max-width: 900px;
    margin: 0 auto;
}

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    margin-bottom: 8px;
}

.topic-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.topic-input-wrapper input {
    width: 100%;
    padding-right: 140px;
}

.btn-inside-input {
    position: absolute;
    right: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-inside-input:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.topic-suggestions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--text-dim);
}

.topic-chip {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.topic-chip:hover {
    color: var(--text-main);
    border-color: var(--primary-light);
}

.full-width-select {
    width: 100%;
}

.setup-actions {
    text-align: center;
}

/* Active Quiz Arena */
.quiz-arena {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
}

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

.badge-topic {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(124, 92, 252, 0.15);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-right: 10px;
}

.question-tracker {
    font-size: 12.5px;
    color: var(--text-muted);
}

.arena-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.quiz-track-bar {
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 28px;
}

.quiz-track-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.question-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 22px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    text-align: left;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    transition: all var(--transition-fast);
    position: relative;
}

.option-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--primary-light);
    transform: translateX(4px);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.option-btn.selected {
    border-color: var(--primary);
    background: rgba(124, 92, 252, 0.12);
}

.option-btn.correct {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: var(--accent-green) !important;
    color: #ffffff;
}

.option-btn.correct .option-letter {
    background: var(--accent-green);
    color: #ffffff;
    border-color: var(--accent-green);
}

.option-btn.wrong {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: #ef4444 !important;
}

.option-btn.wrong .option-letter {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.explanation-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    padding: 16px 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-bottom: 22px;
    animation: fadeIn 0.3s ease;
}

.explanation-title {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.explanation-box p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

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

/* Quiz Score Card */
.quiz-score-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
}

.score-celebration-icon {
    font-size: 54px;
    margin-bottom: 12px;
    animation: bouncePop 0.6s ease;
}

@keyframes bouncePop {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.score-subtitle {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.score-circle-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 36px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

.score-big {
    font-family: var(--font-heading);
    font-size: 38px;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1;
    margin-bottom: 4px;
}

.score-percentage {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.grade-pill {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 12px;
    border-radius: var(--radius-full);
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.score-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 34px;
    flex-wrap: wrap;
}

.quiz-review-section {
    text-align: left;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
}

.quiz-review-section h4 {
    font-size: 16px;
    margin-bottom: 16px;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.review-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.review-item.review-correct {
    border-left: 4px solid var(--accent-green);
}

.review-item.review-wrong {
    border-left: 4px solid #ef4444;
}

.review-question-text {
    font-weight: 700;
    font-size: 13.5px;
    margin-bottom: 8px;
}

.review-answers-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   Flashcards Hub Aesthetics
   ========================================================================== */

.flashcards-layout {
    max-width: 820px;
    margin: 0 auto;
}

.deck-selector-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.deck-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dim);
}

.deck-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.deck-pill {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.deck-pill:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

.deck-pill.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* 3D Flip Flashcard */
.flashcard-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flashcard-container {
    width: 100%;
    min-height: 340px;
    perspective: 1200px;
    cursor: pointer;
    outline: none;
    margin-bottom: 24px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 340px;
    border-radius: var(--radius-xl);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard-container.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast);
}

.card-face:hover {
    border-color: var(--border-color-hover);
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, rgba(23, 27, 54, 0.95), rgba(16, 18, 34, 0.98));
    border-color: rgba(124, 92, 252, 0.35);
}

[data-theme="light"] .card-back {
    background: linear-gradient(135deg, #ffffff, #f4f5fc);
}

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

.card-deck-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.card-index-indicator {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-dim);
}

.card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 10px;
    flex: 1;
}

.card-prompt-type {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.card-term {
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.card-definition {
    font-size: clamp(14px, 2vw, 17px);
    color: var(--text-main);
    line-height: 1.7;
    max-width: 580px;
}

.card-face-footer {
    text-align: center;
}

.flip-hint {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
}

/* Flashcard Controls */
.card-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-control {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.neutral-control {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}
.neutral-control:hover {
    color: var(--text-main);
    border-color: var(--border-color-hover);
}

.flip-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--primary-glow);
    color: var(--primary-light);
}
.flip-btn:hover {
    background: var(--primary);
    color: white;
}

.red-control {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
}
.red-control:hover {
    background: #ef4444;
    color: white;
}

.green-control {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--accent-green);
}
.green-control:hover {
    background: var(--accent-green);
    color: white;
}

.deck-progress-bar-wrap {
    width: 100%;
    max-width: 540px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.deck-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.deck-progress-track {
    height: 6px;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.deck-progress-fill {
    height: 100%;
    background: var(--gradient-green);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* ==========================================================================
   Focus Pomodoro Aesthetics
   ========================================================================== */

.pomodoro-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    max-width: 1080px;
    margin: 0 auto;
}

.pomodoro-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.timer-mode-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-surface-elevated);
    padding: 5px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.timer-tab {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.timer-tab.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Circular SVG Timer */
.timer-circle-wrap {
    position: relative;
    width: 270px;
    height: 270px;
    display: grid;
    place-items: center;
    margin-bottom: 32px;
}

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

.timer-track {
    fill: none;
    stroke: var(--bg-surface-elevated);
    stroke-width: 12px;
}

.timer-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12px;
    stroke-linecap: round;
    stroke-dasharray: 722;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.8s ease, stroke 0.3s;
}

.timer-inner-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timer-mode-label {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.timer-countdown {
    font-family: var(--font-heading);
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
    margin-bottom: 6px;
}

.timer-session-info {
    font-size: 12px;
    color: var(--text-dim);
}

.timer-buttons-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Ambient Sound Panel */
.ambient-sound-panel {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    text-align: left;
}

.sound-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sound-icon {
    font-size: 18px;
}

.sound-info strong {
    font-size: 12px;
    display: block;
}

.sound-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sound-chip {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.sound-chip:hover {
    color: var(--text-main);
    border-color: var(--primary-light);
}

.sound-chip.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
}

/* Pomodoro Sidebar */
.pomodoro-sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.panel-section h4 {
    font-size: 15px;
    margin-bottom: 14px;
}

.focus-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.focus-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

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

.item-label {
    color: var(--text-muted);
}

.benefit-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.benefit-list li {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.benefit-list strong {
    color: var(--text-main);
}

/* ==========================================================================
   Study Planner Aesthetics
   ========================================================================== */

.planner-layout {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.task-creator-panel {
    padding: 22px 26px;
}

.task-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.full-flex {
    flex: 1;
}

.input-field-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-row-bottom {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row-bottom .input-field-group {
    flex: 1;
    min-width: 140px;
}

.form-row-bottom .button-group {
    flex: 0 0 auto;
}

.styled-date-input {
    width: 100%;
}

/* Tasks Filter & List */
.task-list-panel {
    padding: 22px 26px;
}

.task-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 6px;
}

.filter-tab {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    color: var(--text-main);
}

.filter-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.task-search-input {
    padding: 6px 12px;
    font-size: 12px;
    width: 180px;
}

.task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.task-item:hover {
    border-color: var(--border-color-hover);
    transform: translateX(2px);
}

.task-checkbox-wrap {
    display: flex;
    align-items: center;
}

.task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    border-radius: 4px;
}

.task-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.task-item.done .task-title {
    text-decoration: line-through;
    color: var(--text-dim);
}

.task-meta-row {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 11px;
}

.category-tag {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-weight: 600;
}

.priority-badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 10px;
}

.priority-High {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.priority-Medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.priority-Low {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.due-date-text {
    color: var(--text-dim);
}

.task-delete-btn {
    color: var(--text-dim);
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: color 0.2s;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.empty-state .empty-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.empty-state h4 {
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 12px;
}

/* ==========================================================================
   AI Study Buddy Chat Aesthetics
   ========================================================================== */

.chat-container {
    max-width: 880px;
    margin: 0 auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 520px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chat-msg {
    display: flex;
    gap: 12px;
    max-width: 82%;
    animation: fadeIn 0.2s ease-out;
}

.user-msg {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-msg {
    align-self: flex-start;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    flex-shrink: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
}

.ai-msg .msg-avatar {
    background: var(--primary-gradient);
    color: white;
}

.msg-bubble {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 13.5px;
    line-height: 1.6;
    position: relative;
}

.user-msg .msg-bubble {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-bottom-right-radius: 4px;
}

.ai-msg .msg-bubble {
    border-bottom-left-radius: 4px;
}

.msg-sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 4px;
}

.msg-text ul, .msg-text ol {
    margin: 8px 0 8px 20px;
}

.msg-time {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 6px;
    text-align: right;
}

.user-msg .msg-time {
    color: rgba(255, 255, 255, 0.7);
}

.chat-suggestions-bar {
    padding: 10px 20px;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
}

.suggestions-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-dim);
    white-space: nowrap;
}

.suggestion-chips {
    display: flex;
    gap: 8px;
}

.chat-chip {
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.chat-chip:hover {
    color: var(--text-main);
    border-color: var(--primary-light);
}

.chat-input-bar {
    padding: 16px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input-bar textarea {
    flex: 1;
    resize: none;
    padding: 10px 14px;
    height: 42px;
    border-radius: var(--radius-full);
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 17px;
}

.modal-close {
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

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

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-label {
    font-size: 13px;
    font-weight: 700;
}

.settings-sub {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.radio-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 12px;
}

.radio-card input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.radio-card strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 2px;
}

.radio-card span {
    color: var(--text-muted);
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.toggle-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.api-key-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
}

.data-actions-row {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   Toasts & Utilities
   ========================================================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlide 0.3s ease-out;
}

.toast-success {
    border-left: 4px solid var(--accent-green);
}

.toast-info {
    border-left: 4px solid var(--primary);
}

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

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

.footer-content {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 10px;
}

.hidden {
    display: none !important;
}

/* Loading Spinner */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .toolkit-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .summarizer-grid {
        grid-template-columns: 1fr;
    }
    .pomodoro-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }
    .mobile-close-btn {
        display: block;
    }
    .menu-toggle {
        display: flex;
    }
    .main {
        margin-left: 0;
        padding: 0 18px 24px;
    }
    .welcome-banner {
        flex-direction: column-reverse;
        padding: 28px 24px;
        text-align: center;
    }
    .welcome-content {
        align-items: center;
        display: flex;
        flex-direction: column;
    }
    .welcome-actions {
        justify-content: center;
    }
    .toolkit-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
    .setup-grid {
        grid-template-columns: 1fr;
    }
}