:root {
    --brand-primary: #4f46e5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

html.dark body {
    background-color: #0b0f19;
    color: #f1f5f9;
}

.hero-title {
    font-size: clamp(1.45rem, 3.2vw + 0.5rem, 2.75rem);
    line-height: 1.18;
}

.section-title {
    font-size: clamp(1.2rem, 2vw + 0.4rem, 1.85rem);
    line-height: 1.25;
}

.gradient-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #0f172a 100%);
}

html.dark .gradient-hero {
    background: linear-gradient(135deg, #090916 0%, #1e1b4b 50%, #030712 100%);
}

.card-hover {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease;
}

@media (hover: hover) {
    .card-hover:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
    }
    html.dark .card-hover:hover {
        box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.4);
    }
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-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;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Touch range sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    touch-action: pan-x;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #4f46e5;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    margin-top: -8px;
    border: 2px solid #ffffff;
    transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:active {
    transform: scale(1.15);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 9999px;
}

html.dark input[type=range]::-webkit-slider-runnable-track {
    background: #334155;
}

/* 3D Flip Card for Flashcards */
.perspective-1000 {
    perspective: 1000px;
}

.card-inner {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

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

.card-front, .card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-back {
    transform: rotateY(180deg);
}

/* Audio Wave Animation */
@keyframes soundWave {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.sound-bar {
    display: inline-block;
    width: 3px;
    background-color: #38bdf8;
    border-radius: 9999px;
    animation: soundWave 1s infinite ease-in-out;
}

.sound-bar:nth-child(2) { animation-delay: 0.2s; height: 10px; }
.sound-bar:nth-child(3) { animation-delay: 0.4s; height: 14px; }
.sound-bar:nth-child(4) { animation-delay: 0.1s; height: 8px; }

@media (max-width: 767px) {
    body {
        padding-bottom: 74px; /* Space for mobile bottom bar */
    }
}

@media print {
    nav, footer, #mobile-bottom-nav, #exam-timer-widget, #scroll-top-btn, .no-print, button:not(.print-include) {
        display: none !important;
    }
    body {
        background: white !important;
        color: black !important;
        padding-bottom: 0 !important;
    }
    .tab-content {
        display: block !important;
    }
    .page-break-after {
        page-break-after: always;
    }
}
