/* styles.css - GlowVision Styling */
/* Netflix-style dark theme for streaming platform */

/* CSS Custom Properties (Variables) */
:root {
    /* Colors */
    --sd-primary: #e50914;
    --sd-primary-dark: #b20710;
    --sd-secondary: #564d4d;
    --sd-dark: #141414;
    --sd-darker: #0d0d0d;
    --sd-light: #f4f4f4;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    
    /* Background Colors */
    --bg-primary: #141414;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-overlay: rgba(20, 20, 20, 0.9);
    
    /* Border Colors */
    --border-color: #333333;
    --border-light: #555555;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-Index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--sd-primary);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--sd-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--sd-primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-light);
    border-color: var(--border-light);
}

/* Navigation Styles */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: var(--z-fixed);
    transition: background var(--transition-normal);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sd-primary);
}

.logo img {
    height: 32px;
    width: auto;
}

.logo-text {
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Search Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    width: 300px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--sd-primary);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.search-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    cursor: pointer;
    margin-left: -2.5rem;
    z-index: 1;
}

/* User Menu Styles */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sd-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
    margin-top: 0.5rem;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Main Content Styles */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

/* Category Banner Section */
.category-banner {
    position: relative;
    height: 350px;
    background: linear-gradient(135deg, var(--sd-primary), var(--sd-secondary));
    overflow: hidden;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    height: 200px;
    z-index: 1;
}

/* Category Info Section */
.category-info {
    position: relative;
    padding: 2rem 2.5rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 2;
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.category-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--sd-primary);
    flex-shrink: 0;
}

.category-details {
    flex: 1;
}

.category-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.category-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.category-stats span {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
}

.category-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Content Sections */
.content-section {
    margin-bottom: 3rem;
    padding: 0 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-arrow {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Category Videos Grid (Parent) */
.category-videos .videos-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Category Row (Subcategories) */
.category-row {
    margin-bottom: 2.5rem;
}

.category-header .category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-title-link {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.category-title-link:hover {
    color: var(--sd-primary);
}

/* Videos Carousel */
.videos-carousel {
    position: relative;
    overflow: hidden;
}

.videos-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.videos-grid::-webkit-scrollbar {
    display: none;
}

/* Video Card Styles */
.video-card {
    flex: 0 0 250px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.video-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.video-stats {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Loading States */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--sd-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty and Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon,
.error-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state p,
.error-state p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .category-videos .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .video-card {
        flex: 0 0 220px;
    }
    
    .main-nav {
        padding: 1rem 1.5rem;
    }
    
    .content-section {
        padding: 0 1.5rem;
    }
    
    .category-info {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .category-videos .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .video-card {
        flex: 0 0 180px;
    }
    
    .category-banner {
        height: 250px;
    }
    
    .category-info {
        padding: 1.5rem;
    }
    
    .category-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .category-avatar {
        width: 80px;
        height: 80px;
        align-self: center;
    }
    
    .category-title {
        font-size: 2rem;
    }
    
    .category-stats {
        justify-content: center;
    }
    
    .nav-menu {
        display: none;
    }
    
    .search-input {
        width: 200px;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .section-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .category-videos .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .video-card {
        flex: 0 0 160px;
    }
    
    .main-nav {
        padding: 1rem;
    }
    
    .content-section {
        padding: 0 1rem;
    }
    
    .category-banner {
        height: 200px;
    }
    
    .category-info {
        padding: 1rem;
    }
    
    .category-title {
        font-size: 1.5rem;
    }
    
    .category-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-container {
        display: none;
    }
    
    .videos-grid {
        gap: 0.75rem;
    }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #666666;
        --border-light: #888888;
    }
    
    .video-card {
        border: 1px solid var(--border-color);
    }
    
    .btn {
        border: 1px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
    }
}

/* Focus Styles for Accessibility */
.video-card:focus,
.btn:focus,
.nav-arrow:focus,
.user-avatar:focus {
    outline: 2px solid var(--sd-primary);
    outline-offset: 2px;
}

.search-input:focus {
    outline: 2px solid var(--sd-primary);
    outline-offset: 1px;
}

/* Print Styles */
@media print {
    .main-nav,
    .nav-arrow,
    .search-container,
    .user-menu {
        display: none;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .video-card {
        break-inside: avoid;
    }
}

/* Additional Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

/* Site Footer — see also footer.css */
.site-footer {
    background: rgba(0, 0, 0, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 30px;
    text-align: center;
    margin-top: 40px;
    width: 100%;
    box-sizing: border-box;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 24px;
    margin-bottom: 10px;
}

.footer-links a {
    color: #b3b3b3;
    text-decoration: none;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copyright {
    color: #808080;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
}

@media (max-width: 600px) {
    .site-footer { padding: 14px 16px; }
    .footer-links { gap: 4px 14px; }
}