:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
}

body {
    background-color: #0A192F;
    color: #F8FAFC;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    background: var(--glass-hover);
    border-color: rgba(16, 185, 129, 0.3);
}

.emerald-gradient {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.text-gradient {
    background: linear-gradient(to right, #ffffff, #10B981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* SPA Section Transitions */
.app-section {
    display: none;
    min-height: 100vh;
    padding-top: 140px;
    padding-bottom: 60px;
    animation: fadeUp 0.5s ease-out forwards;
}

.app-section.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accordion & Interactive Elements */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.accordion-content.expanded {
    max-height: 1000px;
}

.result-reveal {
    overflow: hidden;
    /* initial state configured inline via JS to allow smooth scrollHeight transition */
}

.animate-fade-in {
    animation: fadeInReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInReveal {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AI Sidebar */
#ai-tutor {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#ai-tutor.open {
    transform: translateX(0);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

/* Focus Mode */
body.focus-mode::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.95);
    z-index: 40;
    backdrop-filter: blur(5px);
}

.focus-content {
    position: relative;
    z-index: 50;
}

/* Custom Scrollbar for Main Pages */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #10B981;
}

/* Hide Scrollbars entirely for Math Equations while keeping scroll functionality */
.math-scroll-hidden {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}
.math-scroll-hidden::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

/* Custom Scrollbar for Inner Playlist */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5); /* Emerald 500 w/ opacity */
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.8);
}