/* ============================================
   ELITECH HUB - CORE DESIGN SYSTEM
   Professional Cybersecurity Training
   ============================================ */

/* ============================================
   1. CSS VARIABLES - THE DNA
   ============================================ */
:root {
    /* PRIMARY PALETTE */
    --primary-color: #c3151c;
    --primary-color-light: #e63e44;
    --primary-color-dark: #9e1115;
    --secondary-color: #12346b;
    --secondary-color-light: #1a4a99;
    --secondary-color-dark: #0c2346;

    /* TEXT COLORS */
    --text-dark: #242424;
    --text-medium: #555555;
    --text-light: #777777;

    /* BACKGROUND COLORS */
    --bg-light: #f8f9fa;
    --bg-dark: #121f35;
    --bg-white: #ffffff;

    /* ACCENT & UTILITY COLORS */
    --accent-color: #12346b;
    --border-light: #e9e9e9;
    --success-color: #12346b;

    /* LEGACY SUPPORT - Keep for backwards compatibility */
    --stark-black: #242424;
    --pure-white: #ffffff;
    --off-white: #f8f9fa;

    /* NEUTRAL GRAYS - Depth System */
    --gray-50: #FAFAFA;
    --gray-100: #F4F4F5;
    --gray-200: #E4E4E7;
    --gray-300: #D4D4D8;
    --gray-400: #A1A1AA;
    --gray-500: #71717A;
    --gray-600: #52525B;
    --gray-700: #3F3F46;
    --gray-800: #27272A;
    --gray-900: #18181B;

    /* SEMANTIC COLORS - Purpose-Driven */
    --color-primary: var(--primary-color);
    --color-secondary: var(--secondary-color);
    --color-accent: var(--accent-color);
    --color-background: var(--bg-white);
    --color-surface: var(--gray-50);
    --color-text: var(--text-dark);
    --color-text-muted: var(--gray-600);
    --color-border: var(--border-light);
    
    /* TYPOGRAPHY SYSTEM - Bold & Commanding */
    --font-display: 'Montserrat', system-ui, sans-serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Font Sizes - Modular Scale (1.250 - Major Third) */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    --text-7xl: 4.5rem;      /* 72px */
    --text-8xl: 6rem;        /* 96px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;
    
    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Letter Spacing */
    --tracking-tighter: -0.05em;
    --tracking-tight: -0.025em;
    --tracking-normal: 0;
    --tracking-wide: 0.025em;
    --tracking-wider: 0.05em;
    --tracking-widest: 0.1em;
    
    /* SPACING SYSTEM - 8px Base Grid */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */
    --space-32: 8rem;     /* 128px */
    --space-40: 10rem;    /* 160px */
    --space-48: 12rem;    /* 192px */
    
    /* BORDER RADIUS - Sharp to Soft */
    --radius-none: 0;
    --radius-sm: 0.25rem;    /* 4px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.5rem;    /* 24px */
    --radius-3xl: 2rem;      /* 32px */
    --radius-full: 9999px;
    
    /* SHADOWS - Clean & Professional */
    --shadow-small: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.12);
    --shadow-large: 0 15px 35px rgba(0, 0, 0, 0.18);

    /* Legacy shadow support */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: var(--shadow-small);
    --shadow-md: var(--shadow-medium);
    --shadow-lg: var(--shadow-large);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-brutal: 8px 8px 0 var(--text-dark);
    --shadow-brutal-lg: 12px 12px 0 var(--text-dark);

    /* GLOWS - Neon Effects */
    --glow-red: 0 0 20px rgba(195, 21, 28, 0.6), 0 0 40px rgba(195, 21, 28, 0.3);
    --glow-blue: 0 0 20px rgba(18, 52, 107, 0.6), 0 0 40px rgba(18, 52, 107, 0.3);
    --glow-accent: 0 0 20px rgba(27, 138, 202, 0.6), 0 0 40px rgba(27, 138, 202, 0.3);
    --glow-white: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 40px rgba(255, 255, 255, 0.4);

    /* TRANSITIONS - Smooth & Professional */
    --transition-slow: 0.5s ease;
    --transition-medium: 0.3s ease;
    --transition-fast: 0.15s ease;

    /* Legacy transition support */
    --duration-fast: 150ms;
    --duration-base: 300ms;
    --duration-medium: 500ms;
    --duration-slow: 600ms;
    --duration-slower: 900ms;

    --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);
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Z-INDEX SYSTEM - Layering */
    --z-below: -1;
    --z-base: 0;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* BREAKPOINTS - Mobile First */
    --screen-sm: 640px;
    --screen-md: 768px;
    --screen-lg: 1024px;
    --screen-xl: 1280px;
    --screen-2xl: 1536px;
    
    /* CONTAINER SIZES */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1400px;
}

/* ============================================
   2. RESET & BASE - Clean Slate
   ============================================ */

/* Box Sizing Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Font Family - Exclude icons */
*:not([class*="fa-"]):not(i[class*="fa"]):not(.fab):not(.fas):not(.far):not(.fal):not(.fad) {
    font-family: 'Montserrat', sans-serif;
}

/* Ensure Font Awesome Icons Display Properly */
.fa, .fas, .far, .fal, .fad, .fab,
[class^="fa-"], [class*=" fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fab {
    font-family: "Font Awesome 6 Brands" !important;
}

.fas, .fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
}

.far, .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400;
}

/* Document & Root */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Remove default link styles */
a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

/* Remove list styles */
ul,
ol {
    list-style: none;
}

/* Reset button styles */
button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Reset input styles */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* Image reset */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Remove default form styling */
input,
button,
textarea,
select {
    background: none;
    border: none;
    outline: none;
}

/* Accessible focus styles */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove focus outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   3. SELECTION STYLES - Brand Identity
   ============================================ */

::selection {
    background-color: var(--primary-color);
    color: var(--pure-white);
}

::-moz-selection {
    background-color: var(--primary-color);
    color: var(--pure-white);
}

/* ============================================
   4. SCROLLBAR STYLING - Custom Chrome
   ============================================ */

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-full);
    border: 2px solid var(--gray-100);
    transition: background var(--transition-medium);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color-dark);
}

::-webkit-scrollbar-thumb:active {
    background: var(--secondary-color);
}

/* ============================================
   5. TYPOGRAPHY UTILITIES - Text System
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-black);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-text);
}

h1 {
    font-size: clamp(var(--text-4xl), 5vw, var(--text-7xl));
    margin-bottom: var(--space-6);
}

h2 {
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    margin-bottom: var(--space-5);
}

h3 {
    font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
    margin-bottom: var(--space-4);
}

h4 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
}

h5 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

h6 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
}

p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

/* Text Utilities */
.text-display {
    font-family: var(--font-display);
}

.text-mono {
    font-family: var(--font-mono);
}

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* ============================================
   6. LAYOUT UTILITIES - Grid System
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-2xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }

/* Section Spacing */
.section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

@media (min-width: 768px) {
    .section {
        padding-top: var(--space-24);
        padding-bottom: var(--space-24);
    }
}

@media (min-width: 1024px) {
    .section {
        padding-top: var(--space-32);
        padding-bottom: var(--space-32);
    }
}

/* ============================================
   7. UTILITY CLASSES - Quick Helpers
   ============================================ */

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox Utilities */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }

/* Width & Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Color Utilities */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-white { color: var(--pure-white); }
.text-muted { color: var(--color-text-muted); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-secondary); }
.bg-white { background-color: var(--pure-white); }
.bg-black { background-color: var(--stark-black); }

/* ============================================
   8. ACCESSIBILITY - A11Y First
   ============================================ */

.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;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--pure-white);
    padding: var(--space-2) var(--space-4);
    z-index: var(--z-modal);
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   9. PRINT STYLES - Print-Friendly
   ============================================ */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
    }
    
    img {
        page-break-inside: avoid;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
}