@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Grotesk:wght@300;500;700&family=Tajawal:wght@400;500;700&display=swap');

:root {
    /* Premium Dark Palette */
    --bg-dark: #050505;
    --bg-card: #0f0f11;
    --bg-sidebar: rgba(10, 10, 12, 0.7);

    /* Neon & Gold Accents */
    --primary-neon: #00f2ff;
    --secondary-neon: #bd00ff;
    --premium-gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.5);

    --accent-glow: rgba(0, 242, 255, 0.4);

    /* Text */
    --text-main: #ffffff;
    --text-muted: #8b9bb4;

    /* Glassmorphism */
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 20, 30, 0.6);
    --backdrop-blur: blur(20px);

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --transition-fast: 0.3s var(--ease-out-expo);
    --transition-slow: 0.8s var(--ease-out-expo);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Tajawal', 'Outfit', sans-serif;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--glass-bg), var(--premium-gold));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-neon);
}

/* --- Layout --- */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 80px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: var(--backdrop-blur);
    border-right: var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    z-index: 100;
    transition: width 0.4s var(--ease-out-expo);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
}

.sidebar:hover {
    width: 240px;
}

.logo {
    width: 60px;
    height: 60px;
    background: transparent;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.nav-item {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.nav-item:hover {
    color: var(--text-main);
}

.nav-item.active {
    color: var(--premium-gold);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--premium-gold);
}

.nav-item i {
    font-size: 1.2rem;
    min-width: 30px;
    display: flex;
    justify-content: center;
    transition: transform 0.3s var(--ease-out-expo);
}

.nav-item:hover i {
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--premium-gold);
}

.nav-text {
    margin-left: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    transform: translateX(-10px);
}

.sidebar:hover .nav-text {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s var(--ease-out-expo) 0.1s;
}

/* Main Content */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: hidden;
    background: radial-gradient(circle at top right, #1a1a2e 0%, var(--bg-dark) 40%);
    position: relative;
    display: flex;
    flex-direction: column;
}

#view-container {
    flex: 1;
    overflow-y: auto;
    width: 100%;
}

/* Top Bar & Search */
.top-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4rem;
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.8), transparent);
}

.search-container {
    position: relative;
    width: 400px;
}

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

#searchInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 12px 12px 12px 45px;
    color: #fff;
    font-family: 'Tajawal', 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s var(--ease-out-expo);
    direction: rtl;
    text-align: right;
}

#searchInput:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--premium-gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    width: 450px;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-content {
    background: #111;
    width: 600px;
    border-radius: 24px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.15);
    position: relative;
    overflow: hidden;
    animation: zoomIn 0.4s var(--ease-out-expo);
}

/* User Profile Modal Specifics */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: 0.3s;
}

.stat-card:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: var(--premium-gold);
    transform: translateY(-5px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0.5rem 0;
    font-family: 'Space Grotesk', sans-serif;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.modal-close:hover {
    background: var(--bg-dark);
    color: var(--premium-gold);
    transform: rotate(90deg);
}

.modal-flex {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.modal-poster {
    width: 200px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.path-box {
    background: rgba(255, 215, 0, 0.05);
    border: 1px dashed var(--premium-gold);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.path-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.path-value {
    color: var(--premium-gold);
    font-family: 'Space Grotesk', monospace;
    font-size: 1.1rem;
    font-weight: 700;
}


/* Hero Section */
.hero {
    height: 80vh;
    /* Taller hero */
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.6);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    transition: transform 10s ease;
    /* Subtle zoom effect */
}

.hero:hover .hero-bg {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 80%),
        linear-gradient(90deg, var(--bg-dark) 10%, transparent 60%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.hero-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 215, 0, 0.1);
    /* Gold tint */
    backdrop-filter: blur(10px);
    border: 1px solid var(--premium-gold);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    color: var(--premium-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: fadeUp 0.8s var(--ease-out-expo);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.hero-title {
    font-size: 5rem;
    /* Larger */
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom, #fff 40%, #b4b4b4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Space Grotesk', sans-serif;
    animation: fadeUp 1s var(--ease-out-expo) 0.1s backwards;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    animation: fadeUp 1s var(--ease-out-expo) 0.2s backwards;
    max-width: 80%;
}

.btn-group {
    display: flex;
    gap: 1.5rem;
    animation: fadeUp 1s var(--ease-out-expo) 0.3s backwards;
}

.btn {
    padding: 14px 36px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

/* Shimmer Effect for Buttons */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--premium-gold), #e6c200);
    color: #000;
    box-shadow: 0 0 20px var(--gold-glow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 40px var(--gold-glow);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-3px);
}

/* Sections */
.section {
    padding: 2rem 4rem;
    animation: slideInUp 0.8s var(--ease-out-expo);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    position: relative;
    padding-left: 1rem;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    height: 100%;
    width: 4px;
    background: var(--premium-gold);
    border-radius: 2px;
    box-shadow: 0 0 15px var(--gold-glow);
}

/* Horizontal Scroll Rails */
.media-rail {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    padding-left: 0.5rem;
    padding-right: 1rem;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    -webkit-overflow-scrolling: touch;
}

.media-rail::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* Library Grid (Movies/Series pages) */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding: 0 0.5rem;
}

/* Cyber Media Card - Exact Reference Visuals */
.media-card {
    width: 180px;
    min-width: 180px;
    height: 270px;
    flex-shrink: 0;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(45deg, #1a1a1a, #262626);
    /* Reference Background */
    border: 2px solid rgba(255, 255, 255, 0.1);
    /* Reference Border */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.2);
    /* Reference Shadow */
    transform-style: preserve-3d;
    margin: 0 auto;
}

/* Background Image - with opacity to blend with the dark card bg */
.media-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    /* Lower opacity to show card texture */
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s;
    z-index: 0;
}

.media-card:hover .media-bg {
    opacity: 0.3;
    /* Fade out image slightly on hover to show details */
}

/* Glowing Elements */
.glowing-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.glow-1,
.glow-2,
.glow-3 {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(0, 255, 170, 0.3) 0%, rgba(0, 255, 170, 0) 70%);
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glow-1 {
    top: -20px;
    left: -20px;
}

.glow-2 {
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
}

.glow-3 {
    bottom: -20px;
    left: 30%;
}

.media-card:hover .glowing-elements div {
    opacity: 1;
}

/* Hover State - Slide Up */
.media-card:hover .media-info {
    transform: translateY(0);
    opacity: 1;
}

.media-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 2px;
    width: 100%;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #00ffaa, #00a2ff);
    /* Reference Gradient */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 255, 170, 0.3));
    text-shadow: 0 0 10px rgba(92, 103, 255, 0.5), 0 0 20px rgba(92, 103, 255, 0.3);
    font-family: 'Space Grotesk', sans-serif;
    text-transform: uppercase;
}

/* 1. Cyber Lines */
.cyber-lines span {
    position: absolute;
    background: linear-gradient(90deg, transparent, var(--primary-neon), transparent);
    z-index: 6;
    opacity: 0.5;
}

.cyber-lines span:nth-child(1) {
    top: 10%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: left;
    transition: 0.5s;
}

.cyber-lines span:nth-child(2) {
    top: 90%;
    right: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: right;
    transition: 0.5s;
}

.cyber-lines span:nth-child(3) {
    left: 10%;
    top: 0;
    height: 100%;
    width: 1px;
    transform: scaleY(0);
    transform-origin: top;
    transition: 0.5s;
}

.cyber-lines span:nth-child(4) {
    right: 10%;
    bottom: 0;
    height: 100%;
    width: 1px;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: 0.5s;
}

.media-card:hover .cyber-lines span {
    transform: scale(1);
    opacity: 1;
}

/* 2. Corner Elements */
.corner-elements span {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--premium-gold);
    transition: all 0.4s ease;
    z-index: 6;
    opacity: 0;
}

.corner-elements span:nth-child(1) {
    top: 15px;
    left: 15px;
    border-right: 0;
    border-bottom: 0;
}

.corner-elements span:nth-child(2) {
    top: 15px;
    right: 15px;
    border-left: 0;
    border-bottom: 0;
}

.corner-elements span:nth-child(3) {
    bottom: 15px;
    left: 15px;
    border-right: 0;
    border-top: 0;
}

.corner-elements span:nth-child(4) {
    bottom: 15px;
    right: 15px;
    border-left: 0;
    border-top: 0;
}

.media-card:hover .corner-elements span {
    opacity: 1;
    border-color: var(--primary-neon);
    box-shadow: 0 0 10px var(--primary-neon);
}

/* 3. Scan Line */
.scan-line {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 255, 0.3), transparent);
    transform: translateY(-100%);
    z-index: 4;
    opacity: 0;
}

.media-card:hover .scan-line {
    animation: scanMove 2s linear infinite;
    opacity: 1;
}

@keyframes scanMove {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* 4. Particles */
.card-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--premium-gold);
    border-radius: 50%;
    opacity: 0;
    z-index: 6;
}

.media-card:hover .card-particles span {
    animation: particleFloat 2s infinite;
}

@keyframes particleFloat {
    0% {
        transform: translate(0, 0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(calc(var(--x, 0) * 40px), calc(var(--y, 0) * 40px));
        opacity: 0;
    }
}

.card-particles span:nth-child(1) {
    --x: 1;
    --y: -1;
    top: 40%;
    left: 20%;
}

.card-particles span:nth-child(2) {
    --x: -1;
    --y: -1;
    top: 60%;
    right: 20%;
    animation-delay: 0.2s;
}

.card-particles span:nth-child(3) {
    --x: 0.5;
    --y: 1;
    top: 20%;
    left: 40%;
    animation-delay: 0.4s;
}

.card-particles span:nth-child(4) {
    --x: -0.5;
    --y: 1;
    top: 80%;
    right: 40%;
    animation-delay: 0.6s;
}

/* Social Card - Exact Reference Implementation */
.social-section .card {
    position: relative;
    width: 200px;
    height: 200px;
    background: lightgrey;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
    transition: all 1s ease-in-out;
    margin: 0 auto;
    border: none;
    /* Reference doesn't have a border like my previous one */
}

.social-section .background {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 107%, #333 0%, #000 30%, #111 60%, #050505 100%);
}

.social-section .logo {
    position: absolute;
    right: 50%;
    bottom: 50%;
    transform: translate(50%, 50%);
    transition: all 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.social-section .logo-svg {
    fill: white;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-section .icon {
    display: inline-block;
    width: 20px;
    height: 20px;
}

.social-section .icon .svg {
    fill: rgba(255, 255, 255, 0.797);
    width: 100%;
    transition: all 0.5s ease-in-out;
}

.social-section .box {
    position: absolute;
    padding: 10px;
    text-align: right;
    background: rgba(255, 255, 255, 0.389);
    border-top: 2px solid rgb(255, 255, 255);
    border-right: 1px solid white;
    border-radius: 10% 13% 42% 0%/10% 12% 75% 0%;
    box-shadow: rgba(100, 100, 111, 0.364) -7px 7px 29px 0px;
    transform-origin: bottom left;
    transition: all 1s ease-in-out;
}

.social-section .box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: all 0.5s ease-in-out;
}

.social-section .box:hover .svg {
    fill: white;
}

.social-section .box1 {
    width: 70%;
    height: 70%;
    bottom: -70%;
    left: -70%;
}

.social-section .box1::before {
    background: radial-gradient(circle at 30% 107%, #888 0%, #333 5%, #111 60%, #000 90%);
}

.social-section .box1:hover::before {
    opacity: 1;
}

.social-section .box1:hover .icon .svg {
    filter: drop-shadow(0 0 5px white);
}

.social-section .box2 {
    width: 50%;
    height: 50%;
    bottom: -50%;
    left: -50%;
    transition-delay: 0.2s;
}

.social-section .box2::before {
    background: radial-gradient(circle at 30% 107%, #666 0%, #000 90%);
}

.social-section .box2:hover::before {
    opacity: 1;
}

.social-section .box2:hover .icon .svg {
    filter: drop-shadow(0 0 5px white);
}

.social-section .box3 {
    width: 30%;
    height: 30%;
    bottom: -30%;
    left: -30%;
    transition-delay: 0.4s;
}

.social-section .box3::before {
    background: radial-gradient(circle at 30% 107%, #444 0%, #000 90%);
}

.social-section .box3:hover::before {
    opacity: 1;
}

.social-section .box3:hover .icon .svg {
    filter: drop-shadow(0 0 5px white);
}

.social-section .box4 {
    width: 10%;
    height: 10%;
    bottom: -10%;
    left: -10%;
    transition-delay: 0.6s;
}

.social-section .card:hover {
    transform: scale(1.1);
}

.social-section .card:hover .box {
    bottom: -1px;
    left: -1px;
}

.social-section .card:hover .logo {
    transform: translate(0, 0);
    bottom: 20px;
    right: 20px;
}

/* Media Card - "Details from Bottom" Enhancement */
.media-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* More substantial background */
    background: linear-gradient(to top, #000 10%, rgba(0, 0, 0, 0.9) 80%, transparent 100%);
    padding: 2rem 1.5rem 1.5rem;
    /* More top padding for fade */
    z-index: 20;
    /* Start further down */
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy enter */
}

/* Hover State - Slide Up */
.media-card:hover .media-info {
    transform: translateY(0);
    opacity: 1;
}

/* Extra Details Text */
.media-brief {
    font-size: 0.85rem;
    color: #ccc;
    margin: 0.5rem 0 1rem;
    /* Ensure visibility */
    opacity: 0;
    transform: translateY(20px);
    transition: 0.5s 0.1s;
}

.media-card:hover .media-brief {
    opacity: 1;
    transform: translateY(0);
}

/* Card Glare Effect */
.card-glare {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.2), transparent 60%);
    opacity: 0;
    transition: 0.3s;
    mix-blend-mode: overlay;
    z-index: 7;
}

.media-card:hover .card-glare {
    opacity: 1;
}



.channel-item {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.3s var(--ease-out-expo);
    margin-bottom: 0.8rem;
    border: 1px solid transparent;
}

.channel-item:hover {
    background: rgba(255, 215, 0, 0.05);
    /* Gold tint on hover */
    transform: translateX(5px);
}

.channel-item.active {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
    border-left: 3px solid var(--premium-gold);
    border-color: rgba(255, 215, 0, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.channel-logo {
    width: 45px;
    height: 45px;
    background: #1a1a1a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
    color: #fff;
}

.player-wrapper {
    background: #000;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: var(--glass-border);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.6);
}

/* --- Advanced Animations --- */

/* Float effect for logo/elements */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Staggered Content Reveal */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Up for entire sections */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom In for modal/focus */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Gold Pulse */
@keyframes goldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* ============================================== */
/* MOBILE RESPONSIVE STYLES                       */
/* ============================================== */

/* Tablet and below */
@media (max-width: 1024px) {
    .top-bar {
        padding: 0 2rem;
    }

    .search-container {
        width: 300px;
    }

    #searchInput:focus {
        width: 350px;
    }

    .section {
        padding: 1.5rem 2rem;
    }

    .hero {
        height: 60vh;
        padding: 2rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .modal-content {
        width: 90%;
        max-width: 550px;
    }
}

/* Mobile phones */
@media (max-width: 768px) {
    body {
        height: auto !important;
        min-height: 100vh !important;
    }

    .app-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    /* Sidebar becomes bottom navigation */
    .sidebar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        top: auto !important;
        width: 100% !important;
        height: 65px !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        padding: 0 !important;
        border-right: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.98) !important;
    }

    .sidebar:hover {
        width: 100%;
    }

    .logo {
        display: none;
    }

    .nav-item {
        flex-direction: column;
        height: auto;
        padding: 0.8rem 0.5rem;
        margin-bottom: 0;
        font-size: 0.7rem;
        justify-content: center;
    }

    .nav-item i {
        font-size: 1.3rem;
        min-width: auto;
        margin-bottom: 0.3rem;
    }

    .nav-text {
        margin-left: 0;
        opacity: 1;
        transform: none;
        font-size: 0.65rem;
    }

    .sidebar:hover .nav-text {
        transform: none;
    }

    .nav-item.active {
        border-left: none;
        border-top: 3px solid var(--premium-gold);
        background: linear-gradient(0deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
    }

    /* Hide spacer div on mobile */
    .sidebar>div[style*="margin-top: auto"] {
        display: none;
    }

    /* Main content adjustments */
    .main-content {
        height: auto;
        min-height: calc(100vh - 70px);
        padding-bottom: 80px;
        /* Space for bottom nav */
    }

    #view-container {
        overflow-y: visible;
    }

    /* Top bar mobile */
    .top-bar {
        height: auto;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        position: relative;
        background: rgba(5, 5, 5, 0.95);
    }

    .search-container {
        width: 100%;
        order: 2;
    }

    #searchInput {
        width: 100%;
        padding: 14px 14px 14px 45px;
    }

    #searchInput:focus {
        width: 100%;
    }

    .user-profile {
        order: 1;
        align-self: flex-end;
    }

    /* Hero mobile */
    .hero {
        height: 50vh;
        min-height: 350px;
        padding: 1.5rem;
        align-items: center;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-desc {
        font-size: 0.9rem;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
    }

    /* Sections mobile */
    .section {
        padding: 1rem;
    }

    .section-header {
        margin-bottom: 1rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    /* Media cards mobile - Force horizontal scroll */
    .media-rail {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important;
        padding: 0 1rem 1rem 0.5rem !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .media-card {
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        height: 195px !important;
        flex-shrink: 0 !important;
        border-radius: 10px !important;
        scroll-snap-align: start !important;
    }

    /* Library Grid - 3 columns on mobile */
    .library-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
        padding: 0.5rem !important;
        margin-top: 1rem !important;
    }

    .library-grid .media-card {
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
        height: auto !important;
        aspect-ratio: 2/3 !important;
    }

    .media-title {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .media-info {
        padding: 0.8rem;
    }

    .media-meta {
        font-size: 0.7rem;
    }

    .card-prompt {
        font-size: 0.6rem;
        padding: 4px 8px;
    }

    /* Modal mobile */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: 16px;
    }

    .modal-flex {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1rem;
    }

    .modal-poster {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .path-box {
        padding: 0.8rem;
    }

    .path-value {
        font-size: 1rem;
        word-break: break-all;
    }

    /* Profile modal mobile */
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    /* IPTV container mobile */
    .iptv-container {
        padding: 1rem !important;
    }

    .channel-item {
        padding: 0.8rem;
    }

    .channel-logo {
        width: 40px;
        height: 40px;
    }

    /* Social card mobile */
    .social-section .card {
        transform: scale(0.8);
        margin: 0 auto;
    }

    /* Disable heavy hover effects on touch */
    .media-card:hover .media-bg {
        opacity: 0.6;
    }

    .media-card:hover .scan-line {
        animation: none;
        opacity: 0;
    }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {

    /* Typography scaling */
    html {
        font-size: 14px;
    }

    /* Hero adjustments */
    .hero {
        height: 45vh;
        min-height: 300px;
        padding: 1rem;
    }

    .hero-title {
        font-size: 1.5rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .hero-desc {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .hero-tag {
        font-size: 0.65rem;
        padding: 4px 10px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .btn i {
        font-size: 0.9rem;
    }

    /* Cards - Horizontal scroll on small phones */
    .media-card {
        width: 120px;
        min-width: 120px;
        height: 180px;
        flex-shrink: 0;
        border-radius: 8px;
        scroll-snap-align: start;
    }

    .media-rail {
        gap: 0.6rem;
        padding: 0 1rem 0.75rem 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .media-title {
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }

    .media-info {
        padding: 0.5rem;
    }

    .media-meta {
        font-size: 0.6rem;
    }

    .media-brief {
        font-size: 0.65rem;
        display: none;
        /* Hide on very small screens */
    }

    .card-prompt {
        font-size: 0.5rem;
        padding: 3px 6px;
    }

    /* Sections */
    .section {
        padding: 0.75rem;
    }

    .section-header {
        margin-bottom: 0.75rem;
        padding: 0 0.25rem !important;
    }

    .section-title {
        font-size: 1rem;
    }

    /* Navigation */
    .sidebar {
        height: 60px;
    }

    .nav-item {
        padding: 0.5rem 0.25rem;
        min-width: 50px;
    }

    .nav-item i {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }

    .nav-text {
        font-size: 0.5rem;
        white-space: nowrap;
    }

    /* Top bar */
    .top-bar {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    /* Search */
    #searchInput {
        font-size: 16px;
        /* Prevents iOS zoom */
        padding: 12px 12px 12px 40px;
        border-radius: 12px;
    }

    .search-icon {
        left: 12px;
        font-size: 0.9rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 320px;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-flex {
        padding: 1rem;
        gap: 0.75rem;
    }

    .modal-poster {
        max-width: 150px;
        border-radius: 8px;
    }

    .modal-flex h2 {
        font-size: 1.3rem !important;
    }

    .modal-flex p {
        font-size: 0.75rem;
        margin-bottom: 1rem !important;
    }

    .path-box {
        padding: 0.6rem;
        border-radius: 8px;
    }

    .path-label {
        font-size: 0.6rem;
    }

    .path-value {
        font-size: 0.9rem;
    }

    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    /* User profile */
    .user-profile {
        font-size: 0.75rem;
    }

    .user-profile .avatar {
        width: 32px;
        height: 32px;
    }

    /* IPTV */
    .channel-item {
        padding: 0.6rem;
    }

    .channel-logo {
        width: 35px;
        height: 35px;
    }

    .channel-name {
        font-size: 0.85rem;
    }

    /* Social section */
    .social-section .card {
        transform: scale(0.65);
    }

    .social-section .section-title {
        font-size: 1.2rem !important;
    }
}

/* Very small phones (< 360px) */
@media (max-width: 360px) {
    html {
        font-size: 13px;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .media-card {
        min-width: 110px;
        width: calc(50vw - 1.25rem);
    }

    .nav-item {
        min-width: 45px;
        padding: 0.4rem 0.2rem;
    }

    .nav-text {
        font-size: 0.45rem;
    }

    .modal-content {
        width: 98%;
        max-width: 280px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* Medium phones (481px - 600px) */
@media (min-width: 481px) and (max-width: 600px) {
    .media-card {
        width: 150px;
        min-width: 150px;
        height: 225px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .modal-content {
        max-width: 380px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Disable heavy hover effects on touch devices */
    .media-card:hover .media-bg {
        opacity: 0.6;
        transform: none;
    }

    .media-card:hover .cyber-lines span,
    .media-card:hover .corner-elements span,
    .media-card:hover .scan-line,
    .media-card:hover .card-particles span {
        opacity: 0;
        animation: none;
        transform: scale(0);
    }

    /* Better touch feedback */
    .media-card {
        -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
        cursor: pointer;
    }

    .media-card:active {
        transform: scale(0.98);
    }

    /* Larger tap targets */
    .nav-item {
        min-height: 50px;
    }

    .btn {
        min-height: 44px;
    }

    /* Smooth scrolling for rails */
    .media-rail {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .media-card {
        scroll-snap-align: start;
    }
}

/* Landscape mode on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 70vh;
        min-height: 250px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .sidebar {
        height: 50px;
    }

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

    .nav-text {
        display: none;
    }
}

/* Safe area insets for modern phones (notch, home bar) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 768px) {
        .sidebar {
            padding-bottom: env(safe-area-inset-bottom);
            height: calc(60px + env(safe-area-inset-bottom));
        }

        .main-content {
            padding-bottom: calc(70px + env(safe-area-inset-bottom));
        }
    }
}