/* ========================================
   MODERN E-LIBRARY DESIGN SYSTEM
   ======================================== */

/* ========================================
   COLOR PALETTE - Professional Academic
   ======================================== */
:root {
    /* Primary Colors - Dark Slate (Professional Institutional) */
    --color-primary: #0f172a;
    /* Dark Slate - Main Background */
    --color-primary-dark: #020617;
    --color-primary-light: #1e293b;
    --color-primary-lighter: #334155;

    /* Secondary Colors - Teal (Professional Accent) */
    --color-secondary: #14b8a6;
    /* Teal - Institutional Accent */
    --color-secondary-dark: #0d9488;
    --color-secondary-light: #2dd4bf;
    --color-secondary-lighter: #5eead4;

    /* Accent Colors - Gold (Institutional Highlight) */
    --color-accent: #d4af37;
    /* Gold - Premium Accent */
    --color-accent-dark: #b8941f;
    --color-accent-light: #e6c84f;
    --color-accent-lighter: #f0db6d;

    /* Tertiary - Slate Blue (Information) */
    --color-tertiary: #64748b;
    /* Slate Blue */
    --color-tertiary-dark: #475569;
    --color-tertiary-light: #94a3b8;

    /* Neutrals - Dark Theme Palette */
    --color-dark: #0f172a;
    --color-dark-light: #1e293b;
    --color-gray: #64748b;
    --color-gray-light: #94a3b8;
    --color-gray-lighter: #cbd5e1;
    --color-white: #FFFFFF;
    --color-off-white: #f8fafc;
    --color-cream: #1e293b;

    /* Semantic Colors */
    --color-success: #14b8a6;
    --color-warning: #d4af37;
    --color-error: #ef4444;
    --color-info: #14b8a6;

    /* Professional Dark Gradients */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-secondary: linear-gradient(135deg, #14b8a6 0%, #2dd4bf 100%);
    --gradient-accent: linear-gradient(135deg, #d4af37 0%, #e6c84f 100%);
    --gradient-dark: linear-gradient(180deg, #020617 0%, #0f172a 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --glass-blur: blur(12px);

    /* ========================================
     TYPOGRAPHY
     ======================================== */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Poppins', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Font Sizes - Fluid Typography */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.25rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
    --text-5xl: clamp(3rem, 2rem + 5vw, 4rem);

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* ========================================
     SPACING SYSTEM (8px base)
     ======================================== */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.5rem;
    /* 24px */
    --space-6: 2rem;
    /* 32px */
    --space-7: 2.5rem;
    /* 40px */
    --space-8: 3rem;
    /* 48px */
    --space-10: 4rem;
    /* 64px */
    --space-12: 6rem;
    /* 96px */
    --space-16: 8rem;
    /* 128px */
    --space-20: 10rem;
    /* 160px */

    /* ========================================
     SHADOWS & DEPTH
     ======================================== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Colored Shadows */
    --shadow-primary: 0 10px 40px -10px rgba(99, 102, 241, 0.4);
    --shadow-secondary: 0 10px 40px -10px rgba(236, 72, 153, 0.4);
    --shadow-accent: 0 10px 40px -10px rgba(20, 184, 166, 0.4);

    /* ========================================
     BORDER RADIUS
     ======================================== */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* ========================================
     TRANSITIONS & ANIMATIONS
     ======================================== */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Easing Functions */
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* ========================================
     Z-INDEX LAYERS
     ======================================== */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* ========================================
     LAYOUT
     ======================================== */
    --container-max-width: 1280px;
    --container-padding: var(--space-4);
    --section-spacing: var(--space-12);

    /* Grid */
    --grid-gap: var(--space-6);
    --grid-columns: 12;
}

@media (max-width: 768px) {
    :root {
        --section-spacing: var(--space-10);
    }
}

@media (max-width: 480px) {
    :root {
        --section-spacing: var(--space-8);
    }
}

/* ========================================
   GLOBAL RESETS & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-gray-lighter);
    background-color: var(--color-dark);
    overflow-x: hidden;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-white);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-semibold);
}

h4 {
    font-size: var(--text-2xl);
    font-weight: var(--font-semibold);
}

h5 {
    font-size: var(--text-xl);
    font-weight: var(--font-medium);
}

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-gray-light);
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-secondary-light);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--section-spacing) 0;
}

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}