:root {
    --primary-bg: #0b0b10;
    --secondary-bg: #15151e;
    --accent-color: #ff0000;
    --accent-hover: #cc0000;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 0, 0, 0.08);
    --glass-border: rgba(255, 0, 0, 0.15);
    --card-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--primary-bg);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Header */
header {
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 11, 16, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    text-decoration: none;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo span {
    color: var(--text-main);
}

nav {
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

nav a:hover, nav a.active {
    color: var(--text-main);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    position: relative;
    width: 250px;
}

.search-bar input {
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem 0.5rem 2.2rem;
    border-radius: 50px;
    color: white;
    outline: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.search-bar input:focus {
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.1);
}

.search-bar i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 80vh;
    width: 100%;
    background: linear-gradient(rgba(0,0,0,0.5), var(--primary-bg)), url('https://images.unsplash.com/photo-1626814026160-2237a95fc5a0?q=80&w=2070&auto=format&fit=crop') center/cover;
    display: flex;
    align-items: center;
    padding: 0 5%;
    margin-bottom: 2rem;
}

.hero-content {
    max-width: 600px;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 900;
    line-height: 1.1;
}

.hero-content p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Genre Chips */
.genre-list {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
    margin-top: -1rem;
}

.genre-list::-webkit-scrollbar {
    display: none;
}

.genre-chip {
    padding: 0.5rem 1.2rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.genre-chip:hover, .genre-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Catalog Grid */
.container {
    padding: 0 5% 5rem;
}

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

.section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 2px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--secondary-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--glass-border);
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: var(--card-shadow);
}

.card-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    background: #1a1a1a;
}

.card-info {
    padding: 1rem;
}

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

.card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--secondary-bg) 25%, #1e1e2d 50%, var(--secondary-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 300px;
    border-radius: 12px;
}

/* Horizontal Rows */
.row-container {
    margin-bottom: 3rem;
    position: relative;
}

.row-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
}

.row-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.row-grid .card {
    min-width: 140px;
    flex-shrink: 0;
}

.row-grid .card-img {
    height: 210px; /* Adjust height to maintain aspect ratio */
}

/* Progress Bar */
.progress-container {
    height: 4px;
    background: rgba(255,255,255,0.1);
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* Trailer Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    width: 100%;
    max-width: 900px;
    aspect-ratio: 16/9;
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .row-grid .card {
        min-width: 120px;
    }
    .row-grid .card-img {
        height: 180px;
    }
}

/* Watch Page */
.player-container {
    width: 100%;
    max-width: 1400px;
    margin: 100px auto 2rem;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.content-info {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
}

.controls-panel {
    background: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.cast-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none;
}

.cast-list::-webkit-scrollbar {
    display: none;
}

.cast-item {
    min-width: 100px;
    text-align: center;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid var(--glass-border);
}

.cast-name {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cast-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.action-btns {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-icon.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.control-group {
    margin-bottom: 1rem;
}

.control-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.color-inputs {
    display: flex;
    gap: 1rem;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    padding: 5px 10px;
    border-radius: 5px;
}

input[type="color"] {
    border: none;
    width: 30px;
    height: 30px;
    background: none;
    cursor: pointer;
}

select {
    appearance: none;
    background-color: var(--secondary-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    color: white;
    border: 1px solid var(--glass-border);
    padding-right: 2.5rem !important;
    outline: none;
    transition: var(--transition);
}

select:focus {
    border-color: var(--accent-color);
    background-color: rgba(255, 159, 28, 0.15);
}

select option {
    background-color: var(--secondary-bg);
    color: white;
    padding: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    .search-bar { width: 180px; }
    nav { gap: 1rem; }
}

@media (max-width: 768px) {
    header { padding: 0.2rem 5%; }
    
    .menu-toggle, .search-toggle { display: block; }
    
    nav {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--secondary-bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-150%);
        transition: var(--transition);
        border-bottom: 1px solid var(--glass-border);
        z-index: 999;
    }
    
    nav.open {
        transform: translateY(0);
    }

    .search-bar {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--secondary-bg);
        padding: 1rem 5%;
        display: none;
        border-bottom: 1px solid var(--glass-border);
        z-index: 998;
    }

    .search-bar.active {
        display: block;
    }

    .hero { height: 60vh; }
    .hero-content h1 { font-size: 2.2rem; }
    .hero-content p { font-size: 1rem; }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .player-container {
        margin-top: 60px;
        width: 100vw;
        max-width: none;
        margin-left: calc(-50vw + 50%);
        border-radius: 0;
    }
    
    .controls-panel {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .logo { font-size: 1.2rem; }
    .hero-content h1 { font-size: 1.8rem; }
    .btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
    .grid { grid-template-columns: repeat(2, 1fr); }
}

/* Infinite Loader */
.loader-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 159, 28, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px dashed var(--glass-border);
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(15px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.settings-content {
    background: var(--secondary-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.settings-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--secondary-bg);
    z-index: 10;
}

.settings-body {
    padding: 1.5rem;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section h4 {
    color: var(--accent-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.setting-info h5 {
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.setting-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* OLED Mode */
body.oled-mode {
    --primary-bg: #000000;
    --secondary-bg: #0a0a0a;
}

/* Performance Mode */
body.no-animations * {
    transition: none !important;
    animation: none !important;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.settings-btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.settings-btn-group .btn {
    font-size: 0.8rem;
    padding: 0.6rem;
    text-align: center;
}

.close-settings {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-settings:hover {
    color: white;
}
