/* VOD Archive - Twitch-themed dark design */
:root {
    --twitch-purple: #9146ff;
    --twitch-purple-dark: #772ce8;
    --twitch-purple-dim: rgba(145, 70, 255, 0.15);
    --bg-dark: #0e0e10;
    --bg-card: #18181b;
    --bg-card-hover: #1f1f23;
    --text-primary: #efeff1;
    --text-secondary: #adadb8;
    --text-muted: #53535f;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --accent-glow: rgba(145, 70, 255, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(180deg, rgba(145, 70, 255, 0.12) 0%, transparent 100%);
    padding: 2rem 1.5rem 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--twitch-purple);
}

.header-title {
    font-family: 'Shantell Sans', cursive;
    font-size: 2.5rem;
    margin: 0 0 0.25rem;
    background: linear-gradient(135deg, var(--text-primary), var(--twitch-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0 0 1.5rem;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--twitch-purple);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Main content */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Search */
.search-section {
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.9rem 2.75rem 0.9rem 2.75rem;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-input:focus {
    outline: none;
    border-color: var(--twitch-purple);
    box-shadow: 0 0 0 3px var(--twitch-purple-dim);
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.search-wrapper:has(.search-input:not(:placeholder-shown)) .search-clear {
    opacity: 1;
}

.search-clear:hover {
    color: var(--text-primary);
}

/* Filters */
.filters-section {
    margin-bottom: 1.5rem;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-select,
.filter-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-primary);
    min-width: 140px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--twitch-purple);
}

/* Results header */
.results-header {
    margin-bottom: 1rem;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* VOD Grid */
.vod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.vod-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.vod-card:hover {
    transform: translateY(-4px);
    border-color: var(--twitch-purple);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.vod-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-dark);
}

.vod-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.vod-card:hover .vod-card-thumb img {
    transform: scale(1.05);
}

.vod-card-duration {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 4px;
}

.vod-card-body {
    padding: 1rem;
}

.vod-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vod-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.vod-card-game {
    padding: 0.2rem 0.5rem;
    background: var(--twitch-purple-dim);
    color: var(--twitch-purple);
    border-radius: 4px;
    font-weight: 500;
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results p {
    margin: 0 0 1.5rem;
}

.clear-filters-btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--twitch-purple);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.clear-filters-btn:hover {
    background: var(--twitch-purple-dark);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal[hidden] {
    display: none;
}

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

.modal-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: min(95vh, 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s;
    z-index: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
}

.modal-title {
    font-family: 'Shantell Sans', cursive;
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.modal-player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-nav {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
}

.modal-nav-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.modal-nav-btn:hover:not(:disabled) {
    border-color: var(--twitch-purple);
    color: var(--twitch-purple);
}

.modal-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }

    .stats-bar {
        gap: 1.5rem;
    }

    .filters-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select,
    .filter-input {
        min-width: 100%;
    }

    .vod-grid {
        grid-template-columns: 1fr;
    }
}
