/* ============================================================
   MASTI MODE — PREMIUM THEME SYSTEM
   Modern streaming platform UI · Dark & Light themes
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root,
[data-theme="light"] {
    color-scheme: light;

    /* Backgrounds */
    --bg-primary: #FAFAFA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-navbar: rgba(255, 255, 255, 0.92);
    --bg-hover: #F0F0F0;
    --bg-inset: #F3F3F3;

    /* Borders */
    --border-color: #E5E5E5;
    --border-strong: #D4D4D4;

    /* Text */
    --text-primary: #171717;
    --text-secondary: #525252;
    --text-muted: #8A8A8A;
    --text-invert: #FFFFFF;

    /* Accents */
    --accent: #B91C1C;
    --accent-2: #DC2626;
    --accent-hover: #991B1B;
    --accent-soft: rgba(185, 28, 28, 0.1);
    --gradient-accent: linear-gradient(135deg, #B91C1C 0%, #DC2626 100%);
    --gradient-soft: linear-gradient(135deg, rgba(185,28,28,0.12), rgba(220,38,38,0.12));

    /* Semantic */
    --success: #16A34A;
    --warning: #D97706;
    --danger: #DC2626;
    --info: #C2410C;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 16px 40px rgba(185, 28, 28, 0.16);
    --shadow-nav: 0 4px 24px rgba(0, 0, 0, 0.08);

    /* Misc */
    --modal-backdrop: rgba(0, 0, 0, 0.5);
    --announcement-bg: linear-gradient(90deg, #7F1D1D, #B91C1C, #DC2626);
    --glass-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    color-scheme: dark;

    /* Backgrounds */
    --bg-primary: #080808;
    --bg-secondary: #0F0F0F;
    --bg-card: #151515;
    --bg-navbar: rgba(8, 8, 8, 0.9);
    --bg-hover: #1F1F1F;
    --bg-inset: #111111;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* Text */
    --text-primary: #F5F5F5;
    --text-secondary: #A3A3A3;
    --text-muted: #737373;
    --text-invert: #FFFFFF;

    /* Accents */
    --accent: #DC2626;
    --accent-2: #EF4444;
    --accent-hover: #EF4444;
    --accent-soft: rgba(220, 38, 38, 0.14);
    --gradient-accent: linear-gradient(135deg, #B91C1C 0%, #DC2626 100%);
    --gradient-soft: linear-gradient(135deg, rgba(185,28,28,0.18), rgba(220,38,38,0.18));

    /* Semantic */
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #F59E0B;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.55);
    --shadow-hover: 0 18px 46px rgba(220, 38, 38, 0.2);
    --shadow-nav: 0 4px 24px rgba(0, 0, 0, 0.6);

    /* Misc */
    --modal-backdrop: rgba(0, 0, 0, 0.75);
    --announcement-bg: linear-gradient(90deg, #7F1D1D, #B91C1C, #DC2626);
    --glass-bg: rgba(21, 21, 21, 0.72);
}

/* ---------- Base ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

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

*::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.theme-transition,
.theme-transition body {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
}

/* Smooth page entrance */
.main-wrapper {
    animation: pageFadeIn 0.45s ease both;
    /* Fixed announcement bar (38px) + fixed navbar (top:38px) cover the top of the page on
       ALL screen sizes. Reserve space on desktop/tablet too (previously mobile-only, which
       hid the top content — including the admin quick actions — behind the navbar on desktop). */
    padding-top: 110px;
}

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

/* ---------- Theme-aware text utilities ---------- */
.tx-main  { color: var(--text-primary) !important; }
.tx-body  { color: var(--text-secondary) !important; }
.tx-soft  { color: var(--text-muted) !important; }
.tx-accent { color: var(--accent) !important; }
.tx-danger { color: var(--danger) !important; }
.tx-success { color: var(--success) !important; }
.tx-warning { color: var(--warning) !important; }
.tx-invert { color: var(--text-invert) !important; }

.bg-soft-accent { background: var(--accent-soft) !important; }
.border-theme { border-color: var(--border-color) !important; }

/* ---------- Announcement Bar ---------- */
.announcement-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 38px;
    background: var(--announcement-bg);
    z-index: 1060;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.announcement-bar-track {
    display: flex;
    white-space: nowrap;
    animation: announcementScroll 20s linear infinite;
}

.announcement-text {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 0 60px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.announcement-icon {
    font-size: 0.85rem;
}

.announcement-highlight {
    color: #ffffff;
    font-weight: 800;
    background: rgba(0, 0, 0, 0.22);
    padding: 2px 10px;
    border-radius: 20px;
}

@keyframes announcementScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------- Navbar ---------- */
.navbar-premium {
    background: var(--bg-navbar) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    top: 38px !important;
    min-height: 64px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.navbar-premium.navbar-scrolled {
    box-shadow: var(--shadow-nav);
}

.navbar-premium .navbar-nav .nav-link,
.navbar-premium .navbar-nav .nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    border-radius: 10px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar-premium .navbar-nav .nav-link:hover,
.navbar-premium .navbar-nav .nav-link-custom:hover,
.navbar-premium .navbar-nav .nav-link.active {
    color: var(--text-primary) !important;
    background: var(--bg-hover);
}

.navbar-premium .navbar-nav .nav-link.active {
    color: var(--accent) !important;
    font-weight: 600;
}

.navbar-premium .navbar-toggler {
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
}

.brand-text {
    font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
    font-size: 1.4rem;
    transition: opacity 0.2s ease;
}

.brand-text:hover {
    opacity: 0.85;
}

/* Site brand: admin-configured logo + site name always shown together.
   The image is a brand mark — it never replaces the Masti Mode text. */
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}

.site-brand .site-brand-name {
    display: inline-block;
    white-space: nowrap;
    color: var(--text-primary);
    font-weight: 700;
}

.site-brand .brand-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-brand .brand-logo-mark i {
    color: var(--text-invert);
}

/* Brand logo (admin-configured image) + fallback mark */
.brand-logo-img {
    max-height: 42px;
    height: 38px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--gradient-accent);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35);
    flex-shrink: 0;
}

/* Navbar dropdown */
.navbar-premium .dropdown-menu {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-card) !important;
    padding: 8px;
}

.navbar-premium .dropdown-menu .dropdown-item {
    color: var(--text-secondary) !important;
    border-radius: 9px;
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
    transition: all 0.18s ease;
}

.navbar-premium .dropdown-menu .dropdown-item:hover,
.navbar-premium .dropdown-menu .dropdown-item:focus {
    background: var(--accent-soft) !important;
    color: var(--accent) !important;
}

.navbar-premium .dropdown-menu .dropdown-item.active {
    background: var(--gradient-accent) !important;
    color: #fff !important;
}

.navbar-premium .dropdown-menu .dropdown-divider {
    border-top: 1px solid var(--border-color);
}

/* ---------- Search Box ---------- */
.search-form {
    position: relative;
    flex: 1 1 auto;
    max-width: 480px;
    min-width: 200px;
}

.search-form .search-input {
    background: var(--bg-inset);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.55rem 3rem 0.55rem 2.6rem;
    height: 44px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.search-form .search-input::placeholder {
    color: var(--text-muted);
}

.search-form .search-input:focus {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    outline: none;
}

.search-form .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-form .search-input:focus ~ .search-icon {
    color: var(--accent);
}

.search-form .search-clear-btn {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 50%;
    display: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.search-form .search-clear-btn:hover {
    color: var(--danger);
    background: var(--bg-hover);
}

.search-form .search-submit {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: none;
    background: var(--gradient-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.search-form .search-submit:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.search-form .search-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Search suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    z-index: 1080;
    display: none;
    animation: slideDown 0.2s ease both;
}

.search-suggestions.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: var(--bg-hover);
}

.suggestion-item img {
    width: 52px;
    height: 34px;
    object-fit: cover;
    border-radius: 7px;
    flex-shrink: 0;
}

.suggestion-item .suggestion-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.suggestion-item .suggestion-cat {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-loading {
    position: absolute;
    right: 46px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.search-loading.show {
    display: block;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

.search-suggestions .suggestion-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-suggestions .suggestion-empty i {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.6;
}

/* ---------- Hero Section ---------- */
.hero-section {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--gradient-soft);
    border: 1px solid var(--border-color);
    padding: 34px 28px;
    margin-top: 24px;
    margin-bottom: 28px;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.28), transparent 70%);
    pointer-events: none;
}

.hero-section::after {
    content: "";
    position: absolute;
    bottom: -50%;
    left: -5%;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.2), transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.hero-title {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 10px;
}

.hero-title .gradient-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 520px;
    margin-bottom: 20px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.hero-stat {
    text-align: center;
}

.hero-stat strong {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.hero-stat span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Section Headers ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent);
    font-size: 1.05em;
}

.section-link {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.section-link:hover {
    gap: 10px;
    color: var(--accent-hover);
}

/* ---------- Trending Section ---------- */
.trending-section {
    margin-top: 24px;
}

.trending-section .section-title {
    color: var(--text-primary);
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section-divider::before,
.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* ---------- Video Cards ---------- */
.video-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.28s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.28s ease, border-color 0.28s ease;
    height: 100%;
    box-shadow: var(--shadow-sm);
}

.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-2);
}

.video-thumbnail-wrapper {
    position: relative;
    display: block;
    width: 100%;
    padding-top: 56.25%;
    background-color: var(--bg-inset);
    overflow: hidden;
}

.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.06);
    filter: brightness(0.85);
}

/* Badges over thumbnail */
.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
}

.video-hd-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    z-index: 2;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.75);
    background: var(--gradient-accent);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 26px rgba(220, 38, 38, 0.5);
    z-index: 2;
}

.video-card:hover .video-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.video-card:hover .video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.card-title-link {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.card-title-link:hover {
    color: var(--accent);
}

.video-card-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.video-card-stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.video-card-stats i {
    color: var(--accent);
    font-size: 0.82rem;
}

/* Keyword highlight */
mark.search-hl {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 4px;
    padding: 0 2px;
    font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient {
    background: var(--gradient-accent);
    border: none;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.4);
}

.btn-gradient:hover,
.btn-gradient:focus {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(220, 38, 38, 0.55);
    color: #fff !important;
}

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

.btn-outline-theme {
    background: transparent;
    border: 1.5px solid var(--border-strong);
    color: var(--text-primary);
}

.btn-outline-theme:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.btn.btn-rounded {
    border-radius: 50px;
}

.btn.btn-danger {
    background: linear-gradient(135deg, #EF4444, #F97316);
    border: none;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

.btn.btn-danger:hover {
    box-shadow: 0 10px 26px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

.btn.btn-outline-danger {
    border: 1.5px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* Ripple effect */
.ripple-ink {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(3);
        opacity: 0;
    }
}

/* ---------- Theme Toggle ---------- */
.theme-toggle-btn {
    border: 1.5px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
    background: var(--gradient-accent);
    color: #fff;
    transform: rotate(20deg) scale(1.05);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.theme-toggle-btn i {
    transition: transform 0.3s ease;
}

/* ---------- Sidebar ---------- */
.sidebar-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-card);
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}

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

.sidebar-panel .list-group-item {
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px !important;
    margin-bottom: 2px;
    transition: all 0.18s ease;
}

.sidebar-panel .list-group-item:hover,
.sidebar-panel .list-group-item:focus {
    background: var(--bg-hover);
    color: var(--accent);
    padding-left: 12px;
}

.sidebar-panel .list-group-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.sidebar-video-item {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.sidebar-video-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.sidebar-video-thumb {
    width: 92px;
    height: 60px;
    aspect-ratio: 92 / 60;
    object-fit: cover;
    border-radius: 9px;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-video-item:hover .sidebar-video-thumb {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.sidebar-video-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
    min-height: 2.7em;
    transition: color 0.18s ease;
}

.sidebar-video-title:hover {
    color: var(--accent);
}

/* Discover More grid: exactly 1 video per row on desktop, tablet and mobile.
   Items reuse the exact same .sidebar-video-item markup/styles as Recent Videos
   (thumbnail left, title + views right) — only the wrapper enforces 1 per row. */
.discover-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

/* ---------- Video Player ---------- */
.video-player-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.video-player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.meta-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
}

.video-title-page {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 50px;
    font-size: 0.86rem;
    font-weight: 600;
}

.stat-pill i {
    color: var(--accent);
}

.stat-pill strong {
    color: var(--text-primary);
}

/* ---------- Tags ---------- */
.tag-badge {
    background: var(--bg-inset);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 7px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.22s ease;
    display: inline-block;
    margin-right: 6px;
    margin-bottom: 8px;
    text-decoration: none;
}

.tag-badge:hover {
    background: var(--gradient-accent);
    color: #fff !important;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
}

/* ---------- Empty State ---------- */
.empty-state {
    background-color: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: 18px;
    padding: 56px 24px;
    text-align: center;
    animation: pageFadeIn 0.4s ease both;
}

.empty-state .empty-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--accent);
    animation: floaty 3s ease-in-out infinite;
}

@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ---------- Pagination ---------- */
.pagination-premium .page-link {
    background-color: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border-color);
    margin: 0 4px;
    border-radius: 10px !important;
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-premium .page-link:hover {
    background-color: var(--bg-hover);
    color: var(--accent);
    transform: translateY(-2px);
}

.pagination-premium .page-item.active .page-link {
    background: var(--gradient-accent);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.pagination-premium .page-item.disabled .page-link {
    background-color: var(--bg-inset);
    color: var(--text-muted);
    opacity: 0.6;
    transform: none;
}

/* ---------- Modals ---------- */
.modal-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: var(--modal-backdrop);
}

.modal-content-premium {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-hover) !important;
}

.modal-header-premium {
    border-bottom: 1px solid var(--border-color) !important;
}

.modal-footer-premium {
    border-top: 1px solid var(--border-color) !important;
}

.glass-modal {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px !important;
    overflow: hidden;
    color: var(--text-primary) !important;
}

.glass-modal .text-secondary {
    color: var(--text-secondary) !important;
}

.glass-modal h4,
.glass-modal h5 {
    color: var(--text-primary);
}

.neon-border {
    border: 1.5px solid var(--accent) !important;
    box-shadow:
        0 0 14px rgba(220, 38, 38, 0.5),
        0 0 40px rgba(220, 38, 38, 0.18),
        inset 0 0 18px rgba(220, 38, 38, 0.08) !important;
    animation: borderPulse 3s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        box-shadow: 0 0 14px rgba(220, 38, 38, 0.5), 0 0 40px rgba(220, 38, 38, 0.18), inset 0 0 18px rgba(220, 38, 38, 0.08);
    }
    50% {
        box-shadow: 0 0 26px rgba(220, 38, 38, 0.9), 0 0 60px rgba(220, 38, 38, 0.32), inset 0 0 28px rgba(220, 38, 38, 0.14);
    }
}

#telegramModal .modal-dialog {
    max-width: 400px;
}

.pulse-icon {
    display: inline-block;
    animation: iconPulse 2.2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--accent));
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px var(--accent)); }
    50% { transform: scale(1.12); filter: drop-shadow(0 0 22px var(--accent)) drop-shadow(0 0 40px rgba(220, 38, 38, 0.4)); }
}

@keyframes animatePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.animate-pulse { animation: animatePulse 1.4s ease-in-out infinite; }

.btn-gradient-glow {
    background: var(--gradient-accent);
    border: none;
    border-radius: 50px !important;
    color: #fff !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.5);
}

.btn-gradient-glow:hover,
.btn-gradient-glow:focus {
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.75), 0 0 0 3px rgba(220, 38, 38, 0.25);
    color: #fff !important;
}

.tg-badge {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    border-radius: 50px;
    animation: animatePulse 1.8s ease-in-out infinite;
}

.tg-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 0.75rem 0;
    border: none;
}

.btn-ghost-tg {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

.btn-ghost-tg:hover {
    color: var(--text-primary) !important;
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    background-color: var(--bg-inset);
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    color: var(--text-primary);
}

.form-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.form-outline .form-control {
    background: var(--bg-inset);
}

.form-outline .form-control:focus {
    background: var(--bg-card);
}

.form-outline .form-label {
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.form-outline .form-control:focus ~ .form-label,
.form-outline .form-control.active ~ .form-label {
    color: var(--accent);
}

.form-text {
    color: var(--text-muted);
}

label.form-label {
    color: var(--text-secondary);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-valid {
    border-color: var(--success);
}

/* MDB floating label text colors */
.form-outline .form-label {
    background: transparent;
    padding: 0 4px;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-info {
    background: rgba(96, 165, 250, 0.12);
    color: var(--info);
    border-color: rgba(96, 165, 250, 0.3);
}

.alert .btn-close {
    filter: none;
    opacity: 0.7;
}

/* ---------- Admin Panel ---------- */
.admin-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.admin-table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--bg-hover);
    --bs-table-striped-bg: var(--bg-inset);
    --bs-table-color: var(--text-primary);
    --bs-table-hover-color: var(--text-primary);
}

.admin-table th {
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color) !important;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.admin-table td {
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.admin-stat-card {
    border-left: 5px solid var(--accent);
}

.admin-stat-card h3,
.admin-stat-card h6 {
    color: var(--text-primary);
}

.admin-stat-card .text-muted {
    color: var(--text-muted) !important;
}

.table-responsive {
    border-radius: 12px;
}

/* ---------- Branding Preview (Admin) ---------- */
.branding-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    background: var(--bg-inset);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
}

.branding-preview img {
    border-radius: 8px;
}

.branding-preview-fallback {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.branding-preview-fallback .brand-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* ---------- Back to Top ---------- */
#btn-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: none;
    background: var(--gradient-accent);
    border: 0;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.5);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#btn-back-to-top:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.65);
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-disclaimer {
    padding: 32px 0 24px;
    text-align: center;
}

.footer-disclaimer p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer-disclaimer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-disclaimer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.footer-links {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.footer-dot {
    color: var(--border-strong);
    margin: 0 4px;
    font-size: 0.6rem;
}

.footer-copyright {
    text-align: center;
    padding: 18px 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--bg-inset);
}

.footer-copyright strong {
    color: var(--text-primary);
}

/* ---------- Info Pages ---------- */
.info-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 36px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-card);
}

.info-page-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--accent);
    margin: 0 auto 20px;
}

.info-page-icon-warning {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.info-page-title {
    text-align: center;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-page-divider {
    width: 60px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 10px;
    margin: 0 auto 28px;
}

.info-page-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
}

.info-page-content h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.info-page-content ul,
.info-page-content ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.info-page-content li {
    margin-bottom: 8px;
}

.info-page-content strong {
    color: var(--text-primary);
}

.info-page-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.info-page-content a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.info-page-contact-box {
    background: var(--accent-soft);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    padding: 14px 20px;
    color: var(--accent);
    font-size: 0.95rem;
    display: inline-block;
    margin-top: 8px;
}

.info-page-email-link {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

.info-page-email-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.info-page-warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
    color: var(--warning);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* ---------- Login / Auth Pages ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(220, 38, 38, 0.12), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(239, 68, 68, 0.1), transparent 45%),
        var(--bg-primary);
    padding: 24px 0;
}

.auth-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-card);
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-inset);
    border-radius: 12px;
}

.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.12), transparent);
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.skeleton-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.skeleton-thumb {
    padding-top: 56.25%;
    position: relative;
}

.skeleton-line {
    height: 12px;
    margin: 10px 14px 0;
    border-radius: 6px;
}

.skeleton-line.short {
    width: 55%;
    margin-bottom: 14px;
}

/* ---------- MDB overrides for theme ---------- */
.dropdown-menu,
.list-group,
.list-group-item {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dropdown-item {
    color: var(--text-secondary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

.dropdown-menu {
    box-shadow: var(--shadow-card) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Cards that rely on MDB default */
.card {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.badge {
    font-weight: 600;
}

.badge.bg-danger {
    background: var(--gradient-accent) !important;
}

.btn-close {
    filter: var(--btn-close-filter, none);
}

[data-theme="light"] .btn-close {
    --btn-close-filter: none;
}

[data-theme="dark"] .btn-close {
    --btn-close-filter: invert(1);
}

/* Navbar toggler icon color in dark */
.navbar-toggler-icon {
    background-image: none;
}

/* Table borders */
.table {
    --bs-table-border-color: var(--border-color);
    --bs-table-color: var(--text-primary);
}

/* ============================================================
   TEXT VISIBILITY / CONTRAST AUDIT
   Guarantee readable text on every surface in BOTH themes.
   ============================================================ */

/* Base form controls — explicit readable colors for every theme.
   (scoped out: checkbox/radio/range/color keep their native look) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
textarea,
select {
    color: var(--text-primary);
    background-color: var(--bg-inset);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"])::placeholder,
textarea::placeholder,
select::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* Autofill must never leave white-on-white / dark-on-dark text */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-inset) inset;
    caret-color: var(--text-primary);
}

[data-theme="light"] input:-webkit-autofill,
[data-theme="light"] input:-webkit-autofill:hover,
[data-theme="light"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-inset) inset;
    caret-color: var(--text-primary);
}

/* Dark theme: neutralize Bootstrap/MDB text helpers that default to dark-on-dark */
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-dark,
[data-theme="dark"] .text-black,
[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-primary {
    color: var(--accent) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* MDB form-outline: readable input/label colors, theme-accent focus (no default blue) */
.form-outline .form-control {
    color: var(--text-primary) !important;
    background-color: var(--bg-inset) !important;
    caret-color: var(--text-primary);
}

.form-outline .form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-outline .form-control:focus,
.form-outline .form-control.active {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 0 4px var(--accent-soft) !important;
}

.form-outline .form-label {
    color: var(--text-muted) !important;
    background: transparent !important;
}

.form-outline .form-control:focus ~ .form-label,
.form-outline .form-control.active ~ .form-label {
    color: var(--accent) !important;
}

/* MDB form-outline notch borders follow the theme instead of default gray/blue */
.form-outline .form-notch .form-notch-leading,
.form-outline .form-notch .form-notch-middle,
.form-outline .form-notch .form-notch-trailing {
    border-color: var(--border-color) !important;
}

.form-outline .form-control:focus ~ .form-notch .form-notch-leading,
.form-outline .form-control:focus ~ .form-notch .form-notch-middle,
.form-outline .form-control:focus ~ .form-notch .form-notch-trailing,
.form-outline .form-control.active ~ .form-notch .form-notch-leading,
.form-outline .form-control.active ~ .form-notch .form-notch-middle,
.form-outline .form-control.active ~ .form-notch .form-notch-trailing {
    border-color: var(--accent) !important;
}

/* Select dropdown: readable text + visible caret + readable option list */
.form-select {
    color: var(--text-primary);
    background-color: var(--bg-inset);
}

.form-select option {
    color: var(--text-primary);
    background-color: var(--bg-card);
}

[data-theme="dark"] .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%23A3A3A3' d='M1.5 5l6 6 6-6z'/%3e%3c/svg%3e");
}

/* Checkbox / radio labels */
.form-check-label,
.form-check-label:hover {
    color: var(--text-secondary);
}

/* Modals: every text layer explicit */
.modal-content,
.modal-content .modal-title,
.modal-content .modal-body,
.modal-content .modal-footer {
    color: var(--text-primary);
}

.modal-content .modal-title {
    font-weight: 700;
}

/* Cards + admin cards: headings always inherit a readable color */
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.admin-card h1, .admin-card h2, .admin-card h3, .admin-card h4, .admin-card h5, .admin-card h6 {
    color: var(--text-primary);
}

/* Admin forms: labels / help text always readable */
.admin-card .form-label,
.admin-card label.form-label {
    color: var(--text-secondary);
}

.admin-card .form-text {
    color: var(--text-muted);
}

/* Navbar brand name explicitly readable in both themes */
.navbar-premium .site-brand-name {
    color: var(--text-primary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .navbar-premium .navbar-collapse {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        padding: 14px;
        margin-top: 10px;
        box-shadow: var(--shadow-card);
    }

    .search-form {
        max-width: 100%;
        margin-bottom: 12px;
    }

    .search-suggestions {
        position: absolute;
    }

    .navbar-premium .navbar-nav {
        align-items: stretch !important;
    }

    .theme-toggle-btn {
        margin: 4px 0;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 26px 20px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .info-page-card {
        padding: 28px 20px;
    }

    .info-page-title {
        font-size: 1.4rem;
    }

    .footer-disclaimer p {
        font-size: 0.8rem;
    }

    .footer-links a {
        font-size: 0.82rem;
        padding: 3px 5px;
    }

    .video-card-stats {
        font-size: 0.7rem;
        gap: 10px;
    }

    .admin-card {
        padding: 16px;
    }

    .section-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 575.98px) {
    .video-title-page {
        font-size: 1.2rem;
    }

    .video-play-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    /* Keep [Logo] MastiMode visible together on phones without crowding the menu */
    .site-brand .brand-logo-img {
        max-height: 34px;
        height: 30px;
    }

    .site-brand .brand-text {
        font-size: 1.1rem;
    }
}

/* ---------- Accessibility ---------- */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

@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;
    }
}

/* ---------- Utility helpers ---------- */
.fs-7 { font-size: 0.85rem !important; }
.fs-8 { font-size: 0.75rem !important; }
.fs-9 { font-size: 0.7rem !important; }

.tracking-wider { letter-spacing: 0.08em; }

.hover-accent { transition: color 0.2s ease, background-color 0.2s ease; }
.hover-accent:hover { color: var(--accent) !important; }

.font-sm { font-size: 0.8rem; }

.btn-floating {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}
