/* Modern Dark Theme with Better Layout */
:root {
    --primary-bg: #0a0e1a;
    --secondary-bg: #141927;
    --card-bg: #1a1f35;
    --card-hover: #242b47;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2a3244;
    --header-height: 70px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

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

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Header */
.main-header {
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 30px;
}

.logo h1 {
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

/* Navigation */
.nav {
    display: flex;
    gap: 5px;
}

.nav-item {
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item i {
    font-size: 0.9rem;
}

.nav-item:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
}

/* Search Container */
.search-container {
    flex: 1;
    max-width: 500px;
    margin-left: auto;
}

.search-bar {
    position: relative;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 10px 40px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

#clear-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

/* Main Content */
.main-content {
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Homepage Sections */
.homepage-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    width: 35px;
    height: 35px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-all-btn {
    padding: 8px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.view-all-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
}

/* Horizontal Scroll Container */
.horizontal-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) var(--secondary-bg);
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.horizontal-scroll::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 10px;
}

.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
    flex-shrink: 0;
}

.card:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-image {
    width: 100%;
    height: 280px;
    position: relative;
    overflow: hidden;
}

.card-image.poster {
    height: 300px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 12px;
}

.card-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Search Results */
.search-results {
    background: var(--secondary-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-search {
    padding: 8px 16px;
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-search:hover {
    background: var(--card-hover);
}

.search-category {
    margin-bottom: 30px;
}

.search-category h3 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Filters Section */
.filters-section {
    margin-bottom: 20px;
}

.filter-options {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.filter-select {
    padding: 10px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
}

/* Category Selector */
.category-selector {
    display: flex;
    gap: 10px;
}

.category-chip {
    padding: 8px 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.category-chip:hover {
    background: var(--card-hover);
    border-color: var(--accent-primary);
}

.category-chip.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--secondary-bg);
    border-radius: 15px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 1200px;
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--card-hover);
    color: var(--text-primary);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        padding: 10px;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: space-around;
        margin-top: 10px;
    }
    
    .search-container {
        order: 2;
        max-width: none;
        margin-left: 0;
    }
    
    .main-header {
        height: auto;
    }
    
    .main-content {
        margin-top: 120px;
        height: calc(100vh - 120px);
    }
    
    .horizontal-scroll {
        gap: 10px;
    }
    
    .card {
        min-width: 150px;
    }
    
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
}

/* Notification */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    max-width: 350px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 10001;
}

.notification.visible {
    transform: translateX(0);
}

/* Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

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

/* Player Controls */
.player-controls {
    padding: 15px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

/* No Results */
.no-results {
    text-align: center;
    padding: 40px;
}

.no-results h3 {
    margin-bottom: 10px;
}

/* Button */
.button {
    padding: 10px 20px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Error Message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
}

/* Add to your styles.css */

/* See All Button */
.see-all-btn {
    padding: 8px 20px !important;
    font-size: 0.95rem !important;
    background: var(--accent-gradient) !important;
    border: none;
    border-radius: 25px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.see-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Category Header */
.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    margin-bottom: 20px;
}

.filter-bar label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.filter-bar select,
.filter-bar input {
    width: 100%;
    padding: 10px;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* All Results Header */
.all-results-header {
    margin-bottom: 30px;
}

.all-results-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#filtered-channels-container {
    min-height: 200px;
}