@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* --- Light & Dark Theme CSS Custom Properties --- */
:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-subtle: #f8fafc;
    --border-card: #f1f5f9;
    --border-subtle: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --card-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.07), 0 4px 12px -4px rgba(0, 0, 0, 0.03);
    --card-hover-shadow: 0 20px 40px -12px rgba(99, 102, 241, 0.15), 0 8px 20px -6px rgba(0, 0, 0, 0.05);
    --pill-bg: #f1f5f9;
    --glow-color: rgba(99, 102, 241, 0.35);
}

html.dark {
    --bg-page: #0b0f19;
    --bg-card: #111827;
    --bg-card-subtle: #1e293b;
    --border-card: #1e293b;
    --border-subtle: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --card-shadow: 0 14px 35px -10px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --card-hover-shadow: 0 22px 45px -12px rgba(99, 102, 241, 0.25), 0 0 1px 1px rgba(99, 102, 241, 0.3);
    --pill-bg: #1e293b;
    --glow-color: rgba(99, 102, 241, 0.5);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background glowing ambient mesh */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1000px;
    height: 480px;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.06) 45%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

html.dark .ambient-glow {
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, 0.22) 0%, rgba(147, 51, 234, 0.12) 45%, transparent 75%);
}

.ambient-glow-bottom {
    position: fixed;
    bottom: 0;
    right: 10%;
    width: 600px;
    height: 400px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.05) 0%, rgba(99, 102, 241, 0.03) 50%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

html.dark .ambient-glow-bottom {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 75%);
}

/* Glassmorphism & Soft Shadows */
.card-shadow {
    box-shadow: var(--card-shadow);
}

.card-hover {
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #334155;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
html.dark ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Duolingo-style Roadmap Timeline Styles */
.roadmap-step {
    position: relative;
    padding-left: 2.75rem;
}

.roadmap-step::before {
    content: '';
    position: absolute;
    left: 1.15rem;
    top: 2.5rem;
    bottom: -1rem;
    width: 3px;
    background: #e2e8f0;
    border-radius: 4px;
}

html.dark .roadmap-step::before {
    background: #1e293b;
}

.roadmap-step:last-child::before {
    display: none;
}

.roadmap-step.active::before {
    background: linear-gradient(to bottom, #6366f1, #e2e8f0);
}

html.dark .roadmap-step.active::before {
    background: linear-gradient(to bottom, #6366f1, #1e293b);
}

.roadmap-node {
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    z-index: 10;
}

/* Pulsing effect for active/in-progress items */
.pulse-glow {
    animation: pulseGlow 2.4s infinite;
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Bottom Safe Area for Mobile (iPhone Notch / Gestures) */
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom, 1.25rem);
}

/* Multi-line clamp for expandable long comments and instructions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sleek gradient text utility */
.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Print Styles for Clean PDF Report Export */
@media print {
    body {
        background: #ffffff !important;
        color: #0f172a !important;
        padding-bottom: 0 !important;
    }

    .ambient-glow,
    .ambient-glow-bottom,
    .no-print,
    #btnScrollToTop,
    #subjectFilterBar,
    #btnOpenCuratorModal,
    #curatorModal,
    .fixed {
        display: none !important;
    }

    .card-shadow,
    .card-hover {
        box-shadow: none !important;
        border: 1px solid #e2e8f0 !important;
    }

    .backdrop-blur-md,
    .backdrop-blur-xl {
        backdrop-filter: none !important;
        background: #ffffff !important;
    }

    /* Keep page breaks clean */
    .break-inside-avoid {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

