@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;800&display=swap');

:root {
    --bg-color: #08080f;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.06);
    --input-border: rgba(255, 255, 255, 0.12);
    --primary-gradient: linear-gradient(135deg, #e53e3e, #ed8936);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.4);
    --error-bg: rgba(229, 62, 62, 0.12);
    --error-border: rgba(229, 62, 62, 0.3);
    --error-text: #fc8181;
    --success-border: rgba(72, 187, 120, 0.3);
    --success-text: #68d391;
    --sidebar-bg: #0d0d18;
    --topbar-bg: rgba(8, 8, 15, 0.8);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --accent: #7c3aed;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --primary-gradient: linear-gradient(135deg, #e53e3e, #ed8936);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --error-bg: #fee2e2;
    --error-border: #fca5a5;
    --error-text: #ef4444;
    --success-bg: #dcfce7;
    --success-border: #86efac;
    --success-text: #22c55e;
    --sidebar-bg: #ffffff;
    --topbar-bg: rgba(255, 255, 255, 0.9);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --accent: #7c3aed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* Changed from default center/center to allow normal flow */
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* Ensure sub-pages take full width and don't center vertically if long */
body:has(.page-layout), body:has(.panel-layout), body:has(.watch-layout) {
    display: block;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, #0d0814 0%, #08080f 100%);
    z-index: -1;
    animation: bgPulse 10s ease infinite;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand {
    text-align: center;
    margin-bottom: 30px;
}

.logo-mark {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: var(--primary-gradient);
    border-radius: 6px;
    vertical-align: middle;
    margin-right: 10px;
    margin-bottom: 4px;
}

.brand-name {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    display: inline-block;
}

.tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 20px;
}

label {
      display: block;
      font-size: 14px;
      margin-bottom: 8px;
      color: var(--text-secondary);
  }

input, textarea, select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 13px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.5)'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 45px;
}

[data-theme="light"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

select option {
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 10px;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--input-border);
    background-color: var(--input-bg);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

button {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 10px;
}

button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message-box {
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 20px;
    display: none;
}

.message-box.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.message-box.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.footer-links {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.help-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Skeleton Loader */
.skeleton-line {
    height: 12px;
    background: var(--hover-bg);
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

/* Toasts */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}
.countdown-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 15px 10px;
    text-align: center;
}
.countdown-value {
    font-size: 24px;
    font-weight: 800;
    color: #e53e3e;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.countdown-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 4px;
    letter-spacing: 1px;
}

/* Data Table & Responsive */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensures readable layout on small screens when scrolled */
}

.data-table th {
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.table-plan-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 14px;
}

.table-date {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', Courier, monospace;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(72, 187, 120, 0.15);
    color: #48bb78;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.status-expired {
    background: rgba(229, 62, 62, 0.15);
    color: #fc8181;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

/* Referral Page Redesign */
.referral-box {
    background: var(--input-bg);
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.referral-code-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.referral-code-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-family: 'Courier New', Courier, monospace;
}

.referral-copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.referral-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    transition: transform 0.2s, opacity 0.2s;
}

.share-btn:active { transform: scale(0.96); }

.share-btn.wa { background: #25D366; }
.share-btn.tg { background: #0088cc; }
.share-btn.ms { background: #0084FF; }
.share-btn.fb { background: #1877F2; }

.toast {
    min-width: 280px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast.success { border-left: 4px solid #48bb78; }
.toast.error   { border-left: 4px solid #e53e3e; }
.toast.info    { border-left: 4px solid #4299e1; }
.toast.warning { border-left: 4px solid #ed8936; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.back-link {
    display: block;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
}

.back-link:hover {
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .card {
        padding: 24px;
    }
    .container {
        padding: 12px;
    }
    .brand img {
        max-width: 200px !important;
    }
    input, textarea, select {
        font-size: 16px;
        padding: 12px 14px;
    }
    button {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .card {
        padding: 18px;
        border-radius: 12px;
    }
    .container {
        padding: 8px;
    }
    .brand-name {
        font-size: 26px;
    }
    h2 {
        font-size: 20px;
    }
}

/* Auth loading screen */
#auth-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.auth-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(229, 62, 62, 0.1);
    border-top-color: #e53e3e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Panel layouts */
.panel-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-collapsed .sidebar {
    width: 70px;
}

.sidebar-collapsed .brand-name,
.sidebar-collapsed .sidebar-nav-item span,
.sidebar-collapsed #admin-name {
    display: none;
}

.sidebar-collapsed .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar-collapsed .sidebar-nav-item i {
    margin-right: 0;
}

.sidebar-brand {
    padding: 30px 24px;
    border-bottom: 1px solid var(--card-border);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 15px;
    cursor: pointer;
}

.sidebar-nav-item i {
    width: 20px;
    margin-right: 12px;
    font-size: 18px;
    text-align: center;
}

.sidebar-nav-item:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    border-left: 3px solid #e53e3e;
    border-radius: 4px 10px 10px 4px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--card-border);
}

.panel-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .panel-main {
    margin-left: 70px;
}

.panel-topbar {
    height: 70px;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.panel-content {
    padding: 30px;
    flex: 1;
}

/* Stat Cards */
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0.5;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.stat-card-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Watch Page Specific */
.watch-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: black;
}

.ch-panel {
    width: 300px;
    background: #0d0d18;
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s;
}

.ch-header {
    padding: 20px;
    border-bottom: 1px solid var(--card-border);
}

.ch-search {
    margin-top: 15px;
}

.ch-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.ch-row {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.ch-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ch-row.active {
    background: rgba(229, 62, 62, 0.15);
    border-left: 3px solid #e53e3e;
    border-radius: 4px 10px 10px 4px;
}

.ch-badge {
    width: 40px;
    height: 40px;
    background: var(--input-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
    color: #e53e3e;
}

.ch-info {
    flex: 1;
}

.ch-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-status {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #48bb78;
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 rgba(72, 187, 120, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0px rgba(72, 187, 120, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0px rgba(72, 187, 120, 0); }
}

.player-area {
    flex: 1;
    position: relative;
    background: black;
    display: flex;
    flex-direction: column;
}

.player-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a24 0%, #000 100%);
}

.player-controls-bar {
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 30px;
    z-index: 50;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    width: 100%;
    max-width: 550px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8);
    position: relative;
    color: var(--text-primary);
}

.modal-card.large {
    max-width: 900px;
}

.modal-header {
    margin-bottom: 30px;
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
}

.modal-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--card-border);
}

.checkbox-list {
    max-height: 250px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    padding: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #e53e3e;
    cursor: pointer;
}

/* Viewer Sub-pages */
.page-layout {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-nav {
    height: 70px;
    background: rgba(8, 8, 15, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.page-content {
    max-width: 600px; /* Reduced from 800px for better readability */
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

.section-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.section-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

/* Referral */
.referral-code-display {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--card-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.referral-code-text {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #e53e3e;
    margin-bottom: 12px;
}

/* Secondary Page Responsive Fixes */
@media (max-width: 768px) {
    .top-nav {
        height: 60px;
        padding: 0 16px;
    }
    .page-content {
        margin: 20px auto;
        padding: 0 16px;
    }
    .section-card {
        padding: 24px;
        border-radius: 12px;
    }
    .section-card-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    .referral-code-text {
        font-size: 26px;
        letter-spacing: 2px;
    }
    .share-grid {
        grid-template-columns: 1fr;
    }
    .stat-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive fixes */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .panel-main {
        margin-left: 0;
    }
}
/* Phase 3 UI Additions */
.panel-mode-tabs {
    display: flex;
    background: rgba(255,255,255,0.05);
    padding: 4px;
    border-radius: 8px;
    margin-top: 10px;
}
.mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    margin-top: 0;
}
.mode-tab.active {
    background: var(--primary-gradient);
    color: var(--text-primary);
}

.cat-tabs {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--card-border);
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    white-space: nowrap;
    padding: 6px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    width: auto; margin-top: 0;
}
.cat-tab.active {
    background: white;
    color: black;
    border-color: var(--text-primary);
}

.vod-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
}
.vod-card {
    cursor: pointer;
    transition: transform 0.2s;
}
.vod-card:hover { transform: scale(1.03); }
.vod-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #1a1a24;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 6px;
}
.vod-card-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.vod-card-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.player-spinner {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 100;
}
.spinner-ring {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.watermark {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    pointer-events: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

.kill-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 30px;
}
.kill-message h3 { font-size: 24px; margin-bottom: 10px; color: #e53e3e; }
.kill-message p { color: var(--text-secondary); margin-bottom: 20px; }

.player-controls-bar {
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    padding: 0 24px;
    justify-content: space-between;
}
.pc-left { flex: 1; }
.pc-show-sub { font-size: 11px; color: #e53e3e; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.pc-show-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.pc-icons { display: flex; gap: 15px; }
.pc-btn {
    background: transparent; border: none; color: var(--text-primary);
    font-size: 18px; cursor: pointer; padding: 5px; width: auto; margin-top: 0;
}
.pc-center { flex: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.player-progress-track {
    width: 100%; height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px; cursor: pointer; position: relative;
}
.player-progress-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    background: var(--primary-gradient); border-radius: 2px;
}
.pc-time { font-size: 11px; color: var(--text-secondary); font-family: monospace; }
.pc-right { flex: 1; text-align: right; }
.pc-time-live { color: #e53e3e; font-weight: 800; font-size: 12px; }

.vod-modal-hero {
    display: flex; gap: 24px; padding: 24px;
}
#vod-modal-thumb { width: 180px; aspect-ratio: 2/3; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.vod-modal-info { flex: 1; }
.vod-modal-meta { display: flex; gap: 15px; margin: 10px 0 15px; font-size: 13px; color: var(--text-secondary); align-items: center; }
.tier-badge {
    padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800;
    text-transform: uppercase; color: var(--text-primary);
}
.tier-badge.free { background: #718096; }
.tier-badge.basic { background: #3182ce; }
.tier-badge.premium { background: #d69e2e; }
.tier-badge.ppv { background: #e53e3e; }

.ep-row {
    display: flex; align-items: center; gap: 15px; padding: 12px;
    border-radius: 8px; background: rgba(255,255,255,0.03); margin-bottom: 6px;
    cursor: pointer; transition: background 0.2s;
}
.ep-row:hover { background: rgba(255,255,255,0.08); }
.ep-num { font-weight: 800; color: #e53e3e; width: 30px; }
.ep-title { flex: 1; font-size: 14px; }
.ep-duration { font-size: 12px; color: var(--text-secondary); }

/* Skeleton */
.skeleton-list {
    height: 300px;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}
/* Utility Classes */
.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: var(--card-bg); border-color: var(--card-border); }

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: transform 0.2s;
    width: auto;
    margin-top: 0;
}
.btn-icon:hover { transform: scale(1.2); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    width: auto;
    margin-top: 0;
}

.section-search {
    width: 250px;
    margin-top: 0;
}

select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    padding: 13px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' 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 12px center;
    background-size: 16px;
}

/* Voucher Management Premium Styles */
.voucher-dashboard-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.premium-glass {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 20px !important;
}

.stat-card-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    color: var(--text-secondary);
}

.stat-card.premium-glass {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.stat-card.premium-glass:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.tab-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 12px;
    display: flex;
    gap: 5px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: auto !important;
    margin: 0;
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-group {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.search-input {
    padding-left: 45px !important;
}

.filter-group {
    display: flex;
    gap: 10px;
}

.modern-select {
    width: auto !important;
    min-width: 150px;
}

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.modern-table th {
    padding: 15px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-align: left;
}

.modern-table td {
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    vertical-align: middle;
}

.modern-table tr td:first-child { border-radius: 12px 0 0 12px; }
.modern-table tr td:last-child { border-radius: 0 12px 12px 0; }

.modern-table tr {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.progress-container {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.bulk-action-bar {
    background: #e53e3e;
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease;
    box-shadow: 0 10px 30px rgba(229, 62, 62, 0.2);
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.btn-bulk {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    width: auto;
    margin: 0;
}

.btn-bulk.btn-danger {
    background: white;
    color: #e53e3e;
}

.btn-bulk.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.wide-modal {
    max-width: 800px !important;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    width: auto;
    padding: 0;
    margin: 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.details-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-label { color: var(--text-secondary); font-size: 14px; }
.info-value { font-weight: 600; font-size: 14px; }

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.glow-btn {
    box-shadow: 0 0 20px rgba(229, 62, 62, 0.4);
}

.glow-btn:hover {
    box-shadow: 0 0 30px rgba(229, 62, 62, 0.6);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.status-active {
    background: rgba(0, 255, 127, 0.1);
    color: #00ff7f;
    border: 1px solid rgba(0, 255, 127, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 127, 0.1);
}

.status-badge.status-redeemed {
    background: rgba(255, 165, 0, 0.1);
    color: #ffa500;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.status-badge.status-expired {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modern-table tr.voucher-redeemed td {
    background: rgba(255, 255, 255, 0.01) !important;
    opacity: 0.5;
}

.modern-table tr.voucher-redeemed code {
    color: var(--text-secondary) !important;
    box-shadow: none !important;
}

.btn-eye {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    padding: 0;
    margin: 0;
}

.btn-eye:hover {
    background: var(--accent);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent);
    transform: scale(1.1);
}

/* =========================================
   GLOBAL MODALS & LAYOUTS (Added for Inbox/Support)
   ========================================= */

#auth-loading {
    position: fixed; inset: 0; background: var(--bg-color, #08080f);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
    transition: opacity 0.3s ease;
}
.auth-spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent, #e53e3e);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-layout { width: 100%; min-height: 100vh; display: flex; flex-direction: column; }
.top-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.05); backdrop-filter: blur(10px);
}
.page-content { flex: 1; padding: 24px; }

/* Modals */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8);
    display: none; align-items: center; justify-content: center;
    z-index: 10000; backdrop-filter: blur(4px);
}
.modal-card {
    background: var(--card-bg); border: 1px solid var(--card-border);
    border-radius: 16px; padding: 24px; width: 90%; max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6); color: var(--text-primary);
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.close-btn {
    background: none; border: none; color: var(--text-secondary);
    font-size: 24px; cursor: pointer; line-height: 1;
}
.close-btn:hover { color: var(--text-primary); }

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(229, 62, 62, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 62, 62, 0); }
}
.pulse-anim { animation: pulse-dot 2s infinite; }

/* --------------------------------------------
   USER DROPDOWN (Global)
-------------------------------------------- */
.user-dropdown-menu {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 220px;
  background: #0e0e20;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 200;
  overflow: hidden;
  animation: menuDown 0.22s var(--ease) both;
}

@keyframes menuDown {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.user-dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s;
  cursor: pointer;
}

.dropdown-item i {
  width: 16px;
  text-align: center;
  opacity: 0.6;
}

.dropdown-item:hover {
  background: var(--glass-hover);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

select option {
    background-color: var(--bg-color);
    color: var(--text-primary);
}
