/* ==========================================================================
   TVideo Rewards — Modern Fintech & Watch-to-Earn Stylesheet
   Mobile-first, clean light theme + dark mode, no excessive gradients
   ========================================================================== */

:root {
    --bg-body: #f5f7fa;
    --bg-surface: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent: #16a34a;
    --accent-hover: #15803d;
    --accent-soft: #dcfce7;
    --accent-text: #166534;

    --blue: #2563eb;
    --blue-soft: #dbeafe;
    --purple: #7c3aed;
    --purple-soft: #ede9fe;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --sidebar-width: 256px;
    --topbar-height: 64px;
    --bottom-nav-height: 64px;
    --transition: 0.18s ease;
}

[data-theme="dark"] {
    --bg-body: #0b1120;
    --bg-surface: #111827;
    --bg-subtle: #1e293b;
    --bg-hover: #273449;
    --border-color: #293548;
    --border-strong: #475569;

    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;

    --accent: #22c55e;
    --accent-hover: #16a34a;
    --accent-soft: rgba(34, 197, 94, 0.18);
    --accent-text: #86efac;

    --blue: #60a5fa;
    --blue-soft: rgba(59, 130, 246, 0.2);
    --purple: #a78bfa;
    --purple-soft: rgba(139, 92, 246, 0.2);
    --amber: #fbbf24;
    --amber-soft: rgba(245, 158, 11, 0.2);
    --danger: #f87171;
    --danger-soft: rgba(239, 68, 68, 0.2);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body.app-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover {
    color: var(--accent-hover);
}

h1, h2, h3, h4 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

p {
    margin: 0;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    background: var(--bg-subtle);
    padding: 2px 6px;
    border-radius: 5px;
    color: var(--text-primary);
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-success { color: var(--accent); }
.text-danger { color: var(--danger); }
.mt-md { margin-top: 1rem; }

/* ==========================================================================
   App Shell: Sidebar + Topbar + Main + Mobile Bottom Nav
   ========================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Desktop Sidebar (hidden on mobile) */
.sidebar {
    display: none;
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.brand-link, .mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.brand-mark-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.brand-text strong {
    display: block;
    font-size: 1rem;
    letter-spacing: -0.02em;
}
.brand-text span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    padding: 0.85rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.35rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition), color var(--transition);
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-text);
    font-weight: 600;
}

.nav-item-danger {
    color: var(--danger);
}
.nav-item-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.65rem 0.5rem;
}

.sidebar-promo {
    margin: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
}
.sidebar-promo-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.sidebar-promo p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Main Column */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: calc(var(--bottom-nav-height) + 12px);
}

/* Top Navigation Bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.topbar-title {
    display: none;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.icon-btn:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}
.balance-pill:hover {
    color: var(--accent-text);
    filter: brightness(0.96);
}

.profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.65rem 0.25rem 0.25rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
}
.profile-pill:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Page Content Container */
.page-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.15rem 1rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.footer-links {
    display: flex;
    gap: 1rem;
}
.footer-links a {
    color: var(--text-muted);
}
.footer-links a:hover {
    color: var(--text-primary);
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 40;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 600;
}
.bottom-nav-item i {
    font-size: 1.05rem;
}
.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--accent);
}

/* ==========================================================================
   Cards, Buttons, Badges, Alerts
   ========================================================================== */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.card-header-wrap {
    flex-wrap: wrap;
}
.card-header h3 {
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.link-sm {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.05rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.1s ease;
    white-space: nowrap;
}
.btn:active:not(:disabled) {
    transform: translateY(1px);
}
.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    color: #ffffff;
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
    color: var(--text-primary);
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover:not(:disabled) {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    filter: brightness(0.92);
    color: #ffffff;
}

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}
.btn-danger-outline:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.84rem; }
.btn-xs { padding: 0.3rem 0.65rem; font-size: 0.78rem; }
.btn-lg { padding: 0.75rem 1.3rem; font-size: 0.95rem; }
.btn-block { width: 100%; }

/* Social Share Buttons */
.btn-whatsapp { background: #16a34a; color: #fff; }
.btn-whatsapp:hover { background: #15803d; color: #fff; }
.btn-telegram { background: #0284c7; color: #fff; }
.btn-telegram:hover { background: #0369a1; color: #fff; }
.btn-facebook { background: #1d4ed8; color: #fff; }
.btn-facebook:hover { background: #1e40af; color: #fff; }
.btn-x { background: #0f172a; color: #fff; }
[data-theme="dark"] .btn-x { background: #334155; }
.btn-x:hover { opacity: 0.9; color: #fff; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 600;
}
.badge-success { background: var(--accent-soft); color: var(--accent-text); }
.badge-info    { background: var(--blue-soft); color: var(--blue); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--bg-subtle); color: var(--text-secondary); }

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
}

/* Alerts */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    border: 1px solid transparent;
}
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}
.alert-close:hover { opacity: 1; }

.alert-success { background: var(--accent-soft); color: var(--accent-text); border-color: rgba(22, 163, 74, 0.25); }
.alert-error   { background: var(--danger-soft); color: var(--danger); border-color: rgba(220, 38, 38, 0.25); }
.alert-warning { background: var(--amber-soft); color: var(--amber); border-color: rgba(217, 119, 6, 0.25); }
.alert-info    { background: var(--blue-soft); color: var(--blue); border-color: rgba(37, 99, 235, 0.22); }

/* ==========================================================================
   Dashboard & Account Summary
   ========================================================================== */

.welcome-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.welcome-eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.2rem;
}
.welcome-title {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}
.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.welcome-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Guest Hero */
.guest-hero {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
}
.pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.guest-hero h2 {
    font-size: 1.6rem;
    margin-bottom: 0.55rem;
}
.guest-hero p {
    color: var(--text-secondary);
    max-width: 620px;
    margin-bottom: 1.15rem;
}
.guest-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}
.guest-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}
.mini-metric {
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    text-align: center;
}
.mini-metric strong {
    display: block;
    font-size: 1.1rem;
    color: var(--accent);
}
.mini-metric span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    box-shadow: var(--shadow-sm);
}
.stat-card-accent {
    border-color: rgba(22, 163, 74, 0.35);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon-blue   { background: var(--blue-soft); color: var(--blue); }
.stat-icon-purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon-amber  { background: var(--amber-soft); color: var(--amber); }
.stat-icon-slate  { background: var(--bg-subtle); color: var(--text-secondary); }

.stat-body {
    min-width: 0;
}
.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 2px 0;
}
.stat-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* External Referral CTA Banner */
.referral-cta-card {
    background: var(--bg-surface);
    border: 1px solid rgba(22, 163, 74, 0.35);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}
.referral-cta-content {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.referral-cta-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.referral-cta-card h3 {
    font-size: 1rem;
    margin-bottom: 2px;
}
.referral-cta-card p {
    font-size: 0.86rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.task-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.task-progress-header h3 {
    font-size: 0.98rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 2px;
}
.progress-badge {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-text);
    background: var(--accent-soft);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
}
.progress-track {
    width: 100%;
    height: 8px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-track-lg {
    height: 12px;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.35s ease;
}

/* ==========================================================================
   Video Tasks Section
   ========================================================================== */

.section-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}
.section-title {
    font-size: 1.25rem;
}
.section-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.status-tabs {
    display: inline-flex;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: var(--radius-sm);
    gap: 4px;
}
.tab-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0.42rem 0.75rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.tab-btn.active {
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}
.tab-count {
    font-size: 0.74rem;
    background: var(--bg-subtle);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
}

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
}
.search-input-wrap {
    position: relative;
}
.search-input-wrap i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.search-input-wrap .form-input {
    padding-left: 2.45rem;
}

.category-chips, .filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.chip {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition);
}
.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.video-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.video-thumb-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    overflow: hidden;
}
.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-id-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
}
.video-duration-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.video-done-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.video-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    flex: 1;
}
.video-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.video-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-footer {
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.reward-pill {
    display: flex;
    flex-direction: column;
}
.reward-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
.reward-pill strong {
    font-size: 0.98rem;
    color: var(--accent);
    font-weight: 800;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
}

/* ==========================================================================
   Watch Page
   ========================================================================== */

.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.back-link:hover { color: var(--accent); }

.watch-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.watch-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.player-card {
    padding: 0;
    overflow: hidden;
}
.video-player-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.video-player-frame iframe,
.video-player-frame #ytPlayerMount {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.watch-details {
    padding: 1.15rem 1.25rem;
}
.watch-details-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}
.watch-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-text);
    font-size: 0.85rem;
}
.watch-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
.watch-submeta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.watch-timer-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.timer-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.timer-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--amber);
}
.timer-status-pill.is-playing .status-dot {
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.timer-status-pill.is-ready .status-dot {
    background: var(--accent);
}
.timer-countdown-box {
    text-align: right;
}
.timer-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}
.timer-digits {
    font-size: 1.65rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}
.progress-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.watch-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.watch-action-row .btn-primary {
    flex: 1;
}

.watch-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    background: var(--bg-subtle);
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
}

/* Completion Success Animation */
.completion-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    border: 1px solid rgba(22, 163, 74, 0.35);
}
.completion-check {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.completion-copy {
    flex: 1;
    min-width: 200px;
}
.completion-copy h3 {
    color: var(--accent-text);
    font-size: 1.05rem;
    margin-bottom: 2px;
}
.completion-copy p {
    font-size: 0.88rem;
    color: var(--text-primary);
}
.completion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); }
}
.animate-pop {
    animation: popIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Recommended Sidebar List */
.watch-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.next-video-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.next-video-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.45rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: background var(--transition);
}
.next-video-item:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}
.next-video-thumb {
    position: relative;
    width: 112px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0f172a;
}
.next-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.next-video-dur {
    position: absolute;
    right: 4px;
    bottom: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 0.66rem;
    padding: 1px 5px;
    border-radius: 4px;
}
.next-video-info {
    min-width: 0;
    flex: 1;
}
.next-video-title {
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.next-video-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

/* ==========================================================================
   Wallet, Withdraw, Tables, Activity, Referrals, Profile, Settings
   ========================================================================== */

.wallet-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.wallet-big-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
    margin: 4px 0;
}
.wallet-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.two-col-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.balance-summary-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-subtle);
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}
.strip-value {
    display: block;
    font-size: 1.25rem;
    color: var(--accent);
}
.strip-value-sm {
    display: block;
    font-size: 1rem;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}
.method-option {
    cursor: pointer;
}
.method-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.method-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--bg-surface);
    font-size: 0.88rem;
    font-weight: 600;
    transition: all var(--transition);
}
.method-option input:checked + .method-card {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-text);
}

/* Activity List */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
}
.activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.82rem;
}
.icon-positive { background: var(--accent-soft); color: var(--accent); }
.icon-negative { background: var(--danger-soft); color: var(--danger); }
.activity-info { flex: 1; min-width: 0; }
.activity-desc {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-date { font-size: 0.75rem; color: var(--text-muted); }
.activity-amount { font-size: 0.9rem; font-weight: 700; white-space: nowrap; }

/* Responsive Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table th,
.data-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.data-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg-subtle);
    font-weight: 700;
}
.data-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Referral Share Row */
.copy-link-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}
.copy-link-row .form-input {
    flex: 1;
}
.social-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* Profile & Settings */
.profile-summary-card {
    text-align: center;
}
.profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.55rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}
.profile-meta-list {
    margin: 1.25rem 0;
    border-top: 1px solid var(--border-color);
    text-align: left;
}
.profile-meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}
.profile-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
}
.setting-row:last-child { border-bottom: none; }

/* ==========================================================================
   Forms & Auth Pages
   ========================================================================== */

.auth-wrapper {
    max-width: 500px;
    width: 100%;
    margin: 0.5rem auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.auth-card {
    padding: 1.75rem;
}
.auth-header {
    text-align: center;
    margin-bottom: 1.35rem;
}
.auth-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
.auth-header h2 {
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
}
.auth-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.38rem;
}
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.form-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input:disabled {
    background: var(--bg-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}
.form-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.input-icon-wrap {
    position: relative;
}
.input-icon-wrap > i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.input-icon-wrap .form-input {
    padding-left: 2.45rem;
    padding-right: 2.5rem;
}
.toggle-password-btn {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}
.toggle-password-btn:hover { color: var(--text-primary); }

/* Empty States & Error Pages */
.empty-state, .empty-state-inline, .empty-inline {
    text-align: center;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}
.empty-inline { padding: 1.25rem 0.5rem; }
.empty-icon, .empty-state-inline > i {
    font-size: 2.2rem;
    color: var(--text-muted);
}
.error-page-card {
    max-width: 520px;
    margin: 2rem auto;
}
.error-code {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}
.inline-actions-center {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ==========================================================================
   Modal & Toast Notifications
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}
.modal-backdrop.is-open {
    display: flex;
}
.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}
.modal-body {
    padding: 1.15rem 1.25rem;
    color: var(--text-secondary);
}
.modal-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.toast-container {
    position: fixed;
    top: 76px;
    right: 16px;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 340px;
}
.toast {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.toast-error { border-left-color: var(--danger); }

.hide-xs { display: none; }
.hide-sm { display: none; }

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (min-width: 560px) {
    .hide-xs { display: inline-flex; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .hide-sm { display: inline; }
    .page-content { padding: 1.5rem 1.5rem 2.5rem; }
    .two-col-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .guest-hero { grid-template-columns: 1.6fr 1fr; align-items: center; }
}

@media (min-width: 1024px) {
    .sidebar { display: flex; }
    .app-main {
        margin-left: var(--sidebar-width);
        padding-bottom: 0;
    }
    .mobile-brand { display: none; }
    .topbar-title { display: block; }
    .mobile-bottom-nav { display: none; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
    .video-grid { grid-template-columns: repeat(3, 1fr); }
    .watch-layout { grid-template-columns: 1.85fr 1fr; align-items: start; }
}
