/* Theme Name: BimStudies Modern
Description: A high-performance theme with a Liquid Glass UI/UX aesthetic.
Version: 1.2.4
*/

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Animations */
@keyframes infinite-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.animate-infinite-scroll {
    animation: infinite-scroll 40s linear infinite;
    display: flex;
    width: max-content;
}

.animate-infinite-scroll:hover {
    animation-play-state: paused;
}

/* Global Variables & Base */
:root {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.6);
    --liquid-indigo: #4f46e5;
    --liquid-slate: #f8fafc;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.05) 0px, transparent 50%),
        var(--liquid-slate);
    color: #1e293b;
}

/* Liquid Glass Core */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* Navigation & Link Effects */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link-active {
    color: var(--liquid-indigo);
}

.nav-link-active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 99px;
}

/* Interactions */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-2px);
}

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

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

/* Floating TOC Logic & Layout */
#floating-toc {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9998;
    /* Above content, below toggle */
    overflow-y: auto;
}

#floating-toc[data-active="true"] {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateY(0) !important;
}

#toc-toggle {
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#toc-toggle:active {
    transform: scale(0.9);
}

/* Tablet & Mobile Optimizations for TOC */
@media (max-width: 768px) {
    #floating-toc {
        width: calc(100vw - 2rem) !important;
        right: 1rem !important;
        left: 1rem !important;
        bottom: 5.5rem !important;
        /* Spaced above the button */
        max-height: 65vh !important;
        position: fixed;
        border-radius: 1.5rem;
    }

    #toc-toggle {
        right: 1rem !important;
        bottom: 1rem !important;
        width: 3.5rem !important;
        height: 3.5rem !important;
        position: fixed;
        box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    }
}

/* Logo Sizing Fixes */
.custom-logo-wrapper,
.custom-logo-link {
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
}

img.custom-logo {
    height: 28px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* Menus & Drawer Styling */
#mobile-menu,
#topic-drawer,
#floating-toc {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(30px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.15) !important;
}

nav ul,
nav li,
#mobile-menu ul,
#mobile-menu li {
    list-style: none !important;
}

#toc-close {
    transition: all 0.3s ease;
}

#toc-close:hover {
    transform: rotate(90deg) scale(1.1);
    color: var(--liquid-indigo);
}

/* Typewriter Cursor */
.typing-active::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--liquid-indigo);
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}