/* --------------------------------------------------
   GALAXY WEB PLAYER - STYLE SHEET
   DESIGN SYSTEM, RESPONSIVE LAYOUTS & NEBULA EFFECTS
   -------------------------------------------------- */

:root {
    --bg-color: #04020b;
    --card-bg: rgba(15, 12, 38, 0.65);
    --sidebar-bg: #09061c;
    
    /* Cosmic Palette */
    --primary-color: #7a31f4;       /* Deep Nebula Violet */
    --primary-glow: rgba(122, 49, 244, 0.4);
    
    --accent-cyan: #00f0ff;         /* Star Light Teal */
    --accent-glow: rgba(0, 240, 255, 0.4);
    
    --accent-gold: #ffd700;         /* Cosmic Dust Gold */
    --danger-color: #ff3366;        /* Red Giant */
    --success-color: #00ff66;       /* Supernova Green */
    
    /* Text Colors */
    --text-main: #ffffff;
    --text-muted: #9f9bbf;
    --text-dark: #121214;
    
    /* Borders & Glassmorphism */
    --border-color: rgba(122, 49, 244, 0.25);
    --border-glow: rgba(0, 240, 255, 0.45);
    --glass-blur: blur(14px);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Layout Dimensions */
    --sidebar-width: 260px;
}

/* Reset & Base Settings */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', 'Cairo', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(4, 2, 11, 0.5);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: 0.5px;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Cosmic Background & Nebula Effect */
.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #0c0828 0%, var(--bg-color) 100%);
}

.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    animation: pulseNebula 12s infinite alternate ease-in-out;
}

.nebula-1 {
    width: 400px;
    height: 400px;
    background: #4f17a8;
    top: -10%;
    left: -10%;
}

.nebula-2 {
    width: 500px;
    height: 500px;
    background: #0d638c;
    bottom: -15%;
    right: -10%;
    animation-delay: 3s;
}

.nebula-3 {
    width: 350px;
    height: 350px;
    background: #731238;
    top: 30%;
    left: 40%;
    animation-delay: 6s;
}

@keyframes pulseNebula {
    0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
    100% { transform: scale(1.2) translate(30px, 40px); opacity: 0.55; }
}

/* Glowing Text Effect */
.glow-text {
    text-shadow: 0 0 10px var(--primary-glow), 0 0 20px rgba(0, 240, 255, 0.2);
}

/* Input Styles */
.form-group {
    margin-bottom: 22px;
    width: 100%;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px 14px 45px;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

select.form-control {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239f9bbf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 45px;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-glow);
    background: rgba(255, 255, 255, 0.08);
}

.form-control:focus + .input-icon {
    color: var(--accent-cyan);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
    gap: 10px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    color: var(--text-main);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(122, 49, 244, 0.5);
}

.btn-glow {
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-glow:hover {
    box-shadow: 0 0 25px rgba(122, 49, 244, 0.8), 0 0 10px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-cyan);
}

.btn-icon-right {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.btn:hover .btn-icon-right {
    transform: translateX(4px);
}

.btn-back {
    position: absolute;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-back:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.badge.active {
    background: rgba(0, 255, 102, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(0, 255, 102, 0.25);
}

/* Error Banner */
.error-banner {
    background: rgba(255, 51, 102, 0.15);
    border: 1px solid var(--danger-color);
    color: #ff668a;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    width: 100%;
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* Global Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 2, 11, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-box {
    text-align: center;
}

.stellar-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--accent-cyan);
    border-bottom-color: var(--primary-color);
    border-radius: 50%;
    animation: spinStellar 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

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

.spinner-text {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    background: linear-gradient(135deg, white 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ==================== 1. LANDING/CODE VIEW ==================== */
.view-section {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.view-section.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.code-card, .login-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
}

.galaxy-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-cyan) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 25px var(--primary-glow);
}

.galaxy-logo i {
    font-size: 2.2rem;
    color: white;
    animation: rotateLogo 8s linear infinite;
}

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

.logo-area h1 {
    font-size: 2.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 2px;
}

.logo-area .subtitle {
    font-size: 0.8rem;
    letter-spacing: 6px;
    font-weight: 700;
    text-indent: 6px;
    margin-top: 5px;
    text-transform: uppercase;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-main);
}

/* ==================== 2. LOGIN VIEW ==================== */
.server-brand {
    text-align: center;
    margin-bottom: 30px;
    width: 100%;
}

.server-icon-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.server-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.server-brand h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.server-socials {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid rgba(122, 49, 244, 0.15);
    padding-top: 20px;
    width: 100%;
}

.server-socials p {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.social-icon:hover {
    transform: scale(1.15) translateY(-3px);
}

.social-icon.tg { background: #0088cc; box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3); }
.social-icon.fb { background: #1877f2; box-shadow: 0 4px 10px rgba(24, 119, 242, 0.3); }
.social-icon.wa { background: #25d366; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3); }

/* ==================== 3. APP DASHBOARD VIEW ==================== */
#app-view.view-section.active {
    display: flex;
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
}

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: var(--transition-normal);
}

.sidebar-header {
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-cyan) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.sidebar-logo i {
    font-size: 1.3rem;
    color: white;
}

.sidebar-title h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.sidebar-title span {
    font-size: 0.75rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 30px 15px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.nav-item i {
    font-size: 1.15rem;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(122, 49, 244, 0.25) 0%, rgba(122, 49, 244, 0.02) 100%);
    border-left: 3px solid var(--primary-color);
    color: white;
}

.nav-item.active i {
    color: var(--accent-cyan);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-lang-toggle, .btn-logout {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.btn-lang-toggle:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.05);
}

.btn-logout:hover {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: rgba(255, 51, 102, 0.05);
}

/* Main Viewport Content */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    height: 100vh;
    padding: 40px;
    position: relative;
    background: linear-gradient(180deg, rgba(13, 8, 38, 0.2) 0%, var(--bg-color) 100%);
}

.section-container {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section-container.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.section-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Search bar styling */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.search-bar input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px 10px 38px;
    color: white;
    font-size: 0.9rem;
    width: 250px;
    transition: var(--transition-fast);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    width: 320px;
}

/* Dropdown Filters */
.dropdown-filter {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    min-width: 180px;
}

.dropdown-filter:focus {
    border-color: var(--accent-cyan);
}

/* Card layout panels */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ==================== A. HOME VIEW ==================== */
.hero-banner {
    height: 250px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1b0a3c 0%, #050414 100%);
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid rgba(122, 49, 244, 0.2);
    display: flex;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(4,2,11,0.85) 0%, rgba(4,2,11,0.2) 100%);
    z-index: 1;
}

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

.hero-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #fff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 8px 25px rgba(0, 240, 255, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
}

.stat-card.live .stat-icon { background: rgba(122, 49, 244, 0.2); color: var(--primary-color); border: 1px solid rgba(122, 49, 244, 0.3); }
.stat-card.movies .stat-icon { background: rgba(0, 240, 255, 0.2); color: var(--accent-cyan); border: 1px solid rgba(0, 240, 255, 0.3); }
.stat-card.series .stat-icon { background: rgba(255, 215, 0, 0.2); color: var(--accent-gold); border: 1px solid rgba(255, 215, 0, 0.3); }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
}

.stat-info p {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Dashboard Panel Layouts */
.row-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (min-width: 900px) {
    .row-panels {
        grid-template-columns: 2fr 1fr;
    }
}

.flex-grow-1 { flex: 1; }
.flex-grow-2 { flex: 2; }

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 12px;
}

.panel-title i {
    color: var(--accent-cyan);
}

.horizontal-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    min-height: 120px;
    align-items: center;
}

.horizontal-list .no-data, .no-data {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    width: 100%;
}

/* Account Info box */
.account-compact-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
}

.info-row .label {
    color: var(--text-muted);
    font-weight: 500;
}

.info-row .val {
    font-weight: 700;
    color: white;
}

/* ==================== B. LIVE TV VIEW (SPLIT LAYOUT) ==================== */
.split-layout {
    display: grid;
    grid-template-columns: 260px 1fr 320px;
    gap: 20px;
    height: calc(100vh - 120px);
    overflow: hidden;
}

/* Category Sidebar */
.category-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-search {
    position: relative;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.sidebar-search i {
    position: absolute;
    left: 28px;
    color: var(--text-muted);
}

.sidebar-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px 8px 36px;
    color: white;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.sidebar-search input:focus {
    border-color: var(--accent-cyan);
}

.category-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 10px 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.category-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.03);
}

.category-item.active {
    color: var(--accent-cyan);
    background: rgba(122, 49, 244, 0.08);
    border-left-color: var(--primary-color);
}

.category-count {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--text-muted);
}

.category-item.active .category-count {
    background: rgba(0, 240, 255, 0.15);
    color: var(--accent-cyan);
}

/* Items List Pane */
.items-list-pane {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pane-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-search.compact {
    padding: 0;
    border-bottom: none;
    width: 200px;
}

.sidebar-search.compact i {
    left: 12px;
}

.sidebar-search.compact input {
    padding: 6px 10px 6px 32px;
}

.channels-grid {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    align-content: start;
}

/* Channel Card */
.channel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 130px;
    justify-content: space-between;
    position: relative;
}

.channel-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-cyan);
    background: rgba(122, 49, 244, 0.06);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.1);
}

.channel-logo-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.channel-logo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Channel Favorite heart button overlay */
.btn-fav-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.btn-fav-overlay:hover {
    color: var(--danger-color);
    transform: scale(1.2);
}

.btn-fav-overlay.is-fav {
    color: var(--danger-color);
}

/* Player Mini Window Pane */
.mini-player-pane {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.95rem;
    font-weight: 600;
}

.player-container-header span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.btn-theater {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.btn-theater:hover {
    color: var(--accent-cyan);
}

.player-box {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.html5-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #060515;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 15px;
    z-index: 5;
    text-align: center;
    padding: 20px;
}

.player-placeholder i {
    font-size: 3rem;
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--primary-glow);
    cursor: pointer;
    transition: var(--transition-fast);
}

.player-placeholder i:hover {
    transform: scale(1.1);
    color: var(--accent-cyan);
}

/* Custom Controls Overlay styling */
.player-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    z-index: 10;
}

.player-box:hover .player-controls-overlay,
.fullscreen-player-container:hover .player-controls-overlay {
    opacity: 1;
}

.controls-top {
    display: flex;
    justify-content: flex-start;
}

.stream-badge {
    background: var(--danger-color);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.controls-bottom {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.ctrl-btn:hover {
    color: var(--accent-cyan);
    transform: scale(1.1);
}

.ctrl-btn.right {
    margin-left: auto;
}

.volume-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-container input[type="range"] {
    width: 60px;
    accent-color: var(--accent-cyan);
    height: 4px;
    cursor: pointer;
}

.time-display {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.time-display.live-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.live-indicator-dot {
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
    display: inline-block;
    animation: blinkIndicator 1s infinite alternate;
}

@keyframes blinkIndicator {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* ==================== C/D. CARDS GRID (MOVIES/SERIES) ==================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 25px;
}

/* Media Card */
.media-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    aspect-ratio: 2/3;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.media-card:hover {
    transform: scale(1.04) translateY(-5px);
    border-color: var(--accent-cyan);
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.2);
}

.media-poster-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.media-poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.media-card:hover img {
    transform: scale(1.05);
}

.media-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(0deg, rgba(4, 2, 11, 0.95) 0%, rgba(4, 2, 11, 0.6) 70%, rgba(4, 2, 11, 0) 100%);
    padding: 15px 12px;
    z-index: 2;
}

.media-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.media-rating {
    color: var(--accent-gold);
    font-weight: 700;
}

.media-rating i {
    margin-right: 3px;
}

/* Heart Favorite Ribbon */
.media-fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(4, 2, 11, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    z-index: 5;
    cursor: pointer;
    transition: var(--transition-fast);
}

.media-fav-btn:hover {
    color: var(--danger-color);
    background: rgba(4, 2, 11, 0.9);
}

.media-fav-btn.is-fav {
    color: var(--danger-color);
    background: rgba(4, 2, 11, 0.9);
    border-color: var(--danger-color);
}

/* ==================== E. FAVORITES VIEW ==================== */
.fav-tabs {
    display: flex;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: white;
}

.tab-btn.active {
    color: var(--accent-cyan);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.fav-tab-content {
    display: none;
}

.fav-tab-content.active {
    display: block;
}

/* ==================== F. HISTORY VIEW ==================== */
.history-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: var(--transition-fast);
}

.history-item:hover {
    border-color: var(--accent-cyan);
}

.history-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-icon-box {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: rgba(122,49,244,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 1.2rem;
}

.history-info .title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.history-info .type-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.history-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==================== G. PROFILE VIEW ==================== */
.profile-card {
    max-width: 800px;
}

.profile-header-area {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 35px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-cyan) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.profile-user-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
}

@media (min-width: 600px) {
    .profile-details-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.profile-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 15px;
    border-radius: 10px;
}

.profile-item .lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.profile-item .val {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
}

/* ==================== MODALS COMMON ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 2, 11, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalBgFade 0.3s ease;
}

@keyframes modalBgFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    display: flex;
    animation: modalScaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleUp {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    z-index: 100;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: rotate(90deg);
}

.modal-backdrop-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.25);
    z-index: 1;
    opacity: 0.6;
}

.modal-body-content {
    position: relative;
    z-index: 2;
    display: flex;
    padding: 35px;
    gap: 30px;
    width: 100%;
}

.modal-body-content.column {
    flex-direction: column;
    padding-bottom: 25px;
}

.modal-poster {
    width: 200px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.modal-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-details h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.meta-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    align-items: center;
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-item.rating {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.modal-plot {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
}

.cast-row {
    margin-bottom: 25px;
    font-size: 0.9rem;
}

.cast-row .lbl {
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 5px;
}

.cast-row .val {
    color: white;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

/* ==================== II. TV SERIES MODAL SPECIFICS ==================== */
.series-top-info {
    display: flex;
    gap: 30px;
}

.modal-poster.compact {
    width: 150px;
}

.season-selector-wrapper {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.season-selector-wrapper label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.series-episodes-area {
    margin-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
}

.series-episodes-area h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.episodes-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

@media (min-width: 600px) {
    .episodes-list-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.episode-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 15px;
}

.episode-item:hover {
    background: rgba(122, 49, 244, 0.08);
    border-color: var(--primary-color);
}

.episode-title {
    font-size: 0.88rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-play-icon {
    color: var(--accent-cyan);
    font-size: 1.1rem;
}

/* ==================== III. FULLSCREEN PLAYER MODAL ==================== */
.modal-overlay.player-fullscreen {
    background: #000;
    padding: 0;
}

.fullscreen-player-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.html5-video-fullscreen {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btn-player-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 100;
    transition: var(--transition-fast);
}

.btn-player-close:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    transform: scale(1.1);
}

/* Timeline/Progress Bar */
.controls-center {
    width: 100%;
    margin-bottom: 15px;
}

.controls-center input[type="range"] {
    width: 100%;
    accent-color: var(--accent-cyan);
    height: 6px;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.speed-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

/* ==================== THEATER MODE IN LIVE TV ==================== */
.split-layout.theater-mode {
    grid-template-columns: 0px 1fr 0px;
    gap: 0;
}

.split-layout.theater-mode .category-sidebar,
.split-layout.theater-mode .items-list-pane {
    display: none;
}

.split-layout.theater-mode .mini-player-pane {
    padding: 0;
    border: none;
    border-radius: 0;
    background: black;
}

.split-layout.theater-mode .player-box {
    aspect-ratio: unset;
    height: 100%;
    border: none;
    border-radius: 0;
}

/* ==================== ARABIC RTL COMPATIBILITY ==================== */
html[dir="rtl"] {
    /* Direction changes */
    text-align: right;
}

html[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .nav-item.active {
    border-left: none;
    border-right: 3px solid var(--primary-color);
    background: linear-gradient(270deg, rgba(122, 49, 244, 0.25) 0%, rgba(122, 49, 244, 0.02) 100%);
}

html[dir="rtl"] .form-control {
    padding: 14px 45px 14px 16px;
}

html[dir="rtl"] .input-icon {
    left: auto;
    right: 16px;
}

html[dir="rtl"] select.form-control {
    background-position: left 16px center;
    padding-left: 45px;
    padding-right: 16px;
}

html[dir="rtl"] .btn-icon-right {
    transform: rotate(180deg);
}

html[dir="rtl"] .btn:hover .btn-icon-right {
    transform: rotate(180deg) translateX(4px);
}

html[dir="rtl"] .btn-back {
    left: auto;
    right: 25px;
}

html[dir="rtl"] .search-bar i {
    left: auto;
    right: 14px;
}

html[dir="rtl"] .search-bar input {
    padding: 10px 38px 10px 14px;
}

html[dir="rtl"] .btn-fav-overlay {
    right: auto;
    left: 8px;
}

html[dir="rtl"] .category-item {
    border-left: none;
    border-right: 3px solid transparent;
}

html[dir="rtl"] .category-item.active {
    border-right-color: var(--primary-color);
}

html[dir="rtl"] .sidebar-search i {
    left: auto;
    right: 28px;
}

html[dir="rtl"] .sidebar-search input {
    padding: 8px 36px 8px 10px;
}

html[dir="rtl"] .sidebar-search.compact i {
    right: 12px;
}

html[dir="rtl"] .sidebar-search.compact input {
    padding: 6px 32px 6px 10px;
}

html[dir="rtl"] .ctrl-btn.right {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .media-fav-btn {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .modal-close {
    right: auto;
    left: 20px;
}

html[dir="rtl"] .btn-player-close {
    right: auto;
    left: 20px;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .split-layout {
        grid-template-columns: 200px 1fr;
        height: auto;
        overflow: visible;
    }
    
    .mini-player-pane {
        grid-column: 1 / -1;
        order: -1;
    }
}

@media (max-width: 768px) {
    #app-view.view-section.active {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: auto;
    }
    
    .sidebar-header {
        padding: 15px 20px;
    }
    
    .sidebar-nav {
        padding: 10px;
    }
    
    .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        padding-bottom: 5px;
        gap: 10px;
    }
    
    .sidebar-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .nav-item {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
    
    .nav-item.active {
        border-left: none;
        border-right: none;
        border-bottom: 3px solid var(--primary-color);
        background: rgba(122, 49, 244, 0.1);
    }
    
    html[dir="rtl"] .nav-item.active {
        border-right: none;
        border-bottom: 3px solid var(--primary-color);
    }
    
    .sidebar-footer {
        flex-direction: row;
        padding: 10px 20px;
    }
    
    .btn-lang-toggle, .btn-logout {
        flex: 1;
        padding: 8px;
    }
    
    .main-content {
        padding: 20px;
        height: auto;
    }
    
    .split-layout {
        grid-template-columns: 1fr;
    }
    
    .category-sidebar {
        max-height: 200px;
    }
    
    .modal-card {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-body-content {
        flex-direction: column;
        align-items: center;
        padding: 20px;
    }
    
    .series-top-info {
        flex-direction: column;
        align-items: center;
    }
}
