/* ===================================
   GAMET LIBRARY - Design System
   Minimalist Apple-inspired Style
   =================================== */

:root {
    /* Colors */
    --color-bg: #000000;
    --color-surface: #0a0a0a;
    --color-card: #141414;
    --color-card-hover: #1a1a1a;
    --color-border: rgba(255, 255, 255, 0.08);

    --color-text-primary: #ffffff;
    --color-text-secondary: #a1a1a1;
    --color-text-muted: #666666;

    --color-accent: #ffffff;
    --color-accent-dim: rgba(255, 255, 255, 0.9);

    /* Typography */
    --font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Layout */
    --nav-height: 64px;
    --content-padding: 4%;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: transparent;
    /* Essential for global video visibility */
    color: var(--color-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===================================
   NAVIGATION
   =================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    transition: background var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--content-padding);
    max-width: 1920px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-text-primary);
    color: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

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

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    position: relative;
    height: 85vh;
    min-height: 600px;
    max-height: 900px;
    display: flex;
    align-items: flex-end;
    padding: var(--space-3xl) var(--content-padding);
    overflow: hidden;
    padding: var(--space-3xl) var(--content-padding);
    overflow: hidden;
    /* Removed opaque fallback to let global video show */
}

.hero-backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    transition: opacity var(--transition-slow);
}

/* Global Background Video */
.global-video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
}

.global-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.global-video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    /* Darken bg for readability */
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--color-bg) 0%, transparent 50%),
        linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #ffffff;
    color: #000000;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: var(--space-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: var(--space-md);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.hero-meta span::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--color-text-muted);
    border-radius: 50%;
    margin-right: var(--space-md);
    vertical-align: middle;
}

.hero-meta span:first-child::before {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: var(--color-text-primary);
    color: var(--color-bg);
}

.btn-primary:hover {
    background: var(--color-accent-dim);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1rem;
}

/* ===================================
   CONTENT ROWS
   =================================== */

.content {
    padding: 0 var(--content-padding) var(--space-3xl);
    margin-top: -100px;
    /* Overlap with hero */
    position: relative;
    z-index: 10;
    /* If hero is transparent, we might want less negative margin or padding adjustments */
    padding-top: var(--space-xl);
}

.category-row {
    margin-bottom: var(--space-2xl);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.category-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.category-link {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.category-link:hover {
    color: var(--color-text-primary);
}

/* Video Slider */
.video-slider {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-sm) 0;
    margin: 0 calc(-1 * var(--space-sm));
    padding: var(--space-sm);
}

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

/* Video Card */
.video-card {
    flex: 0 0 auto;
    width: 280px;
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform var(--transition-normal);
}

.video-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.video-poster {
    position: relative;
    aspect-ratio: 16/9;
    width: 100%;
    /* Ensure it takes full width of card */
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(20, 20, 20, 0.8);
    margin-bottom: var(--space-sm);
}

.video-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform var(--transition-slow);
}

.video-card:hover .video-poster img {
    transform: scale(1.1);
}

.video-poster-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    color: var(--color-text-muted);
    background: linear-gradient(135deg, var(--color-card) 0%, var(--color-surface) 100%);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.video-play-btn {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-bg);
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.video-card:hover .video-play-btn {
    transform: scale(1);
}

.video-play-btn svg {
    width: 20px;
    height: 20px;
    margin-left: 2px;
}

.video-info {
    padding: 0 var(--space-xs);
}

.video-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-card-meta {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* ===================================
   EMPTY STATE
   =================================== */

.empty-state {
    text-align: center;
    padding: var(--space-3xl);
    margin-top: 100px;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.empty-state p {
    color: var(--color-text-secondary);
}

.empty-state a {
    color: var(--color-text-primary);
    text-decoration: underline;
}

/* ===================================
   MODAL
   =================================== */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--color-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-poster {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--color-surface);
    background-size: cover;
    background-position: center;
}

.modal-info {
    padding: var(--space-xl);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-md);
}

.modal-meta {
    display: flex;
    gap: var(--space-md);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-lg);
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.modal-description {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    padding: var(--space-2xl) var(--content-padding);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1920px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.footer-links {
    display: flex;
    gap: var(--space-md);
}

.footer-link,
.footer-link-btn {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.footer-link:hover,
.footer-link-btn:hover {
    color: var(--color-text-primary);
    text-decoration: underline;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: auto;
    /* Push to right */
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    :root {
        --content-padding: 5%;
        --nav-height: 56px;
    }

    .nav-links {
        display: none;
    }

    .hero {
        height: 70vh;
        min-height: 480px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .video-card {
        width: 200px;
    }

    .category-title {
        font-size: 1.125rem;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .modal-info {
        padding: var(--space-lg);
    }

    .modal-title {
        font-size: 1.25rem;
    }
}

/* ===================================
   SCROLLBAR
   =================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}