/* CSS Reset & Variables */
:root {
    /* Dark Mode (Default) */
    --bg-color: #0f0f0f;
    --header-bg: rgba(15, 15, 15, 0.98);
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-color: #cc0000;
    --card-hover-bg: #1f1f1f;
    --search-bg: #1f1f1f;
    --search-focus-bg: #2a2a2a;
    --border-color: #2a2a2a;

    --border-radius: 12px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 56px;
    --grid-gap: 24px;

    /* Abstract Background - Dark Mode Default */
    --bg-image-color: #000000;
    --bg-image-gradient:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 0% 50%, hsla(225, 39%, 20%, 1) 0, transparent 50%),
        radial-gradient(at 100% 50%, hsla(250, 100%, 10%, 1) 0, transparent 50%);
    --bg-filter: contrast(120%) brightness(80%);
}

body.light-mode {
    /* Light Mode Overrides */
    --bg-color: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.98);
    --text-primary: #111111;
    --text-secondary: #606060;
    --card-hover-bg: #f2f2f2;
    --search-bg: #f1f1f1;
    --search-focus-bg: #e8e8e8;
    --border-color: #f0f0f0;

    /* Abstract Background - Light Mode Override */
    --bg-image-color: #ffffff;
    --bg-image-gradient:
        radial-gradient(at 0% 0%, hsla(253, 16%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 85%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 90%, 1) 0, transparent 50%),
        radial-gradient(at 0% 50%, hsla(225, 39%, 95%, 1) 0, transparent 50%),
        radial-gradient(at 100% 50%, hsla(250, 100%, 95%, 1) 0, transparent 50%);
    --bg-filter: contrast(110%) brightness(100%);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: var(--header-height);
    position: sticky;
    top: 0;
    background-color: var(--header-bg);
    z-index: 1000;
    /* Minimalist separation, simple bottom border or shadow */
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
    cursor: pointer;
}

.search-container {
    flex: 0 1 600px;
    display: flex;
    align-items: center;
    background: var(--search-bg);
    /* Light grey background for search */
    border-radius: 20px;
    padding: 0 16px;
    height: 40px;
    transition: background 0.2s;
}

.search-container:focus-within {
    background: var(--search-focus-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.search-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0 8px;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.header-actions {
    font-size: 14px;
    font-weight: 500;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 18px;
    transition: background 0.2s;
}

.nav-link:hover {
    background-color: var(--card-hover-bg);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-right: 12px;
}

.theme-toggle:hover {
    background-color: var(--card-hover-bg);
}

/* Main Content - Video Grid */
.video-grid {
    display: grid;
    /* Responsive grid logic */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--grid-gap);
    padding: 24px;
    max-width: 1800px;
    /* Constrain slightly on ultra-wide screens */
    margin: 0 auto;
}

/* Video Card */
.video-card {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background-color: var(--card-hover-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s;
}

.video-card:hover .thumbnail {
    opacity: 0.9;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 6px;
    border-radius: 4px;
}

.video-info {
    padding-right: 24px;
    /* Space for a potential menu/avatar if added later */
}

.video-card:hover .video-title {
    color: var(--accent-color);
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    transition: color 0.2s;
}

.video-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.video-meta span {
    margin-right: 4px;
}

.video-meta span:not(:last-child):after {
    content: "•";
    margin-left: 4px;
    opacity: 0.6;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.footer-links {
    margin-bottom: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 12px;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Top Navigation Bar Styles */
.top-nav-bar {
    padding: 16px 24px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Scroll Containers */
.models-row,
.channels-row,
.categories-row {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 8px;
    padding-top: 4px;
    /* Prevent hover clipping */
    /* Space for scrollbar if visible, layout breathing */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.models-row::-webkit-scrollbar,
.channels-row::-webkit-scrollbar,
.categories-row::-webkit-scrollbar {
    display: none;
    /* WebKit */
}

/* Row 1: Models */
.model-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    min-width: 70px;
}

.model-avatar-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    /* Rounded square */
    overflow: hidden;
    margin-bottom: 6px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.model-item:hover .model-avatar-wrapper {
    border-color: var(--accent-color);
}

.model-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.model-name {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.model-item:hover .model-name {
    color: var(--text-primary);
}

/* Row 2: Channels */
.channels-row {
    gap: 12px;
}

.channel-item {
    display: flex;
    align-items: center;
    background-color: var(--search-bg);
    padding: 6px 16px;
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.channel-item:hover {
    background-color: var(--card-hover-bg);
}

.channel-logo {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #333;
    /* Placeholder logo bg */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    font-weight: bold;
}

/* Row 3: Categories */
.categories-row {
    gap: 8px;
}

.category-pill {
    display: inline-block;
    padding: 6px 14px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.category-pill:hover {
    background-color: var(--card-hover-bg);
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.category-pill.active {
    background-color: var(--text-primary);
    color: var(--bg-color);
    /* Inverted text for contrast */
    border-color: var(--text-primary);
}

/* Abstract Background */
.abstract-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    /* Let clicks pass through */
    /* Let clicks pass through */
    background-color: var(--bg-image-color);
    background-image: var(--bg-image-gradient);
    filter: var(--bg-filter);
    transition: background-image 0.5s ease, background-color 0.5s ease;
}

/* Update header transparency to show bg */
.site-header {
    background-color: rgba(0, 0, 0, 0.4);
    /* Make it more transparent */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Ensure body bg is transparent so this shows through, or handled by z-index */
body {
    background-color: transparent;
    /* Let fixed bg show */
}

/* Responsiveness */
@media (max-width: 768px) {
    .site-header {
        padding: 0 16px;
    }

    .search-container {
        display: none;
        /* Hide search relative to full size, maybe show icon only in real app */
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        /* Full width on mobile */
        gap: 20px;
        padding: 16px;
    }

    .thumbnail-wrapper {
        /* Keep standard border radius and respect grid padding */
        width: 100%;
    }


    .video-info {
        padding: 0 8px;
    }
}

/* Video Page Styles */
.video-page-container {
    max-width: 1200px;
    /* Focus the content */
    margin: 0 auto;
    padding: 24px;
}

.video-player-section {
    margin-bottom: 40px;
}

.player-wrapper {
    width: 100%;
    background: #000;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.main-video-player {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
}

.video-details {
    padding: 0 4px;
}

.page-video-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.full-length-btn {
    display: block;
    width: 100%;
    background-color: var(--accent-color);
    color: #fff;
    text-align: center;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    transition: background-color 0.2s, transform 0.1s;
}

.full-length-btn:hover {
    background-color: #aa0000;
}

.full-length-btn:active {
    transform: scale(0.99);
}

.interleaved-nav {
    margin: 40px 0;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--search-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.tag:hover {
    background-color: var(--card-hover-bg);
    color: var(--text-primary);
}

.video-stats-row {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.view-count {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 16px;
}

.related-videos .section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 24px;
    /* Align with grid padding if needed, or 0 */
}

/* Adjust grid for related section if needed */
.related-videos .video-grid {
    padding-top: 0;
}

@media (max-width: 768px) {
    .video-page-container {
        padding: 0;
    }

    .player-wrapper {
        border-radius: 0;
    }

    .video-details {
        padding: 0 16px;
    }

    .related-videos .section-title {
        padding-left: 16px;
    }

    .page-video-title {
        font-size: 20px;
    }
}

/* Side Menu Styles */
.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.menu-btn:hover {
    background-color: var(--card-hover-bg);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: #1a1a1a;
    color: #fff;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Sidebar is always dark based on "looks like this" request */
/* If we wanted theme aware, we'd use var(--bg-color) but with high contrast */

.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.side-menu-header .logo {
    color: #fff;
}

.side-menu-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #ccc;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.menu-item svg {
    margin-right: 16px;
    color: inherit;
}

.side-menu-footer {
    padding: 24px;
    background-color: rgba(0, 0, 0, 0.2);
    /* Subtle contrast */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.side-menu-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 24px;
}

.side-menu-footer a {
    color: #888;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
    text-transform: capitalize;
    /* Move away from all-caps */
}

.side-menu-footer a:hover {
    color: #fff;
    text-decoration: none;
}

.copyright-text {
    font-size: 11px;
    color: #555;
    margin-top: 16px;
    display: block;
}

/* Advertisement Styles */
.ad-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
}

.banner-ad {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background-color: var(--search-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.banner-ad::after {
    content: "ADVERTISEMENT";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 8px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 2px;
}

.ad-card {
    background-color: var(--card-hover-bg);
    border: 1px solid var(--accent-color);
    /* Highlight ad card */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ad-card .thumbnail-wrapper {
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 24px;
}

.ad-badge {
    display: inline-block;
    background-color: #fca5a5;
    color: #7f1d1d;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ad-card .video-info {
    padding-top: 8px;
}
