/* =========================================================================
   STREAMBOX IPTV WEB PLAYER CSS
   Theme variables, glassmorphic UI rules, and responsive split layouts.
   ========================================================================= */

/* --- 1. Global Reset & Theme Root Configurations --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .brand-name, .logo-title, .page-title, .section-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Theme variables matching Android app palettes */
:root {
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Global glow / shadow tokens */
    --glow-shadow-classic: 0 0 15px rgba(230, 46, 47, 0.2);
    --glow-shadow-dark: 0 0 15px rgba(255, 202, 40, 0.2);
    --glow-shadow-blue: 0 0 15px rgba(33, 150, 243, 0.2);
    --glow-shadow-grey: 0 0 15px rgba(103, 58, 183, 0.2);
}

/* Classic Red Theme */
body.theme-classic {
    --primary-color: #E62E2F;
    --primary-color-sub: rgba(230, 46, 47, 0.15);
    --bg-color: #000000;
    --bg-color-sub: #121212;
    --card-bg: rgba(18, 18, 18, 0.65);
    --card-bg-hover: rgba(230, 46, 47, 0.08);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(230, 46, 47, 0.35);
    --text-color: #F3F3F3;
    --text-color-sub: #A0A0A0;
    --glow-shadow: var(--glow-shadow-classic);
    --grad-start: #E62E2F;
    --grad-end: #8b0000;
}

/* Gold Yellow Theme */
body.theme-dark {
    --primary-color: #FFCA28;
    --primary-color-sub: rgba(255, 202, 40, 0.15);
    --bg-color: #000000;
    --bg-color-sub: #121212;
    --card-bg: rgba(18, 18, 18, 0.65);
    --card-bg-hover: rgba(255, 202, 40, 0.08);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(255, 202, 40, 0.35);
    --text-color: #E2E8F0;
    --text-color-sub: #94A3B8;
    --glow-shadow: var(--glow-shadow-dark);
    --grad-start: #FFCA28;
    --grad-end: #d4a017;
}

/* Dark Blue Theme */
body.theme-blue {
    --primary-color: #2196F3;
    --primary-color-sub: rgba(33, 150, 243, 0.15);
    --bg-color: #0E1621;
    --bg-color-sub: #17212B;
    --card-bg: rgba(23, 33, 43, 0.65);
    --card-bg-hover: rgba(33, 150, 243, 0.08);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(33, 150, 243, 0.35);
    --text-color: #F5F5F5;
    --text-color-sub: #8B9BB4;
    --glow-shadow: var(--glow-shadow-blue);
    --grad-start: #2196F3;
    --grad-end: #0c5a9c;
}

/* Purple Grey Theme */
body.theme-grey {
    --primary-color: #673AB7;
    --primary-color-sub: rgba(103, 58, 183, 0.15);
    --bg-color: #121212;
    --bg-color-sub: #1E1E1E;
    --card-bg: rgba(30, 30, 30, 0.65);
    --card-bg-hover: rgba(103, 58, 183, 0.08);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-active: rgba(103, 58, 183, 0.35);
    --text-color: #E2E8F0;
    --text-color-sub: #94A3B8;
    --glow-shadow: var(--glow-shadow-grey);
    --grad-start: #673AB7;
    --grad-end: #4b2c80;
}

/* --- 2. Scrollbar Customizations --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* --- 3. Base Elements & Utilities --- */
a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    font-size: inherit;
    color: inherit;
}

.hidden {
    display: none !important;
}

/* Base layout for screens */
.app-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: none;
    background-color: var(--bg-color);
}

.app-screen.active {
    display: flex;
}

/* Animation utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.anim-fade-up {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* --- 4. Premium Glassmorphic Cards --- */
.glass-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    border-color: var(--border-color-active);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), var(--glow-shadow);
}

/* Form Styles */
.token-card, .login-card, .maintenance-card {
    width: 100%;
    max-width: 480px;
    padding: 40px;
}

.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-image {
    width: 80px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 12px;
}

.brand-title {
    font-size: 28px;
    color: var(--text-color);
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--text-color-sub);
    line-height: 1.5;
}

.premium-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-color-sub);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.premium-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    outline: none;
    transition: all var(--transition-fast);
}

.premium-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-sub);
}

.premium-input:focus + .input-icon {
    color: var(--primary-color);
}

/* Premium Select Dropdown */
select.premium-input {
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

/* Custom dropdown arrow marker */
#xui-dns-container, #stream-dns-container {
    position: relative;
}

#xui-dns-container::after, #stream-dns-container::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-top-color: var(--text-color-sub);
    pointer-events: none;
}

.error-msg {
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(230, 46, 47, 0.15);
    border: 1px solid rgba(230, 46, 47, 0.3);
    color: #ff6e6e;
    font-size: 13px;
    font-weight: 500;
}

.btn-premium {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-normal);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), var(--glow-shadow);
    filter: brightness(1.1);
}

.btn-premium:active {
    transform: translateY(0);
}

.btn-premium svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn-premium:hover svg {
    transform: translateX(4px);
}

.card-footer {
    margin-top: 30px;
    text-align: center;
}

.copyright-text {
    font-size: 12px;
    color: var(--text-color-sub);
    opacity: 0.8;
}

/* Tabs for login methods */
.login-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: none;
}

.login-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-color);
    border-color: var(--text-color-sub);
}

.tab-btn.active {
    background: var(--primary-color-sub);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--glow-shadow);
}

/* --- 5. Splash Screen --- */
#screen-splash {
    display: none;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-color);
    z-index: 100;
}

#screen-splash.active {
    display: flex;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 320px;
    width: 100%;
}

.splash-logo {
    width: 100px;
    height: auto;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.splash-title {
    font-size: 32px;
    margin-bottom: 8px;
}

.splash-status {
    font-size: 13px;
    color: var(--text-color-sub);
    margin-bottom: 24px;
    animation: pulse 1.5s infinite;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--grad-end));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.splash-version {
    font-size: 11px;
    color: var(--text-color-sub);
    opacity: 0.6;
    letter-spacing: 1px;
}

/* --- 6. Maintenance Screen --- */
.maintenance-icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* --- 7. Main Dashboard Shell --- */
#screen-dashboard {
    display: none;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    background: var(--bg-color);
}

#screen-dashboard.active {
    display: flex;
}

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

.sidebar-brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand img {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: contain;
}

.brand-name {
    font-size: 18px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-color-sub);
    font-size: 14.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.menu-item:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.02);
}

.menu-item.active {
    color: var(--text-color);
    background: var(--primary-color-sub);
    font-weight: 600;
}

.menu-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.menu-item:hover .menu-icon {
    transform: scale(1.1);
}

.menu-item.active .menu-icon {
    color: var(--primary-color);
}

.menu-label-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.badge {
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 20px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.user-status-card {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.status-title {
    font-size: 11px;
    color: var(--text-color-sub);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.status-val {
    font-size: 13px;
    font-weight: 700;
}

.text-green {
    color: #4CAF50;
}
.text-red {
    color: #E62E2F;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(230, 46, 47, 0.08);
    color: #ff4d4d;
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: #E62E2F;
    color: #ffffff;
}

/* Main Workspace panel */
.workspace {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

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

.page-title {
    font-size: 24px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-color-sub);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 13.5px;
    color: var(--text-color);
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: var(--glow-shadow);
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-color);
    border-color: var(--text-color-sub);
    transform: rotate(30deg);
}

.btn-hamburger {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

/* App pages containers */
.app-page {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
    display: none;
    height: calc(100vh - 80px);
}

.app-page.active {
    display: block;
}

/* --- 8. Home/Dashboard page styling --- */
.hero-slider-section {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 280px;
    margin-bottom: 32px;
    background: var(--bg-color-sub);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-slideshow {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 10%, rgba(0, 0, 0, 0.3) 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
    margin-bottom: 12px;
}

.hero-title {
    font-size: 32px;
    color: #fff;
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 14px;
    color: #ccc;
    max-width: 600px;
}

.dashboard-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 18px;
    color: var(--text-color);
    margin-bottom: 18px;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

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

.info-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
}

.card-icon {
    width: 40px;
    height: 40px;
    stroke-width: 2px;
}

.card-info {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 12.5px;
    color: var(--text-color-sub);
}

.card-val {
    font-size: 20px;
    font-weight: 700;
}

.media-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* --- 9. IPTV Split Layout (Live TV, Movies, Series) --- */
.iptv-layout {
    display: flex;
    height: 100%;
    margin: -32px;
    overflow: hidden;
}

.iptv-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-color-sub);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-search {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    outline: none;
    font-size: 13px;
}

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

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

.category-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 16px;
    border-radius: 8px;
    text-align: left;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.category-btn:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.02);
}

.category-btn.active {
    color: var(--text-color);
    background: var(--primary-color-sub);
    font-weight: 600;
}

.iptv-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Live TV Split Panel Configuration */
.live-tv-split {
    flex-direction: row !important;
}

.channels-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    width: 50%;
}

.channels-filter-bar {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
}

.btn-filter svg {
    width: 14px;
    height: 14px;
}

.btn-filter.active {
    background: rgba(255, 202, 40, 0.1);
    color: #FFCA28;
    border-color: #FFCA28;
}

.sub-search {
    flex-grow: 1;
    padding: 8px 14px;
    border-radius: 30px;
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    outline: none;
    font-size: 13px;
}

.sub-search:focus {
    border-color: var(--primary-color);
}

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

.live-channel-card {
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.live-channel-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
}

.live-channel-card.active {
    border-color: var(--primary-color);
    background: var(--primary-color-sub);
}

.ch-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.ch-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.card-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    color: var(--text-color-sub);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}

.live-channel-card:hover .card-fav-btn {
    opacity: 1;
}

.card-fav-btn:hover {
    color: #FFCA28;
}

.card-fav-btn.is-fav {
    opacity: 1;
    color: #FFCA28;
}

.card-fav-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5px;
}

/* Embed Player Panel */
.live-player-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-color-sub);
    height: 100%;
}

.player-wrapper {
    width: 100%;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.player-aspect-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.main-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.player-overlay-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: var(--text-color-sub);
}

.player-overlay-message svg {
    width: 48px;
    height: 48px;
}

.channel-info-card {
    flex-grow: 1;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.info-ch-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: contain;
    background: var(--bg-color-sub);
}

.ch-meta h4 {
    font-size: 16px;
    color: var(--text-color);
}

.ch-meta p {
    font-size: 13px;
    color: var(--text-color-sub);
}

.btn-favorite-icon {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
}

.btn-favorite-icon:hover {
    color: #FFCA28;
    border-color: #FFCA28;
}

.btn-favorite-icon.active {
    background: rgba(255, 202, 40, 0.1);
    color: #FFCA28;
    border-color: #FFCA28;
}

.epg-info {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.epg-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.epg-now {
    display: flex;
    align-items: center;
    gap: 10px;
}

.epg-time {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.epg-text {
    font-size: 13px;
    color: var(--text-color-sub);
}

/* --- 10. VOD Content Filters & Grids (Movies & Series) --- */
.media-filter-bar {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    align-items: center;
}

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

.media-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poster-wrapper {
    position: relative;
    width: 100%;
    padding-top: 145%; /* Film poster ratio */
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.media-card:hover .poster-wrapper {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--glow-shadow);
}

.poster-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #FFCA28;
}

.rating-badge svg {
    width: 11px;
    height: 11px;
    fill: #FFCA28;
}

.media-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 11. Modal Detail Layouts (VOD synopsis info) --- */
.app-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    z-index: 10;
}

.border-glow {
    border-color: var(--border-color-active) !important;
    box-shadow: 0 0 30px rgba(0,0,0,0.5), var(--glow-shadow) !important;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--primary-color);
}

.modal-body-layout {
    display: flex;
    gap: 30px;
}

.modal-body-layout.flex-col {
    flex-direction: column;
}

.modal-poster {
    width: 220px;
    height: 320px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

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

.info-title {
    font-size: 28px;
    margin-bottom: 8px;
    color: #fff;
}

.info-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.meta-item {
    font-size: 13px;
    color: var(--text-color-sub);
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item svg {
    width: 14px;
    height: 14px;
}

.meta-pill {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.info-desc {
    font-size: 14px;
    color: var(--text-color-sub);
    line-height: 1.6;
    margin-bottom: 24px;
}

.play-action-row {
    display: flex;
    gap: 16px;
}

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 30px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-shadow);
    filter: brightness(1.1);
}

/* Series Episode layouts */
.series-modal {
    max-width: 900px;
}

.series-header-layout {
    display: flex;
    gap: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.series-body-scroll {
    max-height: 40vh;
    overflow-y: auto;
    padding-right: 10px;
}

.seasons-select-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.episode-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}

.episode-card:hover {
    border-color: var(--primary-color);
    background: var(--card-bg-hover);
}

.episode-thumb-container {
    width: 80px;
    height: 50px;
    background: #000;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.episode-thumb-container svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.ep-meta {
    overflow: hidden;
}

.ep-number {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
}

.ep-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 12. Fullscreen Video Player layer --- */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.player-controls-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

/* Show controls on hover or activity */
.video-overlay:hover .player-controls-container,
.video-overlay.show-controls .player-controls-container {
    opacity: 1;
}

.player-header-bar {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-player-control {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    transition: all var(--transition-fast);
}

.btn-player-control:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.btn-player-control svg {
    width: 20px;
    height: 20px;
}

.player-title-info h2 {
    font-size: 20px;
    color: #fff;
}

.player-title-info p {
    font-size: 13px;
    color: #bbb;
}

.player-bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-progress-area {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.player-time {
    font-size: 13px;
    color: #ffffff;
    font-family: monospace;
}

.player-slider-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.player-slider-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
}

.player-slider-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    left: 0%;
    transition: transform var(--transition-fast);
}

.player-slider-track:hover .player-slider-thumb {
    transform: translate(-50%, -50%) scale(1.3);
}

.player-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.volume-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-volume-track {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
}

.player-volume-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 10px;
    width: 100%;
}

.player-loader {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

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

/* --- 13. Notifications UI --- */
.notifications-layout {
    max-width: 800px;
    margin: 0 auto;
}

.notif-card {
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition-fast);
}

.notif-card:hover {
    border-color: var(--primary-color-sub);
}

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

.notif-title {
    font-size: 16px;
    color: var(--text-color);
}

.notif-date {
    font-size: 12px;
    color: var(--text-color-sub);
}

.notif-desc {
    font-size: 14px;
    color: var(--text-color-sub);
    line-height: 1.5;
}

/* --- 14. Settings Page UI --- */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.settings-card {
    background: var(--bg-color-sub);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
}

.settings-card .card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-title-icon {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.card-desc {
    font-size: 13px;
    color: var(--text-color-sub);
    margin-bottom: 18px;
}

.theme-selector-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color-sub);
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    border-color: var(--text-color-sub);
    color: var(--text-color);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color-sub);
    color: var(--text-color);
}

.theme-color-preview {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.preview-red { background: #E62E2F; }
.preview-yellow { background: #FFCA28; }
.preview-blue { background: #2196F3; }
.preview-purple { background: #673AB7; }

.account-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-label {
    color: var(--text-color-sub);
}

.detail-val {
    font-weight: 600;
    color: var(--text-color);
}

/* --- 15. Responsive Styling Constraints --- */
@media (max-width: 1024px) {
    .live-tv-split {
        flex-direction: column !important;
        overflow-y: auto;
    }
    .channels-panel, .live-player-panel {
        width: 100%;
        height: auto;
    }
    .channels-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    
    .workspace-header {
        padding: 0 16px;
    }
    .btn-hamburger {
        display: flex;
    }
    .search-bar {
        display: none; /* Hide global search on mobile */
    }
    
    .iptv-layout {
        flex-direction: column;
    }
    .iptv-sidebar {
        width: 100%;
        max-height: 160px;
    }
    .category-list {
        display: flex;
        overflow-x: auto;
        padding: 8px;
        gap: 8px;
    }
    .category-btn {
        margin-bottom: 0;
    }
    
    .modal-body-layout {
        flex-direction: column;
        align-items: center;
    }
    .modal-poster {
        width: 160px;
        height: 240px;
    }
    .info-title {
        font-size: 20px;
        text-align: center;
    }
    .info-meta-row {
        justify-content: center;
    }
    .play-action-row {
        justify-content: center;
    }
}

/* --- Unauthorized Source Protected Page --- */
.unauthorized-card {
    width: 100%;
    max-width: 520px;
    padding: 40px;
    border: 1px solid rgba(230, 46, 47, 0.2);
    animation: fadeInUp 0.5s ease forwards;
}

.unauthorized-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(230, 46, 47, 0.08);
    border: 1.5px solid rgba(230, 46, 47, 0.25);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px auto;
    box-shadow: 0 0 25px rgba(230, 46, 47, 0.2);
}

.unauthorized-icon {
    width: 42px;
    height: 42px;
    color: #E62E2F;
}

.unauthorized-subtitle {
    font-size: 16px;
    color: #ff5252;
    margin-bottom: 20px;
    font-weight: 600;
}

.protection-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color-sub);
}

.protection-badge svg {
    width: 14px;
    height: 14px;
    color: #4CAF50;
}

/* --- Player Container for Third-Party Players --- */
.player-container-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #000;
}

.player-container-element.hidden {
    display: none !important;
}

/* --- Custom Streambox Player Premium UI --- */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.player-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

/* Simulated Hardware Brightness Overlay */
.brightness-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    pointer-events: none;
    z-index: 2;
    opacity: 0; /* Changed dynamically from 0 to 0.8 (0.8 represents max darkness) */
    transition: opacity 0.1s linear;
}

/* Centered HUD Overlay for Volume / Brightness adjustments */
.player-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    min-width: 140px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 1;
}

.player-hud.hidden {
    display: none !important;
    opacity: 0;
    transform: translate(-50%, -40%);
}

.hud-icon-wrapper {
    margin-bottom: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-icon-wrapper svg {
    width: 40px;
    height: 40px;
}

.hud-bar-container {
    width: 8px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 12px;
}

.hud-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--primary-color), var(--grad-end));
    position: absolute;
    bottom: 0;
    left: 0;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.1s linear;
}

.hud-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Lock screen layout */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    pointer-events: auto;
}

.btn-unlock-float {
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 14px 28px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.btn-unlock-float:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(230, 46, 47, 0.3);
}

.btn-unlock-float:active {
    transform: scale(0.98);
}

.btn-unlock-float svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

/* Player controls outer layout */
.player-controls-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 75%, rgba(0,0,0,0.85) 100%);
    transition: opacity 0.3s ease;
    opacity: 1;
    pointer-events: none;
}

.player-controls-container.hidden {
    opacity: 0;
    pointer-events: none !important;
}

.player-header-bar {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    pointer-events: auto;
}

.player-bottom-bar {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: auto;
}

.player-title-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#player-title {
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#player-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-color-sub);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Custom Seek Progress Slider */
.player-progress-area {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.player-time {
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-slider-track {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: height 0.15s ease;
}

.player-slider-track:hover {
    height: 8px;
}

.player-slider-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--grad-end));
    border-radius: 4px;
    width: 0%;
}

.player-slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    left: 0%;
    transition: transform 0.1s ease, width 0.1s ease, height 0.1s ease;
}

.player-slider-track:hover .player-slider-thumb {
    width: 16px;
    height: 16px;
}

/* Player buttons / controls row */
.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-player-control {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255,255,255,0.85);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.btn-player-control:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    transform: scale(1.08);
}

.btn-player-control:active {
    transform: scale(0.95);
}

.btn-player-control svg {
    width: 22px;
    height: 22px;
}

/* Volume Slider in controls */
.volume-control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-volume-track {
    width: 0px;
    height: 5px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.volume-control-group:hover .player-volume-track {
    width: 90px;
}

.player-volume-fill {
    height: 100%;
    background: #fff;
    width: 100%;
}

/* Floating settings menus dialogs */
.player-menu-dialog {
    position: absolute;
    right: 32px;
    bottom: 96px;
    width: 280px;
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 110;
    box-shadow: 0 20px 45px rgba(0,0,0,0.75), var(--glow-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.player-menu-dialog.hidden {
    display: none !important;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
}

.menu-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 10px;
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.menu-dialog-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.menu-opt-btn {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
}

.menu-opt-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.menu-opt-btn.active {
    background: var(--primary-color-sub);
    color: var(--primary-color);
    font-weight: 600;
}

.menu-opt-btn.active::after {
    content: "✓";
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 700;
}

/* Player Loader / Spinner */
.player-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 500;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    z-index: 8;
    pointer-events: none;
}

.player-loader .spinner {
    width: 48px;
    height: 48px;
    border: 4.5px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(230, 46, 47, 0.2);
}

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

/* --- Premium Toastification Notification System --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    pointer-events: auto;
    background: rgba(18, 18, 22, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55);
    transform: translateX(120%);
    transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.toast.active {
    transform: translateX(0);
    opacity: 1;
}

/* Success Toast */
.toast.toast-success::before {
    background: #4CAF50;
}
.toast.toast-success .toast-icon {
    color: #4CAF50;
}

/* Error Toast */
.toast.toast-error::before {
    background: #E62E2F;
}
.toast.toast-error .toast-icon {
    color: #E62E2F;
}

/* Info Toast */
.toast.toast-info::before {
    background: #2196F3;
}
.toast.toast-info .toast-icon {
    color: #2196F3;
}

.toast-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-icon-wrapper svg {
    width: 22px;
    height: 22px;
}

.toast-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 12px;
}

.toast-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.toast-message {
    font-size: 13px;
    color: var(--text-color-sub);
    line-height: 1.4;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color-sub);
    opacity: 0.6;
    transition: all 0.15s ease;
    padding: 2px;
    margin-top: -2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

/* Error Copy Button */
.btn-copy-error {
    align-self: flex-start;
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-error:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-copy-error:active {
    transform: scale(0.96);
}

.btn-copy-error svg {
    width: 12px;
    height: 12px;
    color: var(--primary-color);
}

/* --- 11b. Premium VOD Movie Details Card & Backdrop --- */
#modal-movie-details .modal-content {
    padding: 0 !important;
    overflow: hidden !important;
    max-width: 900px;
}

.movie-details-bg {
    position: relative;
    width: 100%;
    border-radius: 16px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.movie-details-container {
    display: flex;
    gap: 32px;
    padding: 40px;
    background: linear-gradient(to right, rgba(10, 10, 12, 0.99) 35%, rgba(10, 10, 12, 0.85) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.movie-poster-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.rating-stars-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 700;
    color: #FFCA28;
}

.rating-stars-badge svg {
    width: 16px;
    height: 16px;
}

.movie-details-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.movie-meta-table {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    font-size: 14px;
}

.meta-row-item {
    display: flex;
    align-items: flex-start;
    line-height: 1.6;
}

.meta-label {
    width: 120px;
    font-weight: 600;
    color: var(--text-color);
    flex-shrink: 0;
}

.meta-value {
    color: var(--text-color-sub);
}

.cast-text-value {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.movie-plot-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color-sub);
    margin-top: 10px;
    opacity: 0.95;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    max-height: 100px;
    overflow-y: auto;
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    width: 100%;
    color: var(--text-color-sub);
    gap: 16px;
}

/* Adjustments for smaller screen responsiveness */
@media (max-width: 768px) {
    .movie-details-container {
        flex-direction: column;
        padding: 24px;
        background: rgba(10, 10, 12, 0.97);
        gap: 20px;
    }
    
    .movie-poster-wrapper {
        align-items: center;
    }
    
    .modal-poster {
        width: 150px;
        height: 220px;
    }
    
    .info-title {
        text-align: center;
        font-size: 22px;
    }
    
    .movie-meta-table {
        margin: 15px 0;
        font-size: 13px;
    }
    
    .meta-label {
        width: 100px;
    }
}
