/* ==========================================================================
   assets/css/global.css
   Single global stylesheet for AllVideoSave — loaded on every page.
   Contains: base reset, typography, navbar/header, badges, dropdown,
   buttons, and mobile-responsive rules.
   ========================================================================== */

/* ---- Base Reset ---- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: #0f0f0f;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

.global-video-open-loader{position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.72);backdrop-filter:blur(5px);display:grid;place-items:center;padding:20px}
.global-video-open-loader[hidden]{display:none}
.global-video-open-card{min-width:220px;padding:25px 28px;border-radius:18px;background:#131318;border:1px solid rgba(255,255,255,.12);display:flex;flex-direction:column;align-items:center;gap:10px;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.global-video-open-card strong{color:#fff}
.global-video-open-card small{color:rgba(255,255,255,.65)}
.video-link-opening{opacity:.72;transform:scale(.99)}

img {
    max-width: 100%;
    height: auto;
}

a {
    -webkit-tap-highlight-color: transparent;
}

.gradient-text {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* ---- Navbar ---- */
.navbar {
    background: #0a0a0a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* ---- Minimal App Header (Logo · Search · Notifications · Theme · Profile) ---- */
.app-header {
    background: #0a0a0a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

/* Keep the header row on ONE line, always. Without this, the search box
   refuses to shrink below its content size on narrow phones and pushes
   the bell / theme / avatar icons onto a second row. */
.app-header .container-fluid {
    flex-wrap: nowrap !important;
    min-width: 0;
    justify-content: flex-start !important;
}

/* The search box is the ONLY element allowed to shrink. The right-side
   actions (bell / theme / avatar) must always render fully, otherwise the
   red-bordered avatar gets clipped at the viewport edge in Chrome and shows
   as a thin red vertical line. */
.app-header .app-search {
    flex: 1 1 auto;
    min-width: 0;
}

.app-header .header-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.app-header .header-primary {
    flex: 0 0 auto;
    min-width: 0;
}

.app-header .header-actions .custom-dropdown-toggle {
    max-width: 100%;
}

/* Belt-and-braces: never let the page scroll sideways from header overflow. */
html,
body {
    overflow-x: hidden;
}

.header-icon-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: rgba(255, 255, 255, 0.85);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 0 0 auto;
}

.header-icon-btn:hover {
    background: rgba(255, 65, 108, 0.12);
    border-color: rgba(255, 65, 108, 0.4);
    color: #ff416c;
}

.notif-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ff1744;
    color: #fff;
    border: 2px solid #0a0a0a;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(255, 23, 68, 0.55);
    z-index: 5;
    animation: notifBadgePulse 1.6s ease-in-out infinite;
}

html[data-theme="light"] .notif-badge-count {
    border-color: #ffffff;
}

@keyframes notifBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .notif-badge-count { animation: none; }
}

/* ---- Header Search ---- */
.app-search {
    position: relative;
    max-width: 560px;
    min-width: 0;
    margin: 0 auto;
    display: none;
}

.app-header .app-search.is-open {
    display: block;
}

/* The icon is replaced by the search field while it is open. */
.app-header:has(.app-search.is-open) #headerSearchToggle {
    display: none;
}

/* Search gets the entire centre/right header area while open. */
.app-header:has(.app-search.is-open) .header-actions {
    display: none !important;
}

.app-header .app-search.is-open {
    flex: 1 1 auto;
    max-width: none;
}

.header-search-submit,
.header-search-close {
    position: absolute;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    color: rgba(255,255,255,.62);
    background: transparent;
}

.header-search-submit {
    right: 42px;
    color: #fff;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
}

.header-search-close {
    right: 7px;
}

.header-search-submit:hover,
.header-search-close:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
}

.app-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    pointer-events: none;
}

.app-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 40px;
    padding: 9px 82px 9px 40px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.app-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.app-search-input:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: none;
    outline: none;
}

/* ---- Offcanvas Sidebar ---- */
.app-offcanvas {
    background: #0a0a0a;
    color: #fff;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    width: 300px;
    max-width: 85vw;
}

.app-offcanvas .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.offcanvas-section-title {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.offcanvas-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.offcanvas-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.offcanvas-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.2s ease;
}

.offcanvas-nav-link:hover,
.offcanvas-nav-link.active {
    background: rgba(255, 65, 108, 0.12);
    color: #ff416c;
}

.offcanvas-nav-link:hover i,
.offcanvas-nav-link.active i {
    color: #ff416c;
}

.offcanvas-nav-link.text-danger i {
    color: #ff4b4b;
}

.offcanvas-nav-upgrade {
    background: linear-gradient(90deg, rgba(255, 65, 108, 0.15), rgba(255, 75, 43, 0.08));
    border: 1px solid rgba(255, 65, 108, 0.3);
    color: #ffd7df;
    margin-top: 4px;
}

.offcanvas-nav-upgrade i {
    color: #ff416c;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    margin-right: 50px;
    color: #ffffff;
}

.navbar-brand:hover {
    color: #ffffff;
}

html[data-theme="light"] .navbar-brand,
html[data-theme="light"] .navbar-brand:hover {
    color: #1f2430;
}

.navbar-brand i {
    color: #ff416c;
    font-size: 1.3rem;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 0 !important;
}

.header-logo,
.header-logo-image,
.sidebar-brand {
    display: block;
    line-height: 0;
}

.header-logo,
.header-logo-image {
    padding: 0;
    border: 0;
    background: transparent;
    filter: drop-shadow(0 4px 9px rgba(0, 0, 0, .24));
}

.header-logo img,
.header-logo-image {
    display: block;
    width: auto;
    height: 34px;
}

.sidebar-logo-image {
    display: block;
    width: auto;
    max-width: 190px;
    height: 44px;
    object-fit: contain;
}

.header-logo-light,
.sidebar-logo-light {
    display: none;
}

html[data-theme="light"] .header-logo-dark,
html[data-theme="light"] .sidebar-logo-dark {
    display: none;
}

html[data-theme="light"] .header-logo-light {
    display: block;
    filter: drop-shadow(0 2px 5px rgba(24, 31, 45, .12));
}

html[data-theme="light"] .header-logo-image {
    filter: drop-shadow(0 2px 5px rgba(24, 31, 45, .12));
}

html[data-theme="light"] .sidebar-logo-light {
    display: block;
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    padding: 8px 16px !important;
}

.nav-link:hover,
.nav-link.active {
    color: #ff416c !important;
    background: rgba(255, 65, 108, 0.1);
}

/* ---- Badges ---- */
.wallet-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 40px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #10b981;
}

.referral-badge {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 40px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f59e0b;
}

.vip-badge {
    background: linear-gradient(90deg, rgba(255, 65, 108, 0.15), rgba(255, 75, 43, 0.08));
    border: 1px solid rgba(255, 65, 108, 0.3);
    border-radius: 40px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffd700;
}

.upgrade-btn {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    border-radius: 40px;
    padding: 6px 16px;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.3);
    color: white;
}

/* ---- User Avatar ---- */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff416c;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    background: rgba(255, 65, 108, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ff416c;
}

.user-avatar-placeholder i {
    font-size: 1rem;
    color: #ff416c;
}

/* ---- Custom Dropdown ---- */
.custom-dropdown {
    position: relative;
    display: inline-block;
}

.custom-dropdown-toggle {
    cursor: pointer;
    background: transparent !important;
    border: none !important;
}

.custom-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 0;
    min-width: 220px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

.custom-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-dropdown-item {
    padding: 10px 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.custom-dropdown-item:hover {
    background: rgba(255, 65, 108, 0.15);
    color: #ff416c;
}

.custom-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 0;
}

/* ---- Login/Signup Buttons ---- */
.btn-login {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    padding: 6px 18px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-login:hover {
    border-color: #ff416c;
    background: rgba(255, 65, 108, 0.1);
    color: #ff416c;
}

.btn-signup {
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    border-radius: 40px;
    padding: 6px 18px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-signup:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.3);
    color: white;
}

/* ---- Generic content containers: keep things from overflowing on small screens ---- */
.container,
.container-fluid {
    max-width: 100%;
}

table {
    max-width: 100%;
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .navbar-brand {
        margin-right: 0;
    }

    .navbar-nav {
        margin: 15px 0;
    }

    .wallet-badge,
    .referral-badge,
    .vip-badge,
    .upgrade-btn {
        margin: 5px 0;
        display: inline-flex;
    }

    .custom-dropdown-menu {
        position: fixed;
        top: auto;
        bottom: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        width: 90%;
        max-width: 300px;
    }

    .custom-dropdown-menu.show {
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 576px) {
    .navbar-brand span {
        font-size: 1.1rem;
    }

    body {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 8px 0;
    }

    .header-brand {
        padding: 0;
    }

    .header-logo img,
    .header-logo-image {
        height: 32px;
        max-width: 145px;
        object-fit: contain;
    }

    .app-header .container-fluid {
        gap: 7px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .app-header:has(.app-search.is-open) .header-primary {
        display: none !important;
    }

    .app-header .app-search.is-open {
        width: 100%;
        margin: 0;
    }

    .header-logo {
        filter: drop-shadow(0 3px 7px rgba(255, 65, 108, .20));
    }

    .header-actions {
        gap: 5px !important;
    }
}

/* ==========================================================================
   Batch 6 — Global Mobile Responsive & UI Polish
   Site-wide refinements. Loaded on every page via global.css.
   ========================================================================== */

/* Smooth scrolling + consistent selection colour */
html {
    scroll-behavior: smooth;
}

::selection {
    background: rgba(255, 65, 108, 0.35);
    color: #fff;
}

/* Nicer, thinner scrollbars (desktop) */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 65, 108, 0.5) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 65, 108, 0.45);
    border-radius: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

/* Any wide table stays usable on small screens without breaking layout */
.table-responsive,
.table-wrap {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

/* Images never overflow their container + graceful broken-image look */
img {
    max-width: 100%;
    height: auto;
}

/* Modals: comfortable on phones (near-fullscreen, scrollable body) */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        max-height: 75vh;
        overflow-y: auto;
    }

    /* Prevent iOS auto-zoom on focus: inputs must be >=16px */
    input,
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    /* Comfortable tap targets */
    .btn,
    .header-icon-btn,
    .offcanvas-nav-link,
    .custom-dropdown-item {
        min-height: 44px;
    }

    /* Tighter container gutters so cards use the full width */
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Buttons stack full-width in footers/groups where they'd otherwise cramp */
    .modal-footer .btn,
    .modal-footer .btn-modal-primary,
    .modal-footer .btn-modal-secondary {
        flex: 1 1 auto;
    }
}

/* Tablet: keep header search from hugging the icons */
@media (max-width: 768px) {
    .app-search {
        max-width: 100%;
    }
}

/* Small phones: tighten header spacing so everything still fits on one row */
@media (max-width: 400px) {
    .app-header .container-fluid {
        gap: 6px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .header-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .app-search-input {
        padding: 8px 76px 8px 34px;
        font-size: 0.85rem;
    }

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

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   LIGHT THEME  ·  activated by  <html data-theme="light">
   Matches the reference: soft near-white background, white cards with light
   borders + soft shadow, dark text, muted grey secondary text, accent kept.
   Scoped + !important so it also overrides per-page inline <style> blocks
   that hardcode dark colours on shared/custom classes.
   ========================================================================== */
html[data-theme="light"] body {
    background: linear-gradient(180deg, #fdeef1 0%, #f6f7fb 240px, #f4f5f8 100%) !important;
    color: #1f2430 !important;
}

/* Kill dark decorative backdrops in light mode */
html[data-theme="light"] .premium-bg {
    opacity: 0 !important;
}

/* Text utilities → readable on light */
html[data-theme="light"] .text-white,
html[data-theme="light"] .text-light,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
    color: #1f2430 !important;
}

html[data-theme="light"] .text-muted,
html[data-theme="light"] .text-secondary,
html[data-theme="light"] small,
html[data-theme="light"] .info-text {
    color: #6b7280 !important;
}

/* Dark surface utilities → white cards */
html[data-theme="light"] .bg-dark,
html[data-theme="light"] .bg-black,
html[data-theme="light"] .card,
html[data-theme="light"] .modal-content,
html[data-theme="light"] .modal-content.bg-dark,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .trending-card,
html[data-theme="light"] .video-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .info-card,
html[data-theme="light"] .glass-card,
html[data-theme="light"] .dashboard-card,
html[data-theme="light"] .content-card,
html[data-theme="light"] .video-info-bar,
html[data-theme="light"] .empty-state {
    background: #ffffff !important;
    border: 1px solid #e8eaed !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06) !important;
    color: #1f2430 !important;
}

/* Secondary surfaces (inputs, session rows, chips background) */
html[data-theme="light"] .session-item,
html[data-theme="light"] .card-info,
html[data-theme="light"] .trending-item {
    background: #f7f8fa !important;
    color: #1f2430 !important;
}

/* Header / navbar / offcanvas */
html[data-theme="light"] .navbar,
html[data-theme="light"] .app-header {
    background: #ffffff !important;
    border-bottom: 1px solid #ececf0 !important;
}

html[data-theme="light"] .app-offcanvas {
    background: #ffffff !important;
    color: #1f2430 !important;
    border-right: 1px solid #ececf0 !important;
}

html[data-theme="light"] .app-offcanvas .offcanvas-header {
    border-bottom: 1px solid #ececf0 !important;
}

html[data-theme="light"] .offcanvas-nav-link {
    color: #374151 !important;
}

html[data-theme="light"] .offcanvas-nav-link i {
    color: #9aa1ac !important;
}

html[data-theme="light"] .offcanvas-nav-link:hover,
html[data-theme="light"] .offcanvas-nav-link.active {
    background: rgba(255, 65, 108, 0.10) !important;
    color: #ff416c !important;
}

html[data-theme="light"] .offcanvas-nav-link:hover i,
html[data-theme="light"] .offcanvas-nav-link.active i {
    color: #ff416c !important;
}

html[data-theme="light"] .offcanvas-section-title {
    color: #9aa1ac !important;
}

html[data-theme="light"] .nav-link {
    color: #374151 !important;
}

html[data-theme="light"] .nav-link:hover,
html[data-theme="light"] .nav-link.active {
    color: #ff416c !important;
    background: rgba(255, 65, 108, 0.08) !important;
}

/* Header icon buttons */
html[data-theme="light"] .header-icon-btn {
    background: #f2f3f5 !important;
    border: 1px solid #e3e5ea !important;
    color: #4b5563 !important;
}

html[data-theme="light"] .header-icon-btn:hover {
    background: rgba(255, 65, 108, 0.10) !important;
    border-color: rgba(255, 65, 108, 0.35) !important;
    color: #ff416c !important;
}

/* Custom dropdown (profile + notifications) */
html[data-theme="light"] .custom-dropdown-menu {
    background: #ffffff !important;
    border: 1px solid #e8eaed !important;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12) !important;
}

html[data-theme="light"] .custom-dropdown-item {
    color: #374151 !important;
}

html[data-theme="light"] .custom-dropdown-item:hover {
    background: rgba(255, 65, 108, 0.10) !important;
    color: #ff416c !important;
}

html[data-theme="light"] .custom-dropdown-divider {
    background: #ececf0 !important;
}

html[data-theme="light"] .custom-dropdown-toggle,
html[data-theme="light"] .custom-dropdown-toggle span {
    color: #1f2430 !important;
}

/* Form controls */
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] .app-search-input,
html[data-theme="light"] .search-input,
html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"] {
    background: #f4f5f7 !important;
    border: 1px solid #e0e2e8 !important;
    color: #1f2430 !important;
}

html[data-theme="light"] .form-control::placeholder,
html[data-theme="light"] .app-search-input::placeholder,
html[data-theme="light"] .search-input::placeholder {
    color: #9aa1ac !important;
}

html[data-theme="light"] .form-control:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] .app-search-input:focus {
    background: #ffffff !important;
    border-color: rgba(255, 65, 108, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.12) !important;
}

html[data-theme="light"] .app-search-icon {
    color: #9aa1ac !important;
}

html[data-theme="light"] .header-search-clear,
html[data-theme="light"] .header-search-close {
    color: #5b6472;
}

html[data-theme="light"] .header-search-clear:hover,
html[data-theme="light"] .header-search-close:hover {
    color: #ff416c;
    background: rgba(255, 65, 108, .10);
}

/* Chips / filter pills / tags */
html[data-theme="light"] .chip,
html[data-theme="light"] .tag-chip {
    background: #f1f2f5 !important;
    border: 1px solid #e3e5ea !important;
    color: #374151 !important;
}

html[data-theme="light"] .chip.active,
html[data-theme="light"] .chip:hover,
html[data-theme="light"] .tag-chip:hover {
    background: rgba(255, 65, 108, 0.12) !important;
    color: #ff416c !important;
}

/* Pagination */
html[data-theme="light"] .page-link {
    background: #ffffff !important;
    border: 1px solid #e3e5ea !important;
    color: #374151 !important;
}

html[data-theme="light"] .page-link.active {
    background: linear-gradient(90deg, #ff416c, #ff4b2b) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* Dividers / borders */
html[data-theme="light"] hr,
html[data-theme="light"] .border-secondary,
html[data-theme="light"] .modal-header,
html[data-theme="light"] .modal-footer {
    border-color: #ececf0 !important;
}

/* Sidebar (old settings/premium layout) */
html[data-theme="light"] .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #ececf0 !important;
}

html[data-theme="light"] .sidebar .nav-link {
    color: #374151 !important;
}

/* Bootstrap close button flips to dark glyph on light */
html[data-theme="light"] .btn-close-white {
    filter: none !important;
}

/* --------------------------------------------------------------------------
   Per-page custom classes that hardcode `color: white / #fff` in their own
   inline <style> blocks. In dark mode they are fine; in light mode the text
   would stay white on a light/transparent background = invisible.
   These rules force readable dark text WITHOUT touching gradient/solid-colour
   buttons (.btn-*, .watch-btn, .download-btn, .tab-btn.active, etc.) whose
   white text must stay white.
   -------------------------------------------------------------------------- */

/* Text / headings / links sitting on transparent or light surfaces */
html[data-theme="light"] .video-title,
html[data-theme="light"] .video-title-link,
html[data-theme="light"] .sidebar-section h5,
html[data-theme="light"] .section-text,
html[data-theme="light"] .history-item,
html[data-theme="light"] .search-term a,
html[data-theme="light"] .bookmark-card a,
html[data-theme="light"] .video-item,
html[data-theme="light"] .video-item:hover,
html[data-theme="light"] .back-btn {
    color: #1f2430 !important;
}

html[data-theme="light"] .video-item:hover {
    background: #f2f3f5 !important;
}

/* Custom-named inputs / selects not covered by the standard .form-control rule */
html[data-theme="light"] .input-modern,
html[data-theme="light"] .referral-input,
html[data-theme="light"] .input-wrapper input,
html[data-theme="light"] .input-group-text,
html[data-theme="light"] .select2-container--default .select2-selection__rendered,
html[data-theme="light"] .select2-container--default .select2-search__field {
    background: #f4f5f7 !important;
    border-color: #e0e2e8 !important;
    color: #1f2430 !important;
}

html[data-theme="light"] .input-modern::placeholder,
html[data-theme="light"] .referral-input::placeholder,
html[data-theme="light"] .input-wrapper input::placeholder {
    color: #9aa1ac !important;
}

/* Pagination pills with custom class */
html[data-theme="light"] .pagination-custom .page-link {
    background: #ffffff !important;
    border-color: #e3e5ea !important;
    color: #374151 !important;
}

/* Muted white body text on glass/hero cards (rgba white) → readable grey */
html[data-theme="light"] .glass-card p,
html[data-theme="light"] .about-hero p,
html[data-theme="light"] .quote-card p,
html[data-theme="light"] .stats-box p,
html[data-theme="light"] .icon-box p,
html[data-theme="light"] .policy-text,
html[data-theme="light"] .faq-answer {
    color: #4b5563 !important;
}

/* Faded empty-state icons become visible on light */
html[data-theme="light"] .empty-state i,
html[data-theme="light"] .empty-state .fa-4x {
    color: #c4c8cf !important;
}

/* Ghost/outline buttons with transparent bg + white text → dark text on light border */
html[data-theme="light"] .btn-google,
html[data-theme="light"] .btn-outline,
html[data-theme="light"] .btn-modal-secondary,
html[data-theme="light"] .watch-btn,
html[data-theme="light"] .share-btn {
    background: #f4f5f7 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
}

html[data-theme="light"] .btn-google:hover,
html[data-theme="light"] .btn-outline:hover,
html[data-theme="light"] .btn-modal-secondary:hover {
    background: #e9eaec !important;
    color: #1f2430 !important;
}

/* Accordion button (premium page FAQ) */
html[data-theme="light"] .accordion-button {
    background: #f4f5f7 !important;
    color: #1f2430 !important;
}

html[data-theme="light"] .accordion-button:not(.collapsed) {
    background: rgba(255, 65, 108, 0.08) !important;
    color: #ff416c !important;
}

/* Theme toggle icon: show sun in light mode, moon in dark mode */
#themeToggleBtn .fa-sun {
    display: none;
}

html[data-theme="light"] #themeToggleBtn .fa-sun {
    display: inline-block;
}

html[data-theme="light"] #themeToggleBtn .fa-moon {
    display: none;
}

/* ==========================================================================
   LIGHT MODE FALLBACK — catches page-specific inline <style> blocks
   Har page ka apna alag <style> block hai jisme text color hardcode
   (color:#fff / white) hota hai — wo classes upar wali whitelist me
   cover nahi hoti, isliye light mode me text safed hi reh jaata tha.
   Ye rule generic text-bearing elements ko light mode me force black
   kar deta hai, chahe wo kisi bhi page ke inline style me define ho.
   ========================================================================== */
html[data-theme="light"] p,
html[data-theme="light"] span:not(.badge),
html[data-theme="light"] div:not(.gradient-text),
html[data-theme="light"] li,
html[data-theme="light"] label,
html[data-theme="light"] td,
html[data-theme="light"] th,
html[data-theme="light"] strong,
html[data-theme="light"] b,
html[data-theme="light"] a:not(.btn):not(.gradient-text):not([class*="btn-"]),
html[data-theme="light"] .form-control,
html[data-theme="light"] .form-label,
html[data-theme="light"] .form-check-label,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select {
    color: #1f2430 !important;
}

/* Dark mode ke liye bhi explicit safety-net — agar kabhi html se
   data-theme attribute hata diya jaaye to sab kuch wapas white ho jaaye */
html:not([data-theme="light"]) body {
    color: #fff;
}

/* Bootstrap's default muted text is too dim on the application's dark
   surfaces. Keep supporting copy, labels and empty states comfortably
   readable everywhere a page uses .text-muted. */
html:not([data-theme="light"]) .text-muted {
    color: rgba(255, 255, 255, 0.68) !important;
}

/* ======================================================================
   UX FOUNDATION
   Shared interaction patterns used across public and member pages.
   ====================================================================== */
:focus-visible {
    outline: 3px solid rgba(255, 75, 43, 0.72) !important;
    outline-offset: 3px;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.quick-start-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 24px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 101, 76, 0.35);
    border-radius: 18px;
    background: linear-gradient(120deg, rgba(255, 65, 108, 0.14), rgba(255, 75, 43, 0.06));
}

.quick-start-card h2 {
    margin: 0 0 5px;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 750;
}

.quick-start-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.quick-start-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-start-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.quick-start-action:hover {
    color: #fff;
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.quick-start-action.primary {
    border-color: transparent;
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
}

.import-help {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 13px 0 0;
    color: rgba(255, 255, 255, 0.65);
    font-size: .82rem;
    line-height: 1.5;
}

.import-subtitle {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: .875rem;
}

.import-help i {
    color: #fbbf24;
    margin-top: 3px;
}

.import-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.import-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.78);
    font-size: .77rem;
}

.import-step b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,65,108,.25);
    color: #fff;
    font-size: .68rem;
}

@media (max-width: 767.98px) {
    .quick-start-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .quick-start-actions {
        width: 100%;
    }

    .quick-start-action {
        flex: 1 1 145px;
    }
}

html[data-theme="light"] .quick-start-card {
    background: linear-gradient(120deg, rgba(255,65,108,.10), rgba(255,75,43,.04));
    border-color: rgba(255,65,108,.25);
}

html[data-theme="light"] .quick-start-card p,
html[data-theme="light"] .import-help,
html[data-theme="light"] .import-step,
html[data-theme="light"] .import-subtitle {
    color: #596273 !important;
}

html[data-theme="light"] .quick-start-action {
    color: #253047;
    background: #fff;
    border-color: #d9dde5;
}

html[data-theme="light"] .quick-start-action.primary,
html[data-theme="light"] .quick-start-action.primary:hover {
    color: #fff !important;
}
/* Shared video duration and multi-part folder preview. */
.vh-card-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0;color:#ddd;font-size:12px;line-height:1.5;white-space:normal}
.vh-duration,.vh-parts{display:inline-block;padding:3px 7px;border-radius:6px;background:#16161f;color:#fff}
.vh-parts{background:#592039}
.vh-folder-stack{position:relative;display:inline-block;width:66px;height:44px;flex-shrink:0}
.vh-stack-layer{position:absolute;left:0;top:0;width:56px;height:34px;border:1px solid #bd708c;border-radius:5px;overflow:hidden;background:#3b2737;transform:translate(8px,0)}
.vh-stack-layer:nth-child(2){transform:translate(4px,4px)}
.vh-stack-layer:nth-child(3){transform:translate(0,8px)}
.vh-folder-stack .vh-stack-layer img{width:100%!important;height:100%!important;object-fit:cover;border-radius:0!important}
.vh-folder-preview{position:absolute;inset:0;z-index:3;display:block;background:linear-gradient(135deg,rgba(22,12,28,.74),rgba(0,0,0,.4));overflow:hidden}
.vh-folder-page{position:absolute;width:73%;height:72%;left:50%;top:50%;transform:translate(-50%,-50%);border:2px solid rgba(255,255,255,.72);border-radius:8px;overflow:hidden;background:#281b31;box-shadow:0 6px 14px rgba(0,0,0,.4)}
.vh-folder-page:nth-child(1){transform:translate(-42%,-62%) rotate(8deg);opacity:.58}.vh-folder-page:nth-child(2){transform:translate(-58%,-50%) rotate(-5deg);opacity:.8}.vh-folder-page:nth-child(3){transform:translate(-50%,-45%)}
.vh-folder-page img{width:100%!important;height:100%!important;object-fit:cover!important}.vh-folder-page i{display:grid;place-items:center;height:100%;font-size:1.7rem;color:#fff}
.vh-folder-count{position:absolute;right:8px;bottom:8px;padding:4px 8px;border-radius:7px;background:#8b2d55;color:#fff;font-weight:800;font-size:.72rem;box-shadow:0 2px 8px rgba(0,0,0,.5)}
