/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --accent-color: #ff4444;
    --border-color: #333333;
    --hover-bg: #222222;
    --card-bg: #1a1a1a;
    --header-height: 120px;
    --sidebar-width: 240px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fixed Header */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #ff4444 0%, #ff8844 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Ad Banner */
.ad-banner {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
}

.ad-banner iframe {
    max-width: 728px;
    width: 100%;
    height: 90px;
    border: none;
}

/* Legacy placeholder styles (if needed for fallback) */
.ad-placeholder {
    width: 728px;
    height: 90px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    border-color: var(--accent-color);
    color: var(--text-secondary);
}

/* Main Container */
.main-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

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

.nav-item.active a {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border-left: 3px solid var(--accent-color);
}

.nav-item .icon {
    font-size: 20px;
}

/* Categories Section in Sidebar */
.categories-section {
    margin-top: 30px;
    padding: 0 20px;
}

.categories-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.categories-section ul {
    list-style: none;
}

.categories-section li {
    margin-bottom: 8px;
}

.categories-section a {
    display: block;
    padding: 8px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.categories-section a:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 30px;
    background-color: var(--bg-primary);
}

.content-header {
    margin-bottom: 30px;
}

.content-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.content-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.video-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-color);
    box-shadow: 0 8px 24px rgba(255, 68, 68, 0.1);
}

.video-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background-color: var(--bg-secondary);
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Video Loading State */
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-secondary);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-error {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 20px;
}

.video-error small {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.video-info {
    padding: 16px;
}

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

.video-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.video-meta span {
    display: inline-flex;
    align-items: center;
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

/* Responsive Design */
@media (max-width: 1600px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ad-placeholder {
        width: 728px;
        height: 90px;
    }
}

@media (max-width: 968px) {
    :root {
        --sidebar-width: 200px;
        --header-height: 140px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        padding: 15px 0;
    }
    
    .logo {
        text-align: center;
    }
    
    .ad-placeholder {
        width: 100%;
        max-width: 728px;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --header-height: 160px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        width: 240px;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-placeholder {
        width: 100%;
        height: 80px;
        font-size: 12px;
    }
    
    .content-header h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 180px;
    }
    
    .logo h1 {
        font-size: 24px;
    }
    
    .tagline {
        font-size: 12px;
    }
    
    .ad-placeholder {
        height: 60px;
    }
    
    .video-info {
        padding: 12px;
    }
    
    .video-title {
        font-size: 14px;
    }
    
    .video-description {
        font-size: 13px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Styling */
::selection {
    background-color: var(--accent-color);
    color: var(--text-primary);
}

/* Focus Styles for Accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Version Badge - Bottom Left */
.version-badge {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    color: #0ff;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    animation: slideInUp 0.5s ease-out;
}

.version-badge:hover {
    transform: scale(1.05);
    border-color: rgba(0, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.9);
}

.version-compact {
    display: flex;
    align-items: center;
    gap: 4px;
}

.version-details {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.version-badge.expanded .version-compact {
    display: none;
}

.version-badge.expanded .version-details {
    display: block;
}

.version-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0;
}

.version-label {
    color: rgba(0, 255, 255, 0.6);
    font-weight: 500;
}

.version-number,
.build-number,
.build-time {
    color: #0ff;
    font-weight: 700;
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile adjustments for version badge */
@media (max-width: 768px) {
    .version-badge {
        bottom: 70px; /* Above mobile navigation */
        left: 10px;
        font-size: 10px;
        padding: 6px 12px;
    }
}
