/* =========================================
   1. GLOBAL RESET & SCROLLBARS
   ========================================= */

/* Prevent horizontal scrolling on mobile caused by animations/blobs */
html, body {
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
}

/* Global Custom Scrollbar (Chrome/Safari/Edge) */
::-webkit-scrollbar { 
    width: 10px; 
    height: 10px; 
}

::-webkit-scrollbar-track { 
    background: transparent; 
}

::-webkit-scrollbar-thumb { 
    background: #cbd5e1; /* slate-300 */
    border-radius: 5px; 
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover { 
    background: #94a3b8; /* slate-400 */
    border: 2px solid transparent;
    background-clip: content-box;
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-thumb { 
    background: #475569; /* slate-600 */
}

.dark ::-webkit-scrollbar-thumb:hover { 
    background: #64748b; /* slate-500 */
}

/* Utility to hide scrollbars (for horizontal tab navigation) */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Thinner scrollbar for internal containers (Preview Grid) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
    border: none;
}
.dark .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
}


/* =========================================
   2. GLASSMORPHISM THEME
   ========================================= */

.glass {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 
                0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.65); /* Slate-900 transparent */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 
                0 2px 4px -1px rgba(0, 0, 0, 0.1);
}


/* =========================================
   3. ANIMATED BACKGROUND MESH
   ========================================= */

.bg-mesh {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #0f172a; /* Slate-900 (Dark Mode Base) */
}

/* In light mode, change base to white/slate-50 */
html:not(.dark) .bg-mesh { 
    background: #f8fafc; 
}

/* Animated Blobs */
.blob-1, .blob-2, .blob-3 {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px); /* Soft blur effect */
    opacity: 0.45;
    animation: blob 10s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.blob-1 { 
    top: -10%; 
    left: -10%; 
    width: 500px; 
    height: 500px; 
    background: #3b82f6; /* Blue-500 */
}

.blob-2 { 
    top: 20%; 
    right: -20%; 
    width: 600px; 
    height: 600px; 
    background: #8b5cf6; /* Violet-500 */
    animation-delay: -2s; 
}

.blob-3 { 
    bottom: -20%; 
    left: 20%; 
    width: 600px; 
    height: 600px; 
    background: #10b981; /* Emerald-500 */
    animation-delay: -4s; 
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .blob-1, .blob-2, .blob-3 {
        animation: none;
        opacity: 0.2;
    }
}


/* =========================================
   4. UTILITIES & TOOLS
   ========================================= */

/* Checkerboard pattern for transparent image backgrounds */
.checkboard {
    background-image: 
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%), 
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%), 
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
    background-color: #ffffff;
}

.dark .checkboard {
    background-image: 
        linear-gradient(45deg, #334155 25%, transparent 25%), 
        linear-gradient(-45deg, #334155 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #334155 75%), 
        linear-gradient(-45deg, transparent 75%, #334155 75%);
    background-color: #1e293b; 
}

/* Syntax Highlighting Overrides (Prism.js) */
code[class*="language-"],
pre[class*="language-"] {
    font-family: 'Fira Code', monospace !important;
    font-size: 12px !important; /* Slightly smaller for better mobile fit */
    text-shadow: none !important;
}

/* Ensure code blocks don't break layout on mobile */
pre {
    max-width: 100%;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    overflow-x: auto;
}

/* FAQ Details Animation */
details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}
