:root {
    --bg-color: #050505;
    --text-color: #ffffff;
    --gold-primary: #d4af37;
    --gold-light: #feda75;
    --gold-dark: #a67c00;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.8;
}

/* Background Overlay for Texture */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(212, 175, 55, 0.05), transparent 25%);
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

.text-gold {
    color: var(--gold-primary);
    background: linear-gradient(to left, var(--gold-light), var(--gold-primary), var(--gold-dark));
    /* Gradient direction adjusted for RTL */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn-gold,
.btn-gold-outline,
.btn-glass {
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    white-space: nowrap;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #000;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-gold-outline {
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
}

.btn-gold-outline:hover {
    background: rgba(212, 175, 55, 0.1);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.btn-glass:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-telegram {
    background: linear-gradient(135deg, #0088cc, #0077b5);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
    background: linear-gradient(135deg, #0099e6, #0088cc);
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 100;
}

.brand-logo {
    height: 90px;
    width: auto;
    max-width: 250px;
    /* Prevent it from being too wide on small screens */
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.5));
    transition: transform 0.3s;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a:not(.btn-gold-outline) {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 600;
}

.nav-links a:not(.btn-gold-outline):hover {
    color: var(--gold-primary);
}

/* Hero Section */
@media (max-width: 900px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .brand-logo {
        height: 60px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .btn-gold-outline {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 120px 5% 50px;
    /* Added top padding for fixed navbar overlap */
    position: relative;
    overflow: hidden;
    gap: 4rem;
    /* Increased gap for better breathing room */
}

.hero-content {
    flex: 1;
    z-index: 2;
    padding-left: 2rem;
    /* Adjusted for visual balance RTL */
}

/* Mobile Hero Order & Spacing */
@media (max-width: 900px) {
    .hero {
        flex-direction: column; /* Normal column puts visual (which is 2nd in HTML) at bottom. Let's fix this using order. */
        padding-top: 200px; /* More space below stacked navbar */
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        order: 2; /* Force text content below images */
    }
    
    .hero p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .platform-group {
        align-items: center;
    }
    
    .btn-row {
        justify-content: center;
    }
    
    .hero-visual {
        max-height: 350px;
        transform: scale(0.65); /* Scale down TV and Phone */
        transform-origin: center;
        margin-top: -2rem; /* Bring closer to navbar to save space */
        margin-bottom: 0; /* Remove negative margin to avoid overlap with text */
        order: 1; /* Force images above text */
    }
    
    .phone-frame {
        transform: rotateY(-15deg) rotateX(5deg) translateX(0); /* Remove aggressive left negative margin */
    }
}

.hero h1 {
    font-size: 3.8rem;
    /* Slightly smaller for better fit */
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    /* Reduced bottom margin */
    max-width: 550px;
    line-height: 1.7;
}

/* CTA Container */
.cta-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.platform-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.platform-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-soon {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--gold-primary);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-row {
    display: flex;
    gap: 1rem;
}


/* Visual Composition */
.hero-visual {
    flex: 1;
    position: relative;
    z-index: 1;
    perspective: 1500px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
}

.devices-composition {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* TV Frame */
.tv-frame {
    width: 500px;
    height: 300px;
    background: #111;
    border: 8px solid #2a2a2a;
    border-radius: 10px;
    position: absolute;
    right: 0px;
    /* Position behind phone */
    top: 50px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: rotateY(10deg) translateZ(-100px);
    z-index: 1;
}

.tv-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #050505, #1a1a1a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tv-content {
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
}

.tv-content i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.tv-stand {
    width: 150px;
    height: 20px;
    background: #222;
    margin: 0 auto;
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    clip-path: polygon(10% 0, 90% 0, 100% 100%, 0% 100%);
}

/* Phone Mockup (Front) */
.phone-frame {
    width: 280px;
    height: 560px;
    background: #000;
    border-radius: 40px;
    border: 6px solid #222;
    /* Sleek bezel */
    box-shadow: -20px 20px 60px rgba(0, 0, 0, 0.7), inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 2;
    transform: rotateY(-15deg) rotateX(5deg) translateX(-80px);
    /* Push left to overlap TV */
    overflow: hidden;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    /* Ensure image doesn't overflow */
    border-radius: 34px;
    /* Slight inner radius to match bezel */
}

.app-screenshot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


.features {
    padding: 6rem 5%;
    position: relative;
    z-index: 2;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bento-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bento-card {
    background: rgba(25, 25, 25, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bento-card.small {
    padding: 2.5rem;
    flex: 1;
}

.bento-content {
    position: relative;
    z-index: 2;
}

.bento-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: transform 0.6s ease;
}

.bento-bg.pattern {
    background: radial-gradient(circle at 0% 0%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.bento-bg.glow {
    background: radial-gradient(circle at 100% 100%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 175, 55, 0.3);
}

.bento-card:hover .bento-bg {
    transform: scale(1.05);
}

.icon-wrapper {
    background: rgba(212, 175, 55, 0.1);
    width: 70px;
    height: 70px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.icon-wrapper .icon-gold {
    font-size: 2rem;
    margin-bottom: 0;
    text-shadow: none;
}

.bento-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
    font-family: var(--font-heading);
}

.bento-card.small h3 {
    font-size: 1.4rem;
}

.bento-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Trending Section */
.trending {
    padding: 4rem 5%;
    position: relative;
    z-index: 5;
}

.filter-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #fff;
    border-color: rgba(212, 175, 55, 0.3);
}

.filter-btn.active {
    background: var(--gold-primary);
    color: #000;
    font-weight: bold;
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.trending-carousel-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trending-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1.5rem;
    padding: 2rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    scroll-behavior: smooth;
}

.trending-carousel::-webkit-scrollbar {
    display: none;
}

.movie-card {
    min-width: 260px;
    height: 380px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    flex: 0 0 auto;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: #111;
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover img {
    transform: scale(1.1);
}

.movie-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.movie-card:hover .movie-overlay {
    opacity: 1;
}

.movie-overlay h4 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--gold-light);
}

.movie-meta span {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    backdrop-filter: blur(5px);
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: rgba(212, 175, 55, 0.9);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.5rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.movie-card:hover .play-icon-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Premium Netflix-style Hero Cards */
.movie-card.premium-hero-card {
    min-width: 600px;
    height: 350px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.movie-card.premium-hero-card img {
    border-radius: 16px;
    object-position: center 20%;
}

.movie-card.premium-hero-card .movie-overlay {
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.6) 50%, transparent 100%);
    padding: 2rem;
    justify-content: flex-end;
}

.movie-card.premium-hero-card .movie-overlay h4 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.movie-card.premium-hero-card .movie-meta span {
    font-size: 1.1rem;
    padding: 0.3rem 0.8rem;
}

@media (max-width: 768px) {
    .movie-card.premium-hero-card {
        min-width: 320px;
        height: 220px;
    }
    .movie-card.premium-hero-card .movie-overlay h4 {
        font-size: 1.4rem;
    }
}

.carousel-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--gold-primary);
    color: #000;
    border-color: var(--gold-primary);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.loading-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 0;
    color: rgba(255, 255, 255, 0.6);
    gap: 1rem;
}

.text-4xl {
    font-size: 2.5rem;
}

/* New Content Sections (Egybest style) */
.content-section {
    padding: 1rem 5%;
    position: relative;
    z-index: 5;
    margin-bottom: 1.5rem;
}

.section-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.section-header-compact.bg-glassmorphism {
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.view-all {
    color: var(--gold-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.view-all:hover {
    color: var(--gold-light);
    transform: translateX(-5px); /* RTL */
}

.delete-btn {
    color: #ef4444; /* Red color for delete */
}

.delete-btn:hover {
    color: #f87171;
}


.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.content-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    flex: 1;
    scroll-behavior: smooth;
}

.content-carousel::-webkit-scrollbar { 
    display: none;  /* Safari and Chrome */
}

/* Making movie cards a bit smaller for compact generic sections */
.content-carousel .movie-card {
    min-width: 180px;
    height: 270px;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .content-carousel .movie-card {
        min-width: 140px;
        height: 210px;
    }
}

/* Showcase Section */
.showcase {
    padding: 8rem 5%;
    text-align: center;
    background: url('https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?q=80&w=2000&auto=format&fit=crop') no-repeat center center/cover;
    position: relative;
    margin-top: 4rem;
}

.showcase::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.95) 100%);
}

.showcase-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.showcase h2 {
    font-size: 3.5rem;
    margin-bottom: 2rem;
}

.stats-row {
    display: flex;
    justify-content: center;
    gap: 5rem;
    margin-top: 5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(to bottom, var(--gold-light), var(--gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Cairo', sans-serif;
}

.stat-label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    padding: 4rem 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #020202;
    text-align: center;
}

.footer-logo {
    font-family: 'Cairo', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold-primary);
    margin-bottom: 1.5rem;
}

.social-links {
    margin-bottom: 2rem;
}

.social-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    margin: 0 15px;
    transition: all 0.3s;
}

.social-links a:hover {
    color: var(--gold-primary);
    transform: scale(1.1);
}

.copyright {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: rotateY(-15deg) rotateX(5deg) translateY(0px) translateX(-80px);
    }

    50% {
        transform: rotateY(-15deg) rotateX(5deg) translateY(-15px) translateX(-80px);
    }

    100% {
        transform: rotateY(-15deg) rotateX(5deg) translateY(0px) translateX(-80px);
    }
}

.animate-fade-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Specific Scrollbar for Modals to ensure visibility */
#server-list::-webkit-scrollbar {
    width: 6px;
}

#server-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

#server-list::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}

#server-list::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

.text-gold {
    color: var(--gold-primary);
    background: linear-gradient(to left, var(--gold-light) 20%, var(--gold-primary) 40%, var(--gold-light) 60%, var(--gold-primary) 80%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    background-clip: text;
    /* Fix lint */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Visual Composition */
.hero-visual {
    flex: 1;
    position: relative;
    z-index: 1;
    perspective: 2000px;
    /* Enhanced perspective */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
}

.devices-composition {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-style: preserve-3d;
}

/* TV Frame */
.tv-frame {
    width: 480px;
    height: 280px;
    background: #000;
    border: 4px solid #333;
    border-bottom-width: 12px;
    border-radius: 6px;
    position: absolute;
    right: auto;
    left: 50%;
    top: 50%;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: translateX(-50%) translateY(-10%) rotateX(20deg) rotateY(0deg) translateZ(-100px);
    /* Tilted back as base */
    z-index: 1;
    transition: transform 0.5s ease;
}

/* ... (tv screen) ... */

/* Phone Mockup (Front) */
.phone-frame {
    width: 240px;
    height: 480px;
    background: #000;
    border-radius: 40px;
    border: 5px solid #1a1a1a;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.9),
        inset 0 0 0 2px rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-60%) rotateY(-15deg) rotateX(10deg) translateZ(100px);
    /* LEVITATING ABOVE */
    overflow: hidden;
    transition: transform 0.5s ease;
}

/* ... (animation) ... */

@media (max-width: 1200px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        gap: 2rem;
        padding-top: 150px;
        min-height: auto;
    }

    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 968px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 150px;
        gap: 2rem;
        min-height: auto;
    }

    .hero-content {
        padding-left: 0;
        width: 100%;
    }

    .hero h1 {
        font-size: 2.2rem;
        /* Scaled down for mobile */
    }

    .hero p {
        margin: 0 auto 1.5rem;
        font-size: 1rem;
        /* Smaller text for better reading */
    }

    .platform-group {
        align-items: center;
    }

    .hero-visual {
        height: auto;
        min-height: 550px;
        width: 100%;
        margin-top: 3rem;
        margin-bottom: 2rem;
        flex-shrink: 0;
        /* Prevent collapsing */
    }

    .devices-composition {
        transform: scale(0.9);
        flex-direction: column;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 0;
    }

    .btn-row {
        justify-content: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .btn-gold,
    .btn-glass,
    .btn-telegram {
        width: 100%;
        justify-content: center;
        max-width: 100%;
    }

    .tv-frame {
        width: 320px;
        height: 190px;
        position: relative;
        /* Switch to relative */
        top: 0;
        bottom: auto;
        left: auto;
        right: auto;
        transform: rotateX(5deg);
        /* Simple tilt */
        margin: 0 auto;
        z-index: 1;
    }

    .phone-frame {
        width: 200px;
        /* Slightly smaller phone */
        height: 400px;
        position: relative;
        /* Switch to relative */
        top: -60px;
        /* Overlap the TV beautifully */
        left: auto;
        right: auto;
        transform: rotateY(-5deg) translateZ(50px);
        margin: 0 auto;
        z-index: 10;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
    }

    .bento-grid {
        grid-template-columns: 1fr;
    }

    .bento-card {
        padding: 1.5rem;
        /* Reduced padding for more content space */
    }

    .trending-carousel-container {
        padding: 0 1rem;
    }

    .carousel-btn {
        display: none;
        /* Hide buttons on mobile, rely on swipe */
    }

    .tv-stand {
        bottom: -20px;
    }

    .showcase h2 {
        font-size: 2rem;
        /* Responsive showcase title */
    }

    .stats-row {
        gap: 1.5rem;
        margin-top: 2rem;
        flex-direction: column;
        /* Stack stats on mobile */
    }

    .stat-number {
        font-size: 2rem;
        /* Smaller stats */
    }
}

.features,
.showcase,
.footer {
    padding: 3rem 5%;
}

.stats-row {
    gap: 2rem;
    margin-top: 3rem;
}

.stat-number {
    font-size: 2.5rem;
}

/* Trailer Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 999999;
    /* Higher priority */
    inset: 0;
    /* Covers top, left, right, bottom entirely */
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #050505;
    margin: 0;
    padding: 0;
    /* Remove padding to make video borderless */
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    /* Larger max width */
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 1), 0 0 20px rgba(212, 175, 55, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Removed overflow: hidden so the close button escapes */
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-modal {
    color: rgba(255, 255, 255, 0.6);
    position: absolute;
    top: -55px;
    /* Safely placed outside */
    right: 0px;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100000;
    line-height: 1;
}

.close-modal:hover {
    color: var(--gold-primary);
    transform: rotate(90deg);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Advanced Filters (Library)
   ========================================================================== */
.advanced-filters-container {
    background-color: var(--secondary-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 0 5% 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #2a2e38;
    /* Match screenshot dropdown bg */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    transition: border-color 0.3s ease;
}

.custom-select:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.custom-select-wrapper .select-icon {
    position: absolute;
    left: 1rem;
    /* Left because RTL */
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-actions-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-reset {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-reset:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-apply {
    background-color: #e50914;
    /* Netflix/Desflix Red */
    border: none;
    color: white;
}

.btn-apply:hover {
    background-color: #f40612;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

/* Responsive Filters */
@media (max-width: 992px) {
    .filter-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .filter-row {
        grid-template-columns: 1fr;
    }

    .filter-actions-row {
        flex-direction: column-reverse;
    }

    .btn-reset,
    .btn-apply {
        width: 100%;
    }
}

/* ==========================================================================
   Details Page Styles
   ========================================================================== */

/* Full Background Overlay for Details Page */
#details-bg-overlay {
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: -1;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: background-image 0.8s ease-in-out;
}

#details-bg-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.1) 0%, rgba(15, 15, 15, 0.9) 70%, var(--bg-dark) 100%);
}

.details-main-container {
    padding-top: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.details-hero {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    gap: 2.5rem;
    padding: 2rem 1.5rem;
    margin-bottom: 3rem;
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .details-main-container {
        padding-top: 120px;
    }

    .details-hero {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
        text-align: right;
        padding: 3rem;
        background: rgba(15, 15, 15, 0.4);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    }
}

.details-hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
}

@media (min-width: 768px) {
    .details-hero-content {
        align-items: flex-start;
        gap: 1.5rem;
    }
}

.details-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.3;
    background: linear-gradient(135deg, #fff 0%, #d4d4d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 4px 15px rgba(0, 0, 0, 0.3);
}

@media (min-width: 768px) {
    .details-title {
        font-size: 3.8rem;
    }
}

.details-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 1rem;
    color: var(--text-light);
}

@media (min-width: 768px) {
    .details-meta {
        justify-content: flex-start;
        font-size: 1.1rem;
    }
}

.rating-pill {
    background: rgba(234, 180, 8, 0.2);
    color: var(--gold-primary);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(234, 180, 8, 0.4);
    font-weight: 700;
    box-shadow: 0 0 10px rgba(234, 180, 8, 0.1);
}

.age-restriction {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 1px;
}

.details-genres {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

@media (min-width: 768px) {
    .details-genres {
        justify-content: flex-start;
        gap: 0.8rem;
    }
}

.genre-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.genre-pill:hover {
    background: rgba(234, 180, 8, 0.15);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: translateY(-2px);
}

.details-plot {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-gray);
    max-width: 800px;
}

@media (min-width: 768px) {
    .details-plot {
        font-size: 1.15rem;
    }
}

.details-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .details-actions {
        flex-direction: row;
        width: auto;
    }
}

.details-actions button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
}

@media (min-width: 768px) {
    .details-actions button {
        width: auto;
        padding: 0.9rem 2.2rem;
    }
}

.details-poster-container {
    flex-shrink: 0;
    width: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    transition: transform 0.4s ease;
}

.details-poster-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

@media (min-width: 768px) {
    .details-poster-container {
        width: 320px;
        transform: translateY(-20px);
    }

    .details-poster-container:hover {
        transform: translateY(-30px);
    }
}

.details-poster-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: inherit;
    object-fit: cover;
}


/* Additional Sections */
.details-section {
    padding: 0 2rem;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    position: relative;
    padding-right: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--gold-primary);
    border-radius: 2px;
}


/* Cast Grid */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1.5rem;
}

.cast-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
    text-align: center;
}

.cast-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.cast-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.cast-name {
    padding: 0.8rem;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Episodes Grid */
.seasons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.episode-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.episode-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-primary);
    box-shadow: 0 8px 24px rgba(234, 180, 8, 0.1);
}

.episode-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
}

.episode-info {
    padding: 1.2rem;
    flex: 1;
}

.episode-info h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.episode-info p {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin: 0;
}