:root {
    --primary-color: #ff0055;
    --bg-dark: #000000;
    --bg-card: #121212;
    --bg-hover: #1f1f1f;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: #222222;
    --header-height: 80px;
    --header-height-mobile: 70px;
    --card-radius: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: var(--header-height);
}

/* --- Header --- */
.header {
    background-color: rgba(0, 0, 0, 0.95);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    transition: height 0.3s ease;
}

.header-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.left-section {
    display: flex;
    align-items: center;
}

.right-section {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}

.logo-img {
    max-height: 55px;
    width: auto;
    display: block;
}

.menu-icon {
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-main);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Sidenav --- */
.sidenav {
    height: 100%;
    width: 280px;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    background-color: #111;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    border-right: 1px solid var(--border-color);
}

.sidenav.open {
    transform: translateX(0);
    box-shadow: 10px 0 50px rgba(0,0,0,0.7);
}

.sidenav-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background-color: #000;
}

.sidenav-title {
    font-weight: 700;
    font-size: 1.2rem;
}

.close-btn {
    font-size: 28px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0 10px;
    line-height: 1;
}

.sidenav-links {
    padding: 15px;
}

.sidenav a.nav-item {
    padding: 14px 16px;
    text-decoration: none;
    font-size: 1rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: background 0.2s;
}

.sidenav a.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

#overlay {
    position: fixed;
    display: none;
    inset: 0;
    background-color: rgba(0,0,0,0.8);
    z-index: 1500;
    backdrop-filter: blur(2px);
}

#overlay.active {
    display: block;
}

/* --- Main Layout --- */
.main-content {
    padding: 25px 20px;
    max-width: 1600px;
    margin: 0 auto;
    min-height: 80vh;
}

.content-grid {
    display: grid;
    /* PC Desktop: Exactly 4 Columns */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* --- Video Card (Fixed Aspect Ratio) --- */
.video-card {
    background-color: var(--bg-card);
    border-radius: var(--card-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s ease;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.1);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    /* Fixed 16:9 Aspect Ratio */
    padding-top: 56.25%; 
    height: 0; 
    overflow: hidden;
    background-color: #000;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills box perfectly */
    display: block;
}

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
}

.video-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    z-index: 3;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    z-index: 4;
    transition: opacity 0.2s;
}

.video-card:hover .play-icon {
    opacity: 1;
}

.video-card-info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.video-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    padding: 40px 0 20px;
    list-style: none;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination li a, .pagination li span {
    color: var(--text-muted);
    padding: 8px 14px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    font-size: 0.9rem;
    transition: background 0.2s;
}

.pagination li.active a {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* --- Media Queries --- */

/* Tablet (Laptop/Tablet) - 2 Columns */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (Phone) - 1 Column */
@media (max-width: 768px) {
    body {
        padding-top: var(--header-height-mobile);
    }
    
    .header {
        height: var(--header-height-mobile);
    }
    
    .header-content {
        padding: 0 15px;
    }
    
    .logo-img {
        max-height: 45px;
    }
    
    .sidenav-header {
        height: var(--header-height-mobile);
    }

    /* 1 Column for Mobile */
    .content-grid {
        grid-template-columns: 1fr; 
        gap: 20px;
        padding-bottom: 20px;
    }

    .main-content {
        padding: 15px 15px;
    }

    .video-card-info {
        padding: 15px;
    }

    .video-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }

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

    .play-icon {
        display: none !important;
    }

    .pagination {
        gap: 5px;
        padding-top: 20px;
    }

    .pagination li a, .pagination li span {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
