﻿:root {
    --bg: #0b1020;
    --card: #121936;
    --text: #ecf0ff;
    --muted: #9aa3bd;
    --accent: #7aa2ff;
    --chip: #1a2350;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #0b1020 0, #0e1430 100%);
    color: var(--text);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* 🔹 Navigation */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

    .nav a {
        color: var(--text);
        text-decoration: none;
        margin-right: 12px;
    }

.brand {
    font-weight: 700;
}

/* 🔹 Cards & Controls */
.card {
    background: var(--card);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

input, select, button {
    background: #0e1532;
    color: var(--text);
    border: 1px solid #2a356d;
    border-radius: 10px;
    padding: 10px 12px;
    max-width: 85%;
}

    button.primary {
        background: var(--accent);
        color: #04122b;
        border: none;
    }

/* 🔹 Grid Layout */
#yt-items-grid, #csv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* 🔹 Video Tile/Card */
.video-card {
    background: #0c1330;
    border: 1px solid #202a5f;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease;
    cursor: pointer;
}

    .video-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 15px rgba(0,0,0,.4);
    }

    .video-card img.thumb {
        width: 100%;
        height: 160px;
        object-fit: cover;
        aspect-ratio: 16 / 9;
    }

    .video-card .info {
        padding: 0.75rem 1rem;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        flex-grow: 1;
    }

    .video-card .title {
        font-weight: 600;
        font-size: 1rem;
        line-height: 1.3em;
        color: var(--text);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .video-card .title a {
            color: var(--accent);
            text-decoration: none;
        }

            .video-card .title a:hover {
                text-decoration: underline;
            }

    .video-card .channel {
        font-size: 0.9rem;
        color: var(--muted);
    }

    .video-card .duration {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--accent);
        margin-top: auto;
    }

    /* ▶ Watch Button */
    .video-card a.btn-watch,
    .video-card button.btn-watch {
        margin-top: 0.5rem;
        align-self: flex-start;
        border-radius: 8px;
        padding: 0.3rem 0.8rem;
        background: var(--accent);
        color: #04122b;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: background 0.2s ease;
    }

        .video-card a.btn-watch:hover,
        .video-card button.btn-watch:hover {
            background: #5a8fff;
        }

/* 🔎 Search Box */
#yt-search-container {
    padding: 1% 0 0 1%;
    margin: 0 auto 1rem auto;
}

/* 🔹 Modal Player */
#yt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 10px;
    box-sizing: border-box;
}

#yt-modal-content {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

#yt-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#yt-modal-close {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    font-size: 24px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

    #yt-modal-close:hover {
        background: rgba(255,255,255,0.35);
    }

/* 🔹 Responsive Improvements */
@media (max-width: 768px) {
    #yt-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .video-card img.thumb {
        height: 120px;
    }

    .video-card .title {
        font-size: 0.85rem;
    }

    .video-card .channel, .video-card .duration {
        font-size: 0.75rem;
    }

    .video-card a.btn-watch, .video-card button.btn-watch {
        padding: 3px 6px;
        font-size: 10px;
    }
}
