/* ============================================================
   AI Horizon - AI Learning Video Platform
   Modern dark theme with glassmorphism and tech aesthetics
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.loli.net/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
    /* Primary palette - tech blue-cyan */
    --primary-hue: 210;
    --primary: hsl(var(--primary-hue), 80%, 60%);
    --primary-light: hsl(var(--primary-hue), 85%, 72%);
    --primary-dark: hsl(var(--primary-hue), 75%, 45%);
    --primary-glow: hsla(var(--primary-hue), 80%, 60%, 0.4);

    /* Accent palette - electric cyan */
    --accent-hue: 175;
    --accent: hsl(var(--accent-hue), 85%, 50%);
    --accent-light: hsl(var(--accent-hue), 90%, 65%);
    --accent-glow: hsla(var(--accent-hue), 85%, 50%, 0.35);

    /* Neutral palette */
    --bg-deep: hsl(240, 20%, 6%);
    --bg-base: hsl(240, 18%, 9%);
    --bg-surface: hsl(240, 16%, 13%);
    --bg-elevated: hsl(240, 14%, 17%);
    --bg-hover: hsl(240, 14%, 21%);

    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(240, 8%, 65%);
    --text-muted: hsl(240, 6%, 45%);

    --border-subtle: hsla(240, 15%, 40%, 0.15);
    --border-medium: hsla(240, 15%, 50%, 0.25);

    /* Glass effect */
    --glass-bg: hsla(240, 18%, 14%, 0.6);
    --glass-border: hsla(240, 20%, 50%, 0.12);
    --glass-blur: 20px;

    /* Shadows */
    --shadow-sm: 0 2px 8px hsla(0, 0%, 0%, 0.25);
    --shadow-md: 0 8px 24px hsla(0, 0%, 0%, 0.35);
    --shadow-lg: 0 16px 48px hsla(0, 0%, 0%, 0.45);
    --shadow-glow: 0 0 30px var(--primary-glow);

    /* 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;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

    /* Layout */
    --max-width: 1400px;
    --nav-height: 72px;
}

/* ============================================================
   Reset and Base Styles
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background gradient */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, hsla(210, 60%, 25%, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, hsla(175, 50%, 20%, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, hsla(240, 40%, 15%, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================
   Scrollbar Customization
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================================
   Navigation Bar
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 var(--space-xl);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--duration-normal) var(--ease-out);
}

.navbar.scrolled {
    background: hsla(240, 18%, 10%, 0.92);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.nav-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.nav-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px hsla(210, 80%, 60%, 0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.nav-brand:hover .nav-logo-img {
    filter: drop-shadow(0 0 16px hsla(210, 80%, 60%, 0.6));
    transform: scale(1.05);
}

.nav-search {
    flex: 1;
    max-width: 480px;
    margin: 0 var(--space-2xl);
    position: relative;
}

.nav-search input {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    padding-left: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all var(--duration-normal) var(--ease-out);
}

.nav-search input::placeholder {
    color: var(--text-muted);
}

.nav-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--primary-hue), 80%, 60%, 0.15);
    background: var(--bg-elevated);
}

.nav-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-normal) var(--ease-out);
}

.nav-theme-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--primary);
    transform: rotate(20deg);
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.nav-stats .count {
    color: var(--primary-light);
    font-weight: 600;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    padding-top: calc(var(--nav-height) + var(--space-3xl));
    padding-bottom: var(--space-2xl);
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-lg);
    background: linear-gradient(135deg, hsla(var(--primary-hue), 60%, 50%, 0.15), hsla(var(--accent-hue), 60%, 50%, 0.1));
    border: 1px solid hsla(var(--primary-hue), 60%, 50%, 0.25);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: var(--space-lg);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 hsla(var(--primary-hue), 60%, 50%, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px hsla(var(--primary-hue), 60%, 50%, 0);
    }
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes dotBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: var(--space-md);
    letter-spacing: -1px;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 50%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================================
   Type Filters
   ============================================================ */
.type-filters-section {
    padding: var(--space-xl) var(--space-xl) 0;
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.type-filters-wrapper {
    display: flex;
    gap: var(--space-md);
    background: hsla(240, 20%, 6%, 0.6);
    padding: var(--space-xs);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
}

.type-filter-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
}

.type-filter-btn:hover {
    color: var(--text-primary);
}

.type-filter-btn.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

@media (max-width: 600px) {
    .type-filters-wrapper {
        width: 100%;
        justify-content: space-between;
    }

    .type-filter-btn {
        flex: 1;
        padding: var(--space-sm) var(--space-sm);
        font-size: 0.85rem;
    }
}

/* ============================================================
   Category Filter Bar
   ============================================================ */
.categories-section {
    position: sticky;
    top: var(--nav-height);
    z-index: 100;
    padding: var(--space-md) 0;
    background: hsla(240, 20%, 6%, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.categories-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Ensure children don't shrink and cause layout issues */
.categories-wrapper>.category-btn {
    flex-shrink: 0;
}

.categories-wrapper::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.category-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--duration-normal) var(--ease-out);
}

.category-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.category-btn .cat-icon {
    font-size: 1rem;
}

/* ============================================================
   Video Grid
   ============================================================ */
.main-content {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-xl);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-title .icon {
    font-size: 1.3rem;
}

.video-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-xl);
}

/* ============================================================
   Video Card
   ============================================================ */
.video-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--duration-slow) var(--ease-out);
    position: relative;
}

.video-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 40px hsla(var(--primary-hue), 60%, 50%, 0.1);
}

.video-card:hover .card-thumbnail-overlay {
    opacity: 1;
}

.video-card:hover .card-play-btn {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.video-card:hover .card-thumbnail img {
    transform: scale(1.08);
}

.card-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-elevated);
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.card-thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, hsla(0, 0%, 0%, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.card-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.card-play-btn svg {
    width: 22px;
    height: 22px;
    fill: white;
    margin-left: 3px;
}

.card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 2px 8px;
    background: hsla(0, 0%, 0%, 0.8);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.3px;
}

.card-category-tag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 10px;
    background: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-body {
    padding: var(--space-md) var(--space-lg);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--duration-fast);
}

.video-card:hover .card-title {
    color: var(--primary-light);
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
}

.card-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-tag-list {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.card-tag {
    padding: 2px 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ============================================================
   Video Modal / Player Overlay
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: hsla(0, 0%, 0%, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 90%;
    max-width: 960px;
    background: var(--bg-base);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-medium);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: transform var(--duration-slow) var(--ease-out);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: var(--space-md);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: hsla(0, 70%, 50%, 0.2);
    border-color: hsla(0, 70%, 50%, 0.4);
    color: hsl(0, 70%, 65%);
}

.modal-player {
    aspect-ratio: 16 / 9;
    background: black;
}

.modal-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-info {
    padding: var(--space-lg);
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.modal-stats {
    display: flex;
    gap: var(--space-xl);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ============================================================
   Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: var(--space-3xl) var(--space-xl);
    grid-column: 1 / -1;
}

.empty-state .emoji {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
    animation: emptyBounce 2s ease-in-out infinite;
}

@keyframes emptyBounce {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-5deg);
    }

    75% {
        transform: translateY(-5px) rotate(5deg);
    }
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-2xl) var(--space-xl);
    margin-top: var(--space-3xl);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-brand:hover {
    opacity: 0.85;
}

.footer-brand span {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: color var(--duration-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================================
   Loading Skeleton
   ============================================================ */
.skeleton-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.skeleton-thumbnail {
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-body {
    padding: var(--space-md) var(--space-lg);
}

.skeleton-line {
    height: 14px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    margin-bottom: var(--space-sm);
}

.skeleton-line:last-child {
    width: 65%;
    margin-bottom: 0;
}

.skeleton-line.short {
    width: 40%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================================
   Responsive Design
   ============================================================ */
@media (max-width: 900px) {
    .nav-search {
        margin: 0 var(--space-md);
    }

    .nav-stats {
        display: none;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: var(--space-lg);
    }
}

@media (max-width: 640px) {
    :root {
        --nav-height: 60px;
    }

    .nav-search {
        display: none;
    }

    .hero-content {
        padding: 0 var(--space-md);
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .categories-wrapper {
        padding: 0 var(--space-md);
    }

    .main-content {
        padding: var(--space-lg) var(--space-md);
    }

    .video-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .modal-container {
        width: 95%;
        border-radius: var(--radius-lg);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   Animations for Card Entrance
   ============================================================ */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-card {
    animation: cardFadeIn var(--duration-slow) var(--ease-out) both;
}

/* Staggered card entrance */
.video-card:nth-child(1) {
    animation-delay: 0ms;
}

.video-card:nth-child(2) {
    animation-delay: 60ms;
}

.video-card:nth-child(3) {
    animation-delay: 120ms;
}

.video-card:nth-child(4) {
    animation-delay: 180ms;
}

.video-card:nth-child(5) {
    animation-delay: 240ms;
}

.video-card:nth-child(6) {
    animation-delay: 300ms;
}

.video-card:nth-child(7) {
    animation-delay: 360ms;
}

.video-card:nth-child(8) {
    animation-delay: 420ms;
}

.video-card:nth-child(9) {
    animation-delay: 480ms;
}

.video-card:nth-child(10) {
    animation-delay: 540ms;
}

.video-card:nth-child(11) {
    animation-delay: 600ms;
}

.video-card:nth-child(12) {
    animation-delay: 660ms;
}

/* ============================================================
   Utility - Focus visible outlines
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Mobile search toggle */
.mobile-search-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
    .mobile-search-toggle {
        display: flex;
    }
}

/* Mobile search bar (expandable) */
.mobile-search-bar {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 999;
}

.mobile-search-bar.active {
    display: block;
}

.mobile-search-bar input {
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.mobile-search-bar input:focus {
    border-color: var(--primary);
}

/* ============================================================
   Platform Badge on Video Cards
   ============================================================ */
.card-platform-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.68rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px hsla(0, 0%, 0%, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ============================================================
   Nav Refresh Indicator
   ============================================================ */
.nav-refresh-info {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.refresh-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: hsl(140, 70%, 50%);
    animation: refreshPulse 2s ease-in-out infinite;
}

@keyframes refreshPulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 hsla(140, 70%, 50%, 0.4);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 4px hsla(140, 70%, 50%, 0);
    }
}

@media (max-width: 900px) {
    .nav-refresh-info {
        display: none;
    }
}

/* ============================================================
   Article Content Styles (Blog Mode)
   ============================================================ */
.modal-player.article-mode {
    aspect-ratio: auto;
    height: 60vh;
    min-height: 400px;
    background: var(--bg-card);
}

.modal-article-content {
    padding: 2rem;
    color: var(--text-primary);
    height: 100%;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 1.05rem;
}

.modal-article-content h1,
.modal-article-content h2,
.modal-article-content h3 {
    color: var(--text-primary);
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.modal-article-content p {
    margin-bottom: 1.25em;
}

.modal-article-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1.5em 0;
    display: block;
}

.modal-article-content a {
    color: var(--primary);
    text-decoration: underline;
}

.modal-article-content blockquote {
    border-left: 4px solid var(--primary);
    margin: 1.5em 0;
    padding: 1rem 1rem 1rem 1.5rem;
    color: var(--text-secondary);
    background: var(--bg-hover);
    border-radius: 0 8px 8px 0;
}