/* MidnightPass - SPA styles (merrycraft pattern, dark theme) */
:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --border: #334155;
    --accent: #38bdf8;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-wrap: wrap;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}
.logo svg { color: var(--accent); }
.logo span { color: var(--accent); }

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    min-width: 220px;
    flex: 1;
    max-width: 420px;
}
.search-bar .search-icon { color: var(--text-muted); flex-shrink: 0; }
.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 0.9rem;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar:focus-within { border-color: var(--accent); }

/* Layout */
.container { max-width: 1300px; margin: 0 auto; padding: 2rem 1rem; }
.video-player-container { max-width: 1000px; }

/* Home intro */
.home-intro { margin-bottom: 1.5rem; }
.eyebrow {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.home-intro h1 { font-size: 1.8rem; margin: 0.4rem 0 0.8rem; }
.intro-stats { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9rem; }
.intro-stats span { background: var(--surface); border: 1px solid var(--border); padding: 0.3rem 0.8rem; border-radius: 999px; }

/* Category chips */
.category-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.chip {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.chip:hover { background: var(--surface-hover); }
.chip.active { background: var(--accent); color: #0f172a; border-color: var(--accent); font-weight: 600; }

/* Video grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}
.video-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}
.video-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.thumbnail-wrapper { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.thumbnail { width: 100%; height: 100%; object-fit: cover; display: block; }
.play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.2s;
}
.video-card:hover .play-overlay { opacity: 1; }
.play-icon {
    width: 46px; height: 46px;
    background: rgba(56, 189, 248, 0.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #0f172a;
}
.video-info { padding: 0.8rem; }
.video-title {
    font-size: 0.9rem;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}
.video-meta { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; color: var(--text-muted); font-size: 0.75rem; flex-wrap: wrap; }
.tag-badge {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 2rem; flex-wrap: wrap; }
.page-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.page-btn:hover { background: var(--surface-hover); }
.page-btn.active { background: var(--accent); color: #0f172a; border-color: var(--accent); font-weight: 700; }

/* Video player page */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.back-link:hover { opacity: 0.8; }
.player-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.player-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.video-details { margin-top: 1.2rem; }
.video-details h1 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.video-details-meta { display: flex; gap: 0.8rem; align-items: center; color: var(--text-muted); font-size: 0.85rem; flex-wrap: wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.tag-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
}
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    background: var(--danger);
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}
.download-btn:hover { background: #dc2626; }

/* Related videos */
.related-videos { margin-top: 2.5rem; }
.section-title { font-size: 1.15rem; margin-bottom: 1rem; color: var(--accent); }
.muted-message { color: var(--text-muted); padding: 1rem 0; }
.player-message {
    padding: 3rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
}

/* No results */
.no-results { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.no-results svg { color: var(--text-muted); margin-bottom: 0.8rem; }
.no-results h2 { color: var(--text-main); margin-bottom: 0.4rem; }

/* Footer */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 640px) {
    .navbar { padding: 0.8rem 1rem; }
    .search-bar { order: 3; max-width: none; min-width: 100%; }
    .home-intro h1 { font-size: 1.4rem; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
}
