/* ============================================
   HACKVERSITY — Crimson Obsidian Design System
   Red & Black Professional LMS with Parallax
   ============================================ */

/* ── Google Fonts ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties (Design Tokens) ────── */
:root {
    /* Primary Palette — Crimson & Obsidian */
    --primary: #ff1a1a;
    --primary-light: #ff4d4d;
    --primary-dim: #cc0000;
    --primary-glow: rgba(255, 26, 26, 0.35);
    --primary-subtle: rgba(255, 26, 26, 0.08);
    --secondary: #ff6b35;
    --secondary-dim: #e05a2b;
    --secondary-glow: rgba(255, 107, 53, 0.3);
    --accent: #ffd700;
    --accent-glow: rgba(255, 215, 0, 0.25);
    --success: #00e676;
    --success-glow: rgba(0, 230, 118, 0.2);
    --warning: #ffab00;
    --danger: #ff1744;
    --info: #ff8a80;

    /* Background System — Deep Obsidian */
    --bg-darkest: #0a0a0a;
    --bg-darker: #0f0f0f;
    --bg-dark: #141414;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --bg-elevated: #2a2a2a;
    --bg-input: #111111;

    /* Text */
    --text-primary: #f0e8e8;
    --text-secondary: #b0a0a0;
    --text-muted: #706060;
    --text-accent: var(--primary);

    /* Borders */
    --border-subtle: rgba(255, 26, 26, 0.06);
    --border-default: rgba(255, 26, 26, 0.12);
    --border-active: rgba(255, 26, 26, 0.35);
    --border-glow: rgba(255, 26, 26, 0.6);

    /* Glassmorphism */
    --glass-bg: rgba(14, 14, 14, 0.8);
    --glass-border: rgba(255, 26, 26, 0.1);
    --glass-blur: 24px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 40px var(--primary-glow);
    --shadow-glow-secondary: 0 0 30px var(--secondary-glow);
    --shadow-glow-intense: 0 0 60px var(--primary-glow), 0 0 120px rgba(255, 26, 26, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-index Scale */
    --z-parallax-back: -1;
    --z-parallax-mid: 0;
    --z-content: 1;
    --z-dropdown: 100;
    --z-navbar: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* ── Animations ───────────────────────────────── */
@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-100px, 60px) scale(1.1);
    }

    50% {
        transform: translate(50px, -40px) scale(0.9);
    }

    75% {
        transform: translate(-50px, -80px) scale(1.05);
    }
}

@keyframes pulsate {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 26, 26, 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(255, 26, 26, 0.2);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 26, 26, 0);
    }
}

.pulsate {
    animation: pulsate 2s infinite;
}

/* ── Reset & Base ─────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated background grid — crimson tinted */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(255, 26, 26, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 26, 26, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
    z-index: 0;
}

/* Floating orb ambiance — crimson */
body::after {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(255, 26, 26, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 25s ease-in-out infinite;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(-100px, 60px) scale(1.1);
    }

    50% {
        transform: translate(50px, -40px) scale(0.9);
    }

    75% {
        transform: translate(-50px, -80px) scale(1.05);
    }
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary);
    text-shadow: 0 0 12px var(--primary-glow);
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Typography ───────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.75rem);
}

h4 {
    font-size: 1.25rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-red {
    background: linear-gradient(135deg, #ff1a1a 0%, #ff4d4d 40%, #ff6b35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-glow {
    text-shadow: 0 0 20px var(--primary-glow), 0 0 40px var(--primary-glow);
}

code,
pre,
.mono {
    font-family: var(--font-mono);
}

/* ── Parallax Layer System ────────────────────── */
.parallax-wrapper {
    position: relative;
    overflow: hidden;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
    pointer-events: none;
}

.parallax-layer--back {
    z-index: var(--z-parallax-back);
}

.parallax-layer--mid {
    z-index: var(--z-parallax-mid);
}

/* Floating particles */
.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat linear infinite;
}

.particle--red {
    background: radial-gradient(circle, rgba(255, 26, 26, 0.6), transparent 70%);
}

.particle--ember {
    background: radial-gradient(circle, rgba(255, 107, 53, 0.4), transparent 70%);
}

.particle--gold {
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3), transparent 70%);
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ── Navbar ───────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-navbar);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition-base);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 4px 30px rgba(255, 26, 26, 0.08);
    border-bottom-color: rgba(255, 26, 26, 0.15);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--text-primary);
    text-shadow: none;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 0 8px var(--primary-glow));
    transition: var(--transition-base);
}

.navbar-brand:hover .navbar-logo {
    filter: drop-shadow(0 0 14px var(--primary-glow)) drop-shadow(0 0 30px rgba(255, 26, 26, 0.25));
    transform: scale(1.08);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    list-style: none;
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-fast);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-light);
    background: var(--primary-subtle);
    text-shadow: none;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 1px;
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Mobile menu toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
}

/* ── Buttons ──────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.08) 100%);
    opacity: 0;
    transition: var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

/* Shimmer sweep effect on buttons */
.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 60%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

.btn:hover::after {
    left: 150%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dim), var(--primary));
    color: #fff;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--primary-glow), 0 0 60px rgba(255, 26, 26, 0.2);
    text-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--border-active);
}

.btn-secondary:hover {
    background: var(--primary-subtle);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    color: var(--primary);
    text-shadow: none;
}

.btn-accent {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dim));
    color: white;
    box-shadow: 0 4px 20px var(--secondary-glow);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--secondary-glow);
    color: white;
    text-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-default);
    background: rgba(255, 255, 255, 0.02);
    text-shadow: none;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.btn-xs {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-light);
    border: 1px solid var(--border-active);
}

.btn-outline-primary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ── Cards ────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    position: relative;
}

.card:hover {
    border-color: var(--border-default);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
}

.card-glow:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-glow);
}

/* Crimson edge line on card top */
.card-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: var(--transition-base);
}

.card-glow:hover::before {
    opacity: 1;
}

.card-body {
    padding: var(--space-lg);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.card-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-subtle);
}

/* ── Forms ────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-input,
.form-select,
.form-input,
.form-select,
.form-textarea,
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ── Badges & Tags ────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(255, 26, 26, 0.12);
    color: var(--primary-light);
    border: 1px solid rgba(255, 26, 26, 0.2);
}

.badge-secondary {
    background: rgba(255, 107, 53, 0.12);
    color: var(--secondary);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.badge-success {
    background: rgba(0, 230, 118, 0.12);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-danger {
    background: rgba(255, 23, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(255, 23, 68, 0.2);
}

.badge-warning {
    background: rgba(255, 171, 0, 0.12);
    color: var(--warning);
    border: 1px solid rgba(255, 171, 0, 0.2);
}

.badge-difficulty {
    font-size: 0.7rem;
}

/* ── Progress Bar ─────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-dim), var(--primary), var(--secondary));
    box-shadow: 0 0 12px var(--primary-glow);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

/* ── Grid Layout ──────────────────────────────── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    flex-direction: column;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.gap-xl {
    gap: var(--space-xl);
}

/* ── Hero Section with Parallax ───────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px var(--space-xl) var(--space-3xl);
    overflow: hidden;
}

/* Multi-layer parallax background for hero */
.hero-parallax-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-parallax-bg .parallax-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    will-change: transform;
}

.hero-parallax-bg .parallax-orb--1 {
    width: 600px;
    height: 600px;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(255, 26, 26, 0.15) 0%, transparent 70%);
    animation: heroPulse 10s ease-in-out infinite;
}

.hero-parallax-bg .parallax-orb--2 {
    width: 400px;
    height: 400px;
    bottom: -5%;
    right: -5%;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.12) 0%, transparent 70%);
    animation: heroPulse 12s ease-in-out infinite reverse;
}

.hero-parallax-bg .parallax-orb--3 {
    width: 300px;
    height: 300px;
    top: 40%;
    left: 60%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.06) 0%, transparent 70%);
    animation: heroPulse 15s ease-in-out infinite 2s;
}

/* Scanline effect */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(255, 26, 26, 0.008) 2px,
            rgba(255, 26, 26, 0.008) 4px);
    pointer-events: none;
    z-index: 1;
}

@keyframes heroPulse {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }

    33% {
        transform: translate(30px, -20px) scale(1.1);
        opacity: 1;
    }

    66% {
        transform: translate(-20px, 10px) scale(0.95);
        opacity: 0.7;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 820px;
}

.hero-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto var(--space-xl);
    filter: drop-shadow(0 0 20px var(--primary-glow)) drop-shadow(0 0 40px rgba(255, 26, 26, 0.15));
    animation: logoFloat 3s ease-in-out infinite;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.8rem);
    font-weight: 900;
    margin-bottom: var(--space-lg);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Section ──────────────────────────────────── */
.section {
    padding: var(--space-3xl) 0;
    position: relative;
    z-index: var(--z-content);
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-title {
    margin-bottom: var(--space-md);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Parallax Section Divider */
.parallax-divider {
    position: relative;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parallax-divider__bg {
    position: absolute;
    inset: -50px;
    background: linear-gradient(135deg, rgba(255, 26, 26, 0.05) 0%, rgba(255, 107, 53, 0.03) 100%);
    will-change: transform;
}

/* ── Feature Cards ────────────────────────────── */
.feature-card {
    padding: var(--space-2xl);
    text-align: center;
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-8px);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, rgba(255, 26, 26, 0.1), rgba(255, 107, 53, 0.08));
    border: 1px solid var(--border-default);
    transition: var(--transition-base);
}

.feature-card:hover .feature-icon {
    border-color: var(--border-active);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: scale(1.1);
}

.feature-title {
    font-size: 1.2rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ── Stats Grid ───────────────────────────────── */
.stat-card {
    text-align: center;
    padding: var(--space-xl);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--space-xs);
}

/* ── Auth Forms ───────────────────────────────── */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px var(--space-lg) var(--space-2xl);
    position: relative;
}

/* Auth page parallax bg */
.auth-container::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 26, 26, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: heroPulse 12s ease-in-out infinite;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-card .card-body {
    padding: var(--space-2xl);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.auth-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto var(--space-lg);
    display: block;
    filter: drop-shadow(0 0 12px var(--primary-glow));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.auth-header h2 {
    margin-bottom: var(--space-sm);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.btn-google {
    width: 100%;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-google:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    color: var(--text-primary);
    text-shadow: none;
}

/* ── Dashboard ────────────────────────────────── */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    padding-top: 70px;
}

.sidebar {
    background: var(--bg-dark);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-lg);
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0.65rem var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--primary-light);
    background: var(--primary-subtle);
    text-shadow: none;
}

.sidebar-link.active {
    border-left: 3px solid var(--primary);
}

.sidebar-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding: 0 var(--space-md);
}

.dashboard-main {
    padding: var(--space-2xl);
    overflow-y: auto;
}

/* ── Course Cards ─────────────────────────────── */
.course-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-card .card-thumbnail {
    height: 180px;
    position: relative;
}

.course-card .card-thumbnail::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--bg-card));
}

.course-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    flex-wrap: wrap;
}

.course-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.course-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── CTF Challenge Cards ──────────────────────── */
.ctf-card {
    position: relative;
    border-left: 3px solid var(--primary);
}

.ctf-card.solved {
    border-left-color: var(--success);
}

.ctf-card.solved::after {
    content: '✓';
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 28px;
    height: 28px;
    background: var(--success);
    color: var(--bg-darkest);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.ctf-points {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent);
    font-size: 1.1rem;
}

/* ── AI Chat ──────────────────────────────────── */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.chat-message {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-dim), var(--primary));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.ai {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-input-area {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-subtle);
}

.chat-input-area .form-input {
    flex: 1;
}

/* ── Pricing Cards ────────────────────────────── */
.pricing-card {
    text-align: center;
    padding: var(--space-2xl);
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 4px 16px;
    border-radius: var(--radius-full);
}

.pricing-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

.pricing-price {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.pricing-price .currency {
    font-size: 1.5rem;
    vertical-align: super;
}

.pricing-period {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--space-xl);
}

.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-xl);
    flex: 1;
}

.pricing-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.pricing-card.tester {
    border-style: dashed;
    opacity: 0.8;
}

.pricing-card.tester:hover {
    opacity: 1;
    border-style: solid;
}

.pricing-features li {
    padding: var(--space-sm) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pricing-features li::before {
    content: '✓';
    color: var(--primary-light);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Learning Interface ───────────────────────── */
.learn-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 100vh;
    padding-top: 70px;
}

.learn-sidebar {
    background: var(--bg-dark);
    border-right: 1px solid var(--border-subtle);
    padding: var(--space-lg);
    overflow-y: auto;
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
}

.learn-content {
    padding: var(--space-2xl);
}

.module-item {
    margin-bottom: var(--space-md);
}

.module-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-sm);
}

.lesson-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

.lesson-link:hover,
.lesson-link.active {
    background: var(--primary-subtle);
    color: var(--primary-light);
    text-shadow: none;
}

.lesson-link.completed {
    color: var(--success);
}

.lesson-link .lesson-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Video Player ─────────────────────────────── */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: var(--bg-darker);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-subtle);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Flash Messages / Toasts ──────────────────── */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.flash-message {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    font-size: 0.9rem;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
}

.flash-message.success {
    border-left: 3px solid var(--success);
}

.flash-message.danger {
    border-left: 3px solid var(--danger);
}

.flash-message.warning {
    border-left: 3px solid var(--warning);
}

.flash-message.info {
    border-left: 3px solid var(--info);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.flash-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
    padding: 0 var(--space-xs);
}

/* ── Footer ───────────────────────────────────── */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-darker);
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-3xl) 0 var(--space-xl);
}

/* Red accent line at footer top */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.footer-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    max-width: 320px;
}

.footer-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Loading & Animations ─────────────────────── */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Scroll Reveal ────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered child reveal */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal-stagger.visible>*:nth-child(1) {
    transition-delay: 0.05s;
}

.reveal-stagger.visible>*:nth-child(2) {
    transition-delay: 0.10s;
}

.reveal-stagger.visible>*:nth-child(3) {
    transition-delay: 0.15s;
}

.reveal-stagger.visible>*:nth-child(4) {
    transition-delay: 0.20s;
}

.reveal-stagger.visible>*:nth-child(5) {
    transition-delay: 0.25s;
}

.reveal-stagger.visible>*:nth-child(6) {
    transition-delay: 0.30s;
}

.reveal-stagger.visible>* {
    opacity: 1;
    transform: translateY(0);
}

/* ── Parallax Tilt on Cards ───────────────────── */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 800px;
}

.tilt-card .tilt-inner {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
}

/* ── Glitch Text Effect ──────────────────────── */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch-text::before {
    color: var(--primary);
    animation: glitch1 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text::after {
    color: var(--secondary);
    animation: glitch2 3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch1 {

    0%,
    93%,
    100% {
        transform: translate(0);
    }

    94% {
        transform: translate(-2px, -1px);
    }

    95% {
        transform: translate(2px, 1px);
    }

    96% {
        transform: translate(-1px, 2px);
    }
}

@keyframes glitch2 {

    0%,
    93%,
    100% {
        transform: translate(0);
    }

    94% {
        transform: translate(2px, 1px);
    }

    95% {
        transform: translate(-2px, -1px);
    }

    96% {
        transform: translate(1px, -2px);
    }
}

/* ── Marquee / Ticker ────────────────────────── */
.marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-darker);
}

.marquee-track {
    display: inline-flex;
    animation: marqueeScroll 30s linear infinite;
}

.marquee-track span {
    padding: 0 var(--space-2xl);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.marquee-track span .highlight {
    color: var(--primary-light);
}

@keyframes marqueeScroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* ── Error Pages ──────────────────────────────── */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl);
}

.error-code {
    font-family: var(--font-display);
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dim);
}

/* ══════════════════════════════════════════════════
   RESPONSIVE DESIGN — Complete Mobile Support
   ══════════════════════════════════════════════════ */

/* ── 1200px: Large tablets / small desktops ──── */
@media (max-width: 1200px) {
    .container {
        padding: 0 var(--space-lg);
    }
}

/* ── 1024px: Tablets landscape ──────────────── */
@media (max-width: 1024px) {
    :root {
        --space-2xl: 2rem;
        --space-3xl: 3rem;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Dashboard sidebar → off-canvas overlay */
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -280px;
        top: 70px;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        transform: translateX(0);
    }

    .sidebar.open {
        left: 0;
        transform: translateX(0);
    }

    .dashboard-main {
        padding: var(--space-lg);
    }

    /* Learn sidebar → off-canvas overlay */
    .learn-layout {
        grid-template-columns: 1fr;
    }

    .learn-sidebar {
        position: fixed;
        left: -320px;
        top: 70px;
        bottom: 0;
        z-index: 1000;
        width: 300px;
        height: calc(100vh - 70px);
        overflow-y: auto;
        transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        border-right: none;
        border-bottom: none;
    }

    .learn-sidebar.open {
        left: 0;
    }

    .learn-content {
        padding: var(--space-lg);
    }

    /* Show mobile toggle buttons */
    .sidebar-toggle-mobile,
    .learn-toggle-mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Admin header wrapping */
    .flex-between {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    /* Table horizontal scroll */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    thead,
    tbody,
    tr {
        min-width: 600px;
    }
}

/* ── Overlay backdrop for sidebars on tablet/mobile ─ */
.sidebar-overlay,
.learn-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 70px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active,
.learn-sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ── 768px: Tablets portrait / Large phones ──── */
@media (max-width: 768px) {

    html {
        font-size: 15px;
    }

    /* Force single column on all grids */
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    /* ── Hero Mobile ── */
    .hero {
        min-height: 85vh;
        padding: 90px var(--space-md) var(--space-2xl);
    }

    .hero-title {
        font-size: 2.25rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 var(--space-sm);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-logo-container {
        margin-bottom: var(--space-md);
    }

    /* Hide parallax orbs on mobile for performance */
    .hero-parallax-bg .parallax-orb {
        display: none;
    }

    body::after {
        display: none;
    }

    /* ── Navbar Mobile Drawer ── */
    .navbar {
        padding: var(--space-sm) var(--space-md);
    }

    .navbar-logo-icon {
        width: 24px;
        height: 24px;
    }

    .navbar-brand span {
        font-size: 1.1rem;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: var(--space-sm) var(--space-md) var(--space-md);
        border-bottom: 2px solid var(--primary);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        z-index: 1000;
        animation: slideDown 0.3s ease-out;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        gap: var(--space-xs);
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar-nav.open {
        display: flex;
    }

    .navbar-toggle {
        display: block;
        font-size: 1.6rem;
        padding: var(--space-xs) var(--space-sm);
        min-width: 44px;
        min-height: 44px;
    }

    /* Make nav links touch-friendly */
    .navbar-nav .nav-link,
    .navbar-nav .btn {
        width: 100%;
        text-align: left;
        padding: 0.75rem var(--space-md);
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: var(--radius-md);
    }

    .navbar-nav .btn-primary,
    .navbar-nav .btn-ghost {
        justify-content: center;
        margin-top: var(--space-xs);
    }

    /* ── Footer Mobile ── */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand,
    .footer-desc {
        margin: 0 auto var(--space-md);
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }

    .footer {
        padding: var(--space-2xl) 0 var(--space-lg);
    }

    /* ── Pricing Mobile ── */
    .pricing-card {
        padding: var(--space-xl) var(--space-lg);
        max-width: 100% !important;
    }

    .pricing-price {
        font-size: 2.5rem;
    }

    /* ── Stats Mobile ── */
    .stat-card {
        padding: var(--space-lg);
    }

    .stat-value {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* ── Dashboard Mobile ── */
    .dashboard-main {
        padding: var(--space-md);
    }

    .dashboard-layout {
        padding-top: 60px;
    }

    /* Welcome banner flex wrap */
    .card-body.flex-between {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .card-body.flex-between .btn {
        width: 100%;
        justify-content: center;
        margin-top: var(--space-sm);
    }

    /* ── Chat Mobile ── */
    .chat-container {
        height: calc(100vh - 120px);
        max-width: 100%;
        border-radius: var(--radius-md);
    }

    .chat-messages {
        padding: var(--space-md) 0;
    }

    .chat-message {
        max-width: 92%;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.9rem;
    }

    .chat-input-area {
        padding: var(--space-sm) 0;
        gap: var(--space-xs);
    }

    .chat-input-area .form-input {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    /* ── Learn Page Mobile ── */
    .learn-content {
        padding: var(--space-md);
    }

    .learn-layout {
        padding-top: 60px;
    }

    /* ── Course Cards Mobile ── */
    .course-card .card-thumbnail {
        height: 160px;
    }

    .course-footer {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .course-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── CTF Cards Mobile ── */
    .ctf-card .card-body .flex-between {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .ctf-card .btn {
        width: 100%;
        justify-content: center;
    }

    /* ── Flash Messages Mobile ── */
    .flash-messages {
        right: var(--space-sm);
        left: var(--space-sm);
        max-width: none;
        top: 70px;
    }

    .flash-message {
        font-size: 0.85rem;
        padding: var(--space-sm) var(--space-md);
    }

    /* ── Forms Mobile ── */
    .form-input,
    .form-select,
    .form-textarea,
    .form-control {
        font-size: 16px;
        /* Prevents iOS zoom-in on focus */
        padding: 0.85rem 1rem;
    }

    /* ── Buttons touch targets ── */
    .btn {
        min-height: 44px;
        padding: 0.7rem 1.25rem;
    }

    .btn-sm {
        min-height: 36px;
        padding: 0.45rem 0.85rem;
    }

    .btn-lg {
        padding: 0.85rem 1.75rem;
        font-size: 0.95rem;
    }

    /* ── Auth Pages Mobile ── */
    .auth-container {
        padding: 80px var(--space-md) var(--space-xl);
    }

    .auth-card {
        max-width: 100%;
    }

    .auth-card .card-body {
        padding: var(--space-xl) var(--space-lg);
    }

    /* ── Modals Mobile ── */
    .modal-box {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
        margin: var(--space-md);
        border-radius: var(--radius-md);
    }

    /* ── Section padding Mobile ── */
    .section {
        padding: var(--space-2xl) 0;
    }

    .section-header {
        margin-bottom: var(--space-2xl);
    }

    .section-subtitle {
        font-size: 0.95rem;
    }

    /* ── Feature Cards Mobile ── */
    .feature-card {
        padding: var(--space-xl);
    }

    .feature-icon {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
    }

    /* ── Admin Table Mobile ── */
    .card div[style*="overflow-x:auto"] {
        -webkit-overflow-scrolling: touch;
    }

    /* ── Marquee Mobile ── */
    .marquee-track span {
        padding: 0 var(--space-lg);
        font-size: 0.8rem;
    }

    /* ── Error Pages Mobile ── */
    .error-code {
        font-size: 5rem;
    }

    /* ── Sidebar toggle FAB adjustments ── */
    .sidebar-toggle-mobile {
        bottom: 16px !important;
        right: 16px !important;
        width: 50px !important;
        height: 50px !important;
    }

    .learn-toggle-mobile {
        bottom: 72px !important;
        left: 16px !important;
        width: 46px !important;
        height: 46px !important;
    }

    /* ── Euri AI Code Lab Mobile ── */
    .step-container {
        flex-direction: column;
    }

    .step-marker {
        flex-direction: row;
        width: auto;
        gap: var(--space-sm);
    }

    .step-line {
        width: auto;
        height: 2px;
        flex-grow: 1;
        margin: 0;
    }

    .code-editor-window {
        border-radius: 6px;
        margin-bottom: 1rem;
    }

    .code-header {
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
        padding: 8px 12px;
    }

    .code-body {
        font-size: 0.8em;
    }

    .line-numbers-rows {
        display: none;
        /* Save horizontal space on mobile */
    }

    .code-content {
        padding: 0.75rem;
    }

    /* ── Scroll behavior ── */
    .lesson-link {
        min-height: 40px;
    }

    /* ── Certificate page mobile ── */
    .badge {
        font-size: 0.7rem;
    }
}

/* ── 480px: Small phones ───────────────────── */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .hero {
        min-height: 80vh;
        padding: 80px var(--space-sm) var(--space-xl);
    }

    .hero-content {
        max-width: 100%;
    }

    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }

    .section {
        padding: var(--space-xl) 0;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Pricing even smaller */
    .pricing-price {
        font-size: 2rem;
    }

    .pricing-name {
        font-size: 1.1rem;
    }

    .pricing-card {
        padding: var(--space-lg) var(--space-md);
    }

    /* Stat cards compact */
    .stat-value {
        font-size: 1.5rem;
    }

    /* Chat adjustments */
    .chat-container {
        height: calc(100vh - 100px);
    }

    .chat-message {
        max-width: 95%;
        font-size: 0.85rem;
    }

    /* Auth pages */
    .auth-card .card-body {
        padding: var(--space-lg) var(--space-md);
    }

    .auth-header h2 {
        font-size: 1.3rem;
    }

    /* Dashboard welcome */
    .dashboard-main h2 {
        font-size: 1.3rem;
    }

    /* Card body padding reduction */
    .card-body {
        padding: var(--space-md);
    }

    .card-header {
        padding: var(--space-md);
    }

    /* Admin footer actions */
    .card-footer {
        padding: var(--space-sm) var(--space-md);
    }

    .card-footer .flex {
        flex-wrap: wrap;
    }

    /* Learn page actions */
    .flex-between {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }

    .flex-between .btn {
        width: 100%;
        justify-content: center;
    }

    /* Progress bar text */
    .flex-between.text-xs.text-muted {
        flex-direction: row;
        align-items: center;
    }

    /* Course detail thumbnail */
    .course-card .card-thumbnail,
    img[style*="height:300px"] {
        height: 180px !important;
    }

    /* Glitch text effect — reduce on mobile */
    .glitch-text::before,
    .glitch-text::after {
        display: none;
    }

    /* FAQ details padding */
    details summary {
        padding: var(--space-md) !important;
        font-size: 0.9rem;
    }

    details>div {
        padding: 0 var(--space-md) var(--space-md) !important;
        font-size: 0.85rem;
    }
}

/* ── 360px: Very small phones ──────────────── */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .navbar-brand span {
        font-size: 1rem;
    }

    .navbar {
        padding: var(--space-xs) var(--space-sm);
    }

    .pricing-price {
        font-size: 1.75rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .footer-heading {
        font-size: 0.75rem;
    }

    .footer-links a {
        font-size: 0.8rem;
    }
}

/* ── Touch device optimizations ─────────────── */
@media (hover: none) and (pointer: coarse) {

    /* Disable hover-only effects on touch devices */
    .card:hover {
        transform: none;
    }

    .feature-card:hover {
        transform: none;
    }

    .feature-card:hover .feature-icon {
        transform: none;
    }

    .card-glow:hover::before {
        opacity: 0;
    }

    /* Make all interactive elements have active states instead */
    .card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }

    .btn:active {
        transform: scale(0.96);
    }

    /* Disable tilt effect on touch devices */
    .tilt-card .tilt-inner {
        transform: none !important;
    }

    /* Remove parallax mouse-follow on touch */
    .parallax-orb {
        animation: none !important;
    }
}

/* ── Landscape phone adjustments ────────────── */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 80px var(--space-lg) var(--space-lg);
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .chat-container {
        height: calc(100vh - 80px);
    }

    .navbar-nav {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* ── Safe area for notched phones ────────────── */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(var(--space-md), env(safe-area-inset-left));
        padding-right: max(var(--space-md), env(safe-area-inset-right));
    }

    .footer {
        padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
    }

    .sidebar-toggle-mobile {
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }

    .learn-toggle-mobile {
        bottom: max(72px, calc(env(safe-area-inset-bottom) + 56px)) !important;
    }
}

/* ── Print styles ───────────────────────────── */
@media print {

    .navbar,
    .footer,
    .sidebar-toggle-mobile,
    .learn-toggle-mobile,
    .flash-messages,
    .navbar-toggle {
        display: none !important;
    }

    body::before,
    body::after {
        display: none;
    }

    .dashboard-layout,
    .learn-layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .learn-sidebar {
        display: none;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* ── Utility Classes ──────────────────────────── */
.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mt-2xl {
    margin-top: var(--space-2xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mb-2xl {
    margin-bottom: var(--space-2xl);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary-clr {
    color: var(--text-secondary);
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

.user-avatar-placeholder {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 0 15px var(--primary-glow);
}

.progress-fill[data-progress] {
    transition: width 1s ease-out;
}

/* Add scripts to main.js to handle these better, but for now some common steps */
.progress-fill[data-progress="0"] {
    width: 0%;
}

.progress-fill[data-progress="25"] {
    width: 25%;
}

.progress-fill[data-progress="50"] {
    width: 50%;
}

.progress-fill[data-progress="75"] {
    width: 75%;
}

.progress-fill[data-progress="100"] {
    width: 100%;
}

.relative {
    position: relative;
}

/* -- Video Player -------------------------------- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
    border: 1px solid var(--glass-border);
    margin-bottom: var(--space-xl);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Modals ───────────────────────────────────── */
.modal {
    padding: 0;
    background: transparent;
    border: none;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal[open] {
    display: flex;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-box {
    width: 100%;
    max-width: 500px;
    margin: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px var(--primary-subtle);
    position: relative;
    overflow: hidden;
}

/* ── Utilities ────────────────────────────────── */
.p-sm {
    padding: var(--space-sm);
}

.p-md {
    padding: var(--space-md);
}

.p-lg {
    padding: var(--space-lg);
}

.p-xl {
    padding: var(--space-xl);
}

.m-sm {
    margin: var(--space-sm);
}

.m-md {
    margin: var(--space-md);
}

.m-lg {
    margin: var(--space-lg);
}

.m-xl {
    margin: var(--space-xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.font-bold {
    font-weight: 700;
}

.text-lg {
    font-size: 1.25rem;
}

.text-xl {
    font-size: 1.5rem;
}

.text-sm {
    font-size: 0.85rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.text-xs {
    font-size: 0.75rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items-center {
    align-items: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}