@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-color: #0b0b0f;
    --bg-secondary: #111118;
    --card-bg: #1a1a24;
    --card-bg-hover: #22222e;
    --text-primary: #e8e8ea;
    --text-secondary: #9aa0a6;
    --text-muted: #6b7280;
    --accent: #e50914;
    --accent-hover: #f40612;
    --accent-glow: rgba(229, 9, 20, 0.25);
    --accent-soft: rgba(229, 9, 20, 0.1);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --sidebar-width: 250px;
    --header-height: 60px;
    --gradient-accent: linear-gradient(135deg, #e50914, #ff4d58);
    --gradient-dark: linear-gradient(180deg, rgba(11,11,15,0) 0%, rgba(11,11,15,0.9) 100%);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ========== Layout ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(17,17,24,0.98) 0%, rgba(11,11,15,0.98) 100%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    padding: 20px 15px;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    padding-top: calc(var(--header-height) + 20px);
}

/* ========== Header ========== */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(11, 11, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 90;
    justify-content: space-between;
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1px;
}

.logo-wrap img {
    height: 50px;
}

/* ========== Navigation ========== */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--accent-soft);
    color: #fff;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

/* ========== Video Grid ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.video-card:hover .video-thumb-wrap::after {
    opacity: 1;
}

.video-thumb-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.thumb-category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.92), rgba(180, 0, 50, 0.92));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.video-thumb-wrap::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(229, 9, 20, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    opacity: 0;
    transition: opacity var(--transition-fast);
    text-indent: 3px;
    line-height: 50px;
    text-align: center;
}

.video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

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

.video-meta {
    padding: 12px 15px;
}

.video-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-info {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* ========== Video Page Layout (2 columns) ========== */
.video-page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.video-main-col {
    min-width: 0; /* prevent grid blowout */
}

/* ========== Player ========== */
.player-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    position: relative;
}

.player-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

/* ========== Video Details ========== */
.video-details {
    background: var(--card-bg);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.video-details h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.video-stats {
    display: flex;
    gap: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== Movie Information Card ========== */
.movie-info-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 24px;
}

.movie-info-header {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(229, 9, 20, 0.05));
    padding: 14px 20px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.3px;
}

.movie-info-icon {
    font-size: 18px;
}

.movie-info-body {
    padding: 8px 0;
}

.movie-info-row {
    display: flex;
    align-items: flex-start;
    padding: 10px 20px;
    transition: background var(--transition-fast);
}

.movie-info-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.info-label {
    flex-shrink: 0;
    width: 120px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    word-break: break-word;
}

.code-badge {
    background: var(--gradient-accent);
    color: #fff;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.info-link {
    color: var(--accent);
    margin-right: 8px;
    transition: color var(--transition-fast);
}

.info-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.actress-name {
    color: #f472b6;
    font-weight: 600;
}

/* ========== Tags ========== */
.tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-fast);
    cursor: pointer;
    display: inline-block;
}

.tag:hover {
    background: var(--accent-soft);
    border-color: rgba(229, 9, 20, 0.3);
    color: #ff8a8a;
    transform: translateY(-1px);
}

/* ========== Related Videos ========== */
.related-section {
    margin-top: 4px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 4px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--accent);
    border-radius: 2px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.related-grid .video-card {
    border-radius: var(--radius-md);
}

.related-grid .video-meta {
    padding: 10px 12px;
}

.related-grid .video-title {
    font-size: 13px;
}

/* ========== Popular Sidebar ========== */
.popular-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
    padding-right: 4px;
}

.popular-sidebar::-webkit-scrollbar {
    width: 3px;
}
.popular-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.popular-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.popular-item:hover {
    background: var(--card-bg-hover);
    border-color: var(--border-hover);
    transform: translateX(3px);
}

.popular-rank {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

.popular-item:nth-child(1) .popular-rank {
    background: var(--gradient-accent);
    color: #fff;
}

.popular-item:nth-child(2) .popular-rank {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.popular-item:nth-child(3) .popular-rank {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: #fff;
}

.popular-thumb {
    flex-shrink: 0;
    width: 100px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.popular-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-info {
    flex: 1;
    min-width: 0;
}

.popular-title {
    font-size: 12px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 4px;
}

.popular-views {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========== Tag Page Header ========== */
.tag-page-header {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tag-page-header h2 {
    font-size: 20px;
    font-weight: 700;
}

/* ========== Mobile Responsive ========== */
@media (max-width: 1200px) {
    .video-page-layout {
        grid-template-columns: 1fr;
    }

    .popular-sidebar {
        position: static;
        max-height: none;
    }

    .popular-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 10px;
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0 5px;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: block;
    }
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .top-header {
        left: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .video-page-layout {
        gap: 16px;
    }

    .video-details h1 {
        font-size: 17px;
    }

    .info-label {
        width: 90px;
        font-size: 11px;
    }

    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .movie-info-row {
        flex-direction: column;
        gap: 4px;
    }

    .info-label {
        width: auto;
    }
}