/**
 * Study Lattice - Base CSS
 * Design Tokens, CSS Reset, Typography
 * Glass Morphism Design System
 */

/* ============================================
   DESIGN TOKENS (CSS Variables)
   ============================================ */
:root {
    /* Night Mode (Default) */
    --accent: #34D399;
    --accent-hover: #4ade80;
    --accent-soft: rgba(52, 211, 153, 0.15);
    --accent-glow: rgba(52, 211, 153, 0.3);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-inverse: #0f172a;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-bg-solid: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.1);
    --glass-active: rgba(255, 255, 255, 0.15);

    /* Backdrop blur */
    --blur-sm: blur(8px);
    --blur-md: blur(16px);
    --blur-lg: blur(30px);

    /* Background Gradient */
    --bg-gradient: linear-gradient(135deg, #0a0a0f 0%, #14161F 50%, #0A0F1A 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* Status Colors */
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --error: #ef4444;
    --error-soft: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.15);

    /* SVG Animation Colors (Night Mode) */
    --svg-doubt: rgba(251, 191, 36, 0.9);
    --svg-single-tick: rgba(52, 211, 153, 0.9);
    --svg-double-tick: rgba(34, 197, 94, 0.9);
    --svg-cross: rgba(239, 68, 68, 0.8);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 100px;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-slower: 0.4s ease;

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-tooltip: 600;
}

/* Day Mode Theme */
.day-mode {
    --accent: #059669;
    --accent-hover: #047857;
    --accent-soft: rgba(5, 150, 105, 0.1);
    --accent-glow: rgba(5, 150, 105, 0.2);

    /* Text Colors */
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.7);
    --text-muted: rgba(15, 23, 42, 0.7);
    --text-inverse: #ffffff;

    /* Glass Effects */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-bg-solid: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-hover: rgba(255, 255, 255, 0.8);
    --glass-active: rgba(255, 255, 255, 0.95);

    /* Background Gradient */
    --bg-gradient: radial-gradient(ellipse at top left, #fcfcfc 0%, #d1d1d1 50%, #b3b3b3 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 30px var(--accent-glow);

    /* SVG Animation Colors (Day Mode) */
    --svg-doubt: rgba(245, 158, 11, 0.9);
    --svg-single-tick: rgba(5, 150, 105, 0.9);
    --svg-double-tick: rgba(22, 163, 74, 0.9);
    --svg-cross: rgba(220, 38, 38, 0.8);
}


/* ============================================
   CSS RESET
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    background-color: #0a0a0f;
}

html.day-mode {
    background-color: #b3b3b3;
}

html::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, #0a0a0f 0%, #14161F 50%, #0A0F1A 100%);
    z-index: -9999;
    pointer-events: none;
}

html.day-mode::before {
    background: radial-gradient(ellipse at top left, #fcfcfc 0%, #d1d1d1 50%, #b3b3b3 100%);
}

body {
    width: 100%;
    min-height: 100vh;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    transition: color 0.3s ease;
}

/* Selection */
::selection {
    background-color: var(--accent-soft);
    color: var(--text-primary);
}

::-moz-selection {
    background-color: var(--accent-soft);
    color: var(--text-primary);
}

/* Prevent text selection on interactive elements */
.no-select {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Allow text selection */
.allow-select {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}


/* ============================================
   TYPOGRAPHY
   ============================================ */

/* Display Headings - Bebas Neue */
.display-xl {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(5rem, 15vw, 14rem);
    line-height: 0.85;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.display-lg {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3.5rem, 10vw, 8rem);
    line-height: 0.9;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.display-md {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.display-sm {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.75rem, 4vw, 3rem);
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

/* Body Text - Manrope */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.25rem); }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.text-lg { font-size: 1.125rem; }
.text-md { font-size: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Label Text */
.label {
    font-family: 'Manrope', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
}

.sublabel {
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font Weights */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }


/* ============================================
   LINKS
   ============================================ */
a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

a:visited {
    color: var(--accent);
}

.link-underline {
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--glass-bg);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-hover);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glass-active);
    background-clip: content-box;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--glass-hover) var(--glass-bg);
}


/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flex Utilities */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* Spacing */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }
.p-0 { padding: 0; }

/* Width & Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Transitions */
.transition { transition: all var(--transition-normal); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* Visibility */
.invisible { visibility: hidden; }
.visible { visibility: visible; }


/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animation Classes */
.animate-fadeIn { animation: fadeIn 0.3s ease forwards; }
.animate-slideInUp { animation: slideInUp 0.4s ease forwards; }
.animate-slideInDown { animation: slideInDown 0.4s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.3s ease forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Stagger Delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
