/* ===== CSS Variables & Design System ===== */
/* 
   Paleta profesional basada en psicología del color:
   - Azul Navy: Confianza, autoridad, estabilidad
   - Teal/Cyan: Innovación, claridad, tecnología
   - Grises: Sofisticación, neutralidad, balance
   - Acentos sutiles: Profesionalismo sin distracciones
*/
:root {
    /* Primary Colors - Professional Blue Palette */
    --color-primary: #2563eb;
    --color-primary-light: #3b82f6;
    --color-primary-dark: #1d4ed8;

    /* Secondary - Sophisticated Teal */
    --color-secondary: #0891b2;

    /* Accent - Subtle Cyan for innovation feel */
    --color-accent: #06b6d4;

    /* Dark Theme - Deep Navy tones for trust & authority */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.85);
    --bg-card-hover: rgba(30, 41, 59, 0.95);

    /* Text - Clear hierarchy for readability */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders - Subtle sophistication */
    --border-color: rgba(148, 163, 184, 0.12);
    --border-color-hover: rgba(59, 130, 246, 0.4);

    /* Shadows - Depth without distraction */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.2);

    /* Gradients - Elegant and professional */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
    --gradient-bg: linear-gradient(180deg, #0a0f1a 0%, #111827 50%, #0a0f1a 100%);

    /* Spacing */
    --container-max: 1200px;
    --section-padding: 100px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== Animated Background ===== */
.gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-bg);
    z-index: -2;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: #2563eb;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: #0891b2;
    bottom: -150px;
    left: -150px;
    animation-delay: -5s;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: var(--color-accent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

/* ===== Container ===== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text .highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(37, 99, 235, 0.1);
}

/* ===== Hero Section ===== */
.hero {
    padding: 180px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 15, 26, 0.3) 0%, rgba(10, 15, 26, 0.9) 100%);
    z-index: -1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

/* ===== Search Bar ===== */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 18px 24px 18px 56px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 22px;
    color: var(--text-muted);
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.search-results {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

/* ===== Sections ===== */
.section {
    padding: var(--section-padding) 0;
}

.section-alt {
    background: rgba(26, 26, 46, 0.3);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    color: var(--text-primary);
}

.section-icon {
    font-size: 2rem;
}

/* ===== Cards Grid ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: -1;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card:hover::before {
    opacity: 0.05;
}

.card:hover .card-arrow {
    transform: translateX(4px);
    color: var(--color-primary-light);
}

.card-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

/* ===== Hidden State for Search ===== */
.card.hidden {
    display: none;
}

/* ===== Section Description ===== */
.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: -32px;
    margin-bottom: 48px;
    max-width: 600px;
}

/* ===== Guides Section ===== */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 28px;
}

.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
}

.guide-card:hover {
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-md);
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.guide-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    color: white;
}

.guide-icon svg {
    width: 24px;
    height: 24px;
}

.guide-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.guide-title-link {
    text-decoration: none;
}

.guide-title-link:hover .guide-title {
    color: var(--color-primary);
}

.guide-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.guide-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stack-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.stack-item:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
}

.stack-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.stack-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    gap: 20px;
    flex-wrap: wrap;
}

.section-header .section-title {
    margin-bottom: 8px;
}

.section-header .section-description {
    margin-top: 0;
    margin-bottom: 0;
}

/* ===== View All Button ===== */
.btn-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.btn-view-all:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-view-all svg {
    transition: var(--transition-fast);
}

.btn-view-all:hover svg {
    transform: translateX(4px);
}

/* ===== Slider ===== */
.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

.slider-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.slider-track {
    display: flex;
    gap: 24px;
    transition: transform 0.4s ease;
}

.slider-slide {
    flex: 0 0 calc(33.333% - 16px);
    min-width: 300px;
    animation: none;
    opacity: 1;
}

.slider-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.slider-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-btn:disabled:hover {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* ===== Slider Dots ===== */
.slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.slider-dot:hover {
    background: var(--text-muted);
}

.slider-dot.active {
    background: var(--color-primary);
    width: 28px;
    border-radius: var(--radius-full);
}

/* ===== Guides Full Page ===== */
.guides-full {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* ===== Footer ===== */
.footer {
    padding: 60px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: rgba(10, 15, 26, 0.6);
}

.footer-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== Responsive Design ===== */

/* Large Tablets & Small Desktops (1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding: 80px;
    }

    .hero {
        padding: 160px 0 80px;
    }

    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
    }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .guides-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .slider-slide {
        flex: 0 0 calc(50% - 12px);
        min-width: 280px;
    }

    .videos-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

/* Tablets (768px) */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px;
    }

    .container {
        padding: 0 20px;
    }

    /* Header Mobile Optimizations */
    .header {
        padding: 16px 0;
    }

    .header .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1.3rem;
    }

    /* Hero Adjustments */
    .hero {
        padding: 140px 0 60px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 32px;
    }

    .search-container {
        max-width: 100%;
    }

    .search-input {
        padding: 16px 20px 16px 50px;
        font-size: 0.95rem;
    }

    .search-icon {
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Sections */
    .section {
        padding: 50px 0;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 28px;
        gap: 12px;
    }

    .section-icon {
        font-size: 1.5rem;
    }

    /* Cards */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 18px;
        gap: 16px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-description {
        font-size: 0.85rem;
    }

    /* Guides */
    .guides-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .guide-card {
        padding: 20px;
    }

    .guide-title {
        font-size: 1.1rem;
    }

    .guide-description {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }

    .guide-stack {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stack-item {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* Section Header & Description */
    .section-description {
        margin-top: -16px;
        margin-bottom: 28px;
        font-size: 0.95rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .btn-view-all {
        align-self: flex-start;
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Slider Mobile */
    .slider-container {
        flex-direction: column;
        gap: 0;
    }

    .slider-btn {
        display: none;
    }

    .slider-wrapper {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .slider-wrapper::-webkit-scrollbar {
        display: none;
    }

    .slider-track {
        gap: 16px;
    }

    .slider-slide {
        flex: 0 0 85%;
        min-width: 280px;
        scroll-snap-align: center;
    }

    .slider-dots {
        margin-top: 16px;
    }

    /* Videos Grid */
    .videos-grid {
        gap: 16px;
    }

    .video-info {
        padding: 14px;
    }

    .video-info h3 {
        font-size: 0.95rem;
    }

    /* Channels */
    .channels-grid {
        gap: 12px;
    }

    .channel-card {
        padding: 12px 18px;
    }

    .channel-card img {
        width: 40px;
        height: 40px;
    }

    /* Quiz */
    .quiz-header {
        gap: 32px;
    }

    .quiz-card {
        padding: 24px;
    }

    .quiz-question {
        font-size: 1.1rem;
    }

    .quiz-option {
        padding: 14px 16px;
        font-size: 0.95rem;
    }

    .score-value,
    .streak-value {
        font-size: 2rem;
    }

    /* Footer */
    .footer {
        padding: 40px 0;
    }

    .footer-text {
        font-size: 1rem;
    }
}

/* Small Mobile Devices (480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    /* Header */
    .header {
        padding: 14px 0;
    }

    .logo {
        font-size: 1.15rem;
        gap: 8px;
    }

    .logo-icon {
        font-size: 1.4rem;
    }

    /* Hero */
    .hero {
        padding: 120px 0 50px;
    }

    .hero-title {
        font-size: 1.75rem;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 28px;
    }

    .search-input {
        padding: 14px 16px 14px 46px;
        font-size: 0.9rem;
    }

    .search-icon {
        left: 16px;
        width: 18px;
        height: 18px;
    }

    /* Sections */
    .section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 24px;
    }

    /* Cards */
    .cards-grid {
        gap: 14px;
    }

    .card {
        padding: 16px;
        gap: 14px;
    }

    .card-icon {
        width: 44px;
        height: 44px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-description {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
        line-clamp: 1;
    }

    .card-arrow {
        font-size: 1.2rem;
    }

    /* Guide Cards */
    .guide-card {
        padding: 16px;
    }

    .guide-header {
        gap: 12px;
        margin-bottom: 10px;
    }

    .guide-icon {
        width: 42px;
        height: 42px;
    }

    .guide-icon svg {
        width: 20px;
        height: 20px;
    }

    .guide-title {
        font-size: 1rem;
    }

    .guide-description {
        font-size: 0.85rem;
        margin-bottom: 14px;
    }

    .stack-item {
        padding: 10px;
        font-size: 0.8rem;
    }

    .stack-item img {
        width: 20px;
        height: 20px;
    }

    /* Slider */
    .slider-slide {
        flex: 0 0 90%;
    }

    /* Videos */
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .video-info {
        padding: 12px;
    }

    .video-info h3 {
        font-size: 0.9rem;
    }

    .video-channel {
        font-size: 0.8rem;
    }

    .channels-title {
        font-size: 1.1rem;
    }

    .channel-card {
        padding: 10px 14px;
    }

    .channel-card img {
        width: 36px;
        height: 36px;
    }

    .channel-card span {
        font-size: 0.8rem;
    }

    /* Quiz */
    .quiz-header {
        gap: 24px;
    }

    .quiz-card {
        padding: 20px;
    }

    .quiz-question {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .quiz-option {
        padding: 12px 14px;
        font-size: 0.9rem;
    }

    .score-value,
    .streak-value {
        font-size: 1.75rem;
    }

    .score-label,
    .streak-label {
        font-size: 0.8rem;
    }

    .quiz-next-btn {
        padding: 14px 28px;
        font-size: 0.95rem;
    }

    .quiz-feedback {
        padding: 14px;
        font-size: 0.9rem;
    }

    .quiz-feedback .explanation {
        font-size: 0.85rem;
    }

    /* Footer */
    .footer {
        padding: 32px 0;
    }

    .footer-text {
        font-size: 0.95rem;
    }

    .footer-subtext {
        font-size: 0.85rem;
    }

    /* Section Header */
    .section-description {
        font-size: 0.9rem;
        margin-top: -12px;
        margin-bottom: 24px;
    }

    .btn-view-all {
        padding: 10px 18px;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }
}

/* Extra Small Devices (360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .card {
        padding: 14px;
        gap: 12px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
    }

    .quiz-card {
        padding: 16px;
    }

    .quiz-question {
        font-size: 0.95rem;
    }
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-light);
}

/* ===== Selection ===== */
::selection {
    background: var(--color-primary);
    color: white;
}

/* ===== Focus Visible ===== */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===== Hidden Class for Search ===== */
.hidden {
    display: none !important;
}

/* ===== Animations for Cards on Load ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.15s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.25s;
}

.card:nth-child(5) {
    animation-delay: 0.3s;
}

.card:nth-child(6) {
    animation-delay: 0.35s;
}

.card:nth-child(7) {
    animation-delay: 0.4s;
}

.card:nth-child(8) {
    animation-delay: 0.45s;
}

/* ===== Mobile Menu ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 12px;
    z-index: 1002;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: var(--color-primary);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

.hamburger-line:nth-child(1) {
    margin-bottom: 5px;
}

.hamburger-line:nth-child(3) {
    margin-top: 5px;
}

/* Hamburger to X animation */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Overlay - Fullscreen */
.nav-overlay {
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .header .container {
        position: relative;
    }

    /* Fullscreen Mobile Navigation */
    .nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgba(10, 15, 26, 0.97);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        overflow-y: auto;
        padding: 80px 32px;
    }

    .nav.active {
        opacity: 1;
        visibility: visible;
    }

    /* Close button styling for menu button when active */
    .mobile-menu-btn.active {
        position: fixed;
        top: 16px;
        right: 20px;
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.5);
    }

    .mobile-menu-btn.active:hover {
        background: rgba(239, 68, 68, 0.25);
    }

    .mobile-menu-btn.active .hamburger-line {
        background: #ef4444;
    }

    /* Navigation Links */
    .nav-link {
        font-size: 1.5rem;
        font-weight: 600;
        padding: 20px 40px;
        border-radius: var(--radius-lg);
        text-align: center;
        color: var(--text-secondary);
        opacity: 0;
        transform: translateY(30px);
        transition: all 0.3s ease;
        width: 100%;
        max-width: 320px;
        margin: 4px 0;
        position: relative;
        overflow: hidden;
    }

    .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--gradient-primary);
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: var(--radius-lg);
        z-index: -1;
    }

    .nav.active .nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for nav links */
    .nav.active .nav-link:nth-child(1) {
        transition-delay: 0.05s;
    }

    .nav.active .nav-link:nth-child(2) {
        transition-delay: 0.1s;
    }

    .nav.active .nav-link:nth-child(3) {
        transition-delay: 0.15s;
    }

    .nav.active .nav-link:nth-child(4) {
        transition-delay: 0.2s;
    }

    .nav.active .nav-link:nth-child(5) {
        transition-delay: 0.25s;
    }

    .nav.active .nav-link:nth-child(6) {
        transition-delay: 0.3s;
    }

    .nav.active .nav-link:nth-child(7) {
        transition-delay: 0.35s;
    }

    .nav.active .nav-link:nth-child(8) {
        transition-delay: 0.4s;
    }

    .nav-link:hover,
    .nav-link:focus {
        color: var(--text-primary);
    }

    .nav-link:hover::before,
    .nav-link:focus::before {
        opacity: 0.15;
    }

    .nav-link:active {
        transform: scale(0.98);
    }

    .nav-link:active::before {
        opacity: 0.25;
    }
}

/* Small mobile adjustments for menu */
@media (max-width: 480px) {
    .nav-link {
        font-size: 1.3rem;
        padding: 18px 32px;
        max-width: 280px;
    }
}

/* ===== Videos Section ===== */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.video-card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    text-decoration: none;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-lg);
}

.video-card:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 0, 0, 1);
}

.video-thumbnail {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.play-button svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-left: 3px;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: 16px;
}

.video-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.video-channel {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.channels-section {
    text-align: center;
}

.channels-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.channels-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: var(--transition-normal);
}

.channel-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    background: var(--bg-card-hover);
}

.channel-card img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.channel-card span {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Quiz Section ===== */
.quiz-container {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 32px;
}

.quiz-score,
.quiz-streak {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.score-label,
.streak-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.score-value,
.streak-value {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 2px solid var(--border-color);
    transition: var(--transition-normal);
}

.quiz-card.correct {
    border-color: #22c55e;
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.3);
}

.quiz-card.incorrect {
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.quiz-question {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
    color: var(--text-primary);
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    padding: 16px 20px;
    background: rgba(37, 99, 235, 0.1);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

.quiz-option:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.2);
    border-color: var(--color-primary);
    transform: translateX(4px);
}

.quiz-option.selected {
    background: rgba(37, 99, 235, 0.3);
    border-color: var(--color-primary);
}

.quiz-option.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #22c55e;
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.quiz-option:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    display: none;
}

.quiz-feedback.correct {
    display: block;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    animation: bounceIn 0.5s ease;
}

.quiz-feedback.incorrect {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.quiz-next-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 24px auto 0;
    padding: 16px 32px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    font-family: inherit;
}

.quiz-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Confetti Canvas */
#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Quiz Explanation */
.quiz-feedback .explanation {
    display: block;
    margin-top: 12px;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.9;
}