/* YTN site-wide applied themes */
:root{--ytn-accent:#38bdf8;--ytn-bg:#020817;--ytn-surface:#0f172a;--ytn-surface-2:#111827;--ytn-text:#f8fafc;--ytn-muted:#94a3b8;--ytn-border:#334155}
body.ytn-accent-blue{--ytn-accent:#38bdf8}
body.ytn-accent-purple{--ytn-accent:#a855f7}
body.ytn-accent-green{--ytn-accent:#22c55e}
body.ytn-accent-pink{--ytn-accent:#ec4899}
body.ytn-accent-orange{--ytn-accent:#f97316}
body[class*="ytn-theme-"]{background:var(--ytn-bg)!important;color:var(--ytn-text)!important}
body[class*="ytn-theme-"] .main{background:var(--ytn-bg)!important;color:var(--ytn-text)!important;min-height:100vh}
body[class*="ytn-theme-"] .content{background:transparent!important}
body[class*="ytn-theme-"] .topbar{background:var(--ytn-surface)!important;border-color:var(--ytn-border)!important;color:var(--ytn-text)!important}
body[class*="ytn-theme-"] .panel,body[class*="ytn-theme-"] .stat-card,body[class*="ytn-theme-"] .card{background:var(--ytn-surface)!important;border-color:var(--ytn-border)!important;color:var(--ytn-text)!important}
body[class*="ytn-theme-"] .sidebar{background:#020817!important;border-color:var(--ytn-border)!important}
body[class*="ytn-theme-"] .muted,body[class*="ytn-theme-"] .footer-subtext{color:var(--ytn-muted)!important}
body[class*="ytn-theme-"] h1,body[class*="ytn-theme-"] h2,body[class*="ytn-theme-"] h3,body[class*="ytn-theme-"] label,body[class*="ytn-theme-"] th,body[class*="ytn-theme-"] td{color:var(--ytn-text)!important}
body[class*="ytn-theme-"] input,body[class*="ytn-theme-"] select,body[class*="ytn-theme-"] textarea{background:var(--ytn-surface-2)!important;color:var(--ytn-text)!important;border-color:var(--ytn-border)!important}
body[class*="ytn-theme-"] .btn.primary,body[class*="ytn-theme-"] button[type="submit"]{background:linear-gradient(90deg,var(--ytn-accent),#7c3aed)!important;color:white!important}
body[class*="ytn-theme-"] a{color:var(--ytn-accent)}
body.ytn-theme-dark{--ytn-bg:#020817;--ytn-surface:#0f172a;--ytn-surface-2:#111827;--ytn-text:#f8fafc;--ytn-muted:#94a3b8;--ytn-border:#334155}
body.ytn-theme-light{--ytn-bg:#f8fafc;--ytn-surface:#ffffff;--ytn-surface-2:#f1f5f9;--ytn-text:#0f172a;--ytn-muted:#475569;--ytn-border:#cbd5e1}
body.ytn-theme-light .sidebar{background:#0f172a!important;color:#f8fafc!important}
body.ytn-theme-light .sidebar a,body.ytn-theme-light .sidebar .brand{color:#f8fafc!important}
body.ytn-theme-kids{--ytn-bg:#fdf2f8;--ytn-surface:rgba(255,255,255,.92);--ytn-surface-2:#fce7f3;--ytn-text:#1e1b4b;--ytn-muted:#6b21a8;--ytn-border:#f0abfc;background:linear-gradient(135deg,#e0f2fe,#fce7f3,#ede9fe)!important}
body.ytn-theme-kids .main{background:linear-gradient(135deg,#e0f2fe,#fce7f3,#ede9fe)!important}
body.ytn-theme-kids .topbar{background:linear-gradient(90deg,#38bdf8,#a78bfa,#f472b6)!important;color:white!important}
body.ytn-theme-kids .topbar h1,body.ytn-theme-kids .topbar p{color:white!important}
body.ytn-theme-dino{--ytn-bg:#052e16;--ytn-surface:#064e3b;--ytn-surface-2:#065f46;--ytn-text:#ecfdf5;--ytn-muted:#bbf7d0;--ytn-border:#22c55e;background:linear-gradient(135deg,#052e16,#166534)!important}
body.ytn-theme-dino .main{background:linear-gradient(135deg,#052e16,#166534)!important}
body.ytn-theme-dinosoft{--ytn-bg:#d9e7f3;--ytn-surface:rgba(255,255,255,.88);--ytn-surface-2:rgba(241,245,249,.92);--ytn-text:#0f172a;--ytn-muted:#475569;--ytn-border:#93c5fd;background-color:#d9e7f3!important;background-image:url('/images/themes/dino-soft.webp')!important;background-repeat:repeat!important;background-size:520px!important;background-attachment:fixed!important}
body.ytn-theme-dinosoft .main{background:transparent!important}
body.ytn-theme-dinosoft .panel,body.ytn-theme-dinosoft .stat-card,body.ytn-theme-dinosoft .card{backdrop-filter:blur(10px);box-shadow:0 18px 55px rgba(15,23,42,.14)}
body.ytn-theme-dinosoft .topbar{background:rgba(255,255,255,.86)!important;backdrop-filter:blur(12px)}
body.ytn-theme-dinofun{--ytn-bg:#d5f3ec;--ytn-surface:rgba(255,255,255,.88);--ytn-surface-2:rgba(240,253,250,.92);--ytn-text:#0f172a;--ytn-muted:#475569;--ytn-border:#2dd4bf;background-color:#d5f3ec!important;background-image:url('/images/themes/dino-fun.jpg')!important;background-repeat:repeat!important;background-size:650px!important;background-attachment:fixed!important}
body.ytn-theme-dinofun .main{background:transparent!important}
body.ytn-theme-dinofun .panel,body.ytn-theme-dinofun .stat-card,body.ytn-theme-dinofun .card{backdrop-filter:blur(10px);box-shadow:0 18px 55px rgba(15,23,42,.14)}
body.ytn-theme-dinofun .topbar{background:rgba(255,255,255,.86)!important;backdrop-filter:blur(12px)}
body.ytn-theme-ocean{--ytn-bg:#082f49;--ytn-surface:#0c4a6e;--ytn-surface-2:#075985;--ytn-text:#ecfeff;--ytn-muted:#bae6fd;--ytn-border:#38bdf8;background:linear-gradient(135deg,#082f49,#075985,#0891b2)!important}
body.ytn-theme-ocean .main{background:linear-gradient(135deg,#082f49,#075985,#0891b2)!important}
body.ytn-theme-space{--ytn-bg:#020617;--ytn-surface:#11113a;--ytn-surface-2:#1e1b4b;--ytn-text:#f8fafc;--ytn-muted:#c4b5fd;--ytn-border:#6d28d9;background:radial-gradient(circle at top,#312e81,#020617 55%)!important}
body.ytn-theme-space .main{background:radial-gradient(circle at top,#312e81,#020617 55%)!important}
body.ytn-compact-menu .sidebar a,body.ytn-compact-menu .menu-group-links a{padding-top:5px!important;padding-bottom:5px!important;font-size:11.5px!important}
body.ytn-compact-menu .menu-group-toggle{padding-top:5px!important;padding-bottom:5px!important}


/* ==========================================================
   EXACT DASHBOARD FIX
   The Dashboard Index uses .ytn-card for the top stat boxes.
   These rules make those boxes readable on Dino Fun and all
   light/wallpaper themes without touching the layout.
   ========================================================== */

/* Top dashboard stat boxes */
body[class*="ytn-theme-"] .ytn-card {
    background: #111827 !important;
    color: #f8fafc !important;
    border: 1px solid #334155 !important;
    border-radius: 14px !important;
}

body[class*="ytn-theme-"] .ytn-card .muted,
body[class*="ytn-theme-"] .ytn-card .smalltext,
body[class*="ytn-theme-"] .ytn-card div,
body[class*="ytn-theme-"] .ytn-card span {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

body[class*="ytn-theme-"] .ytn-card .ytn-number {
    color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 800 !important;
}

/* Preserve the intended colored numbers on the Dashboard */
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="facc15"] { color: #facc15 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="38bdf8"] { color: #38bdf8 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="ef4444"] { color: #ef4444 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="22c55e"] { color: #22c55e !important; }

/* Dashboard inline dark boxes from Index.cshtml */
body[class*="ytn-theme-"] .panel div[style*="background:#0f172a"],
body[class*="ytn-theme-"] .panel div[style*="background: #0f172a"] {
    color: #f8fafc !important;
}

body[class*="ytn-theme-"] .panel div[style*="background:#0f172a"] *,
body[class*="ytn-theme-"] .panel div[style*="background: #0f172a"] * {
    color: #f8fafc !important;
    opacity: 1 !important;
}

body[class*="ytn-theme-"] .panel div[style*="background:#0f172a"] .muted,
body[class*="ytn-theme-"] .panel div[style*="background: #0f172a"] .muted,
body[class*="ytn-theme-"] .panel div[style*="background:#0f172a"] .smalltext,
body[class*="ytn-theme-"] .panel div[style*="background: #0f172a"] .smalltext {
    color: #cbd5e1 !important;
}

/* Keep green/red approved-blocked badges readable */
body[class*="ytn-theme-"] .badge[style*="background:#16a34a"],
body[class*="ytn-theme-"] .badge[style*="background: #16a34a"],
body[class*="ytn-theme-"] .badge[style*="background:#dc2626"],
body[class*="ytn-theme-"] .badge[style*="background: #dc2626"] {
    color: #ffffff !important;
}

/* Light / Kids / Dino Soft / Dino Fun Theme Preferences text readability */
body.ytn-theme-light .content h1,
body.ytn-theme-light .content h2,
body.ytn-theme-light .content h3,
body.ytn-theme-light .content p,
body.ytn-theme-kids .content h1,
body.ytn-theme-kids .content h2,
body.ytn-theme-kids .content h3,
body.ytn-theme-kids .content p,
body.ytn-theme-dinosoft .content h1,
body.ytn-theme-dinosoft .content h2,
body.ytn-theme-dinosoft .content h3,
body.ytn-theme-dinosoft .content p,
body.ytn-theme-dinofun .content h1,
body.ytn-theme-dinofun .content h2,
body.ytn-theme-dinofun .content h3,
body.ytn-theme-dinofun .content p {
    color: #0f172a !important;
    text-shadow: none !important;
}

/* Dark dashboard cards stay readable */
body.ytn-theme-light .ytn-card *,
body.ytn-theme-kids .ytn-card *,
body.ytn-theme-dinosoft .ytn-card *,
body.ytn-theme-dinofun .ytn-card * {
    color: #f8fafc !important;
    opacity: 1 !important;
}

/* Compact menu row readability if class exists */
body[class*="ytn-theme-"] .compact-menu-row,
body[class*="ytn-theme-"] .compact-menu-option,
body[class*="ytn-theme-"] .compact-menu-card,
body[class*="ytn-theme-"] .theme-compact-row,
body[class*="ytn-theme-"] .theme-compact-card {
    background: #111827 !important;
    color: #f8fafc !important;
}

body[class*="ytn-theme-"] .compact-menu-row *,
body[class*="ytn-theme-"] .compact-menu-option *,
body[class*="ytn-theme-"] .compact-menu-card *,
body[class*="ytn-theme-"] .theme-compact-row *,
body[class*="ytn-theme-"] .theme-compact-card * {
    color: #f8fafc !important;
}

/* Compact sidebar menu */
body.ytn-compact-menu .sidebar {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

body.ytn-compact-menu .brand {
    margin-bottom: 18px !important;
    font-size: 24px !important;
}

body.ytn-compact-menu nav a,
body.ytn-compact-menu .sidebar a,
body.ytn-compact-menu .menu-group-toggle,
body.ytn-compact-menu .menu-group-links a,
body.ytn-compact-menu .sidebar-menu a,
body.ytn-compact-menu .sidebar-nav a,
body.ytn-compact-menu .admin-menu a,
body.ytn-compact-menu .nav-link {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
    font-size: 11.5px !important;
    line-height: 1.15 !important;
}

body.ytn-compact-menu .logout-link {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    margin-top: 4px !important;
    font-size: 12px !important;
}


/* ==========================================================
   PHASE 1 TARGETED POLISH PATCH
   Applied after current theme rules.
   ========================================================== */

/* 1) Dino Fun / wallpaper dashboard hero readability */
body.ytn-theme-dinofun .actions {
    background: rgba(255,255,255,.82) !important;
    border: 1px solid rgba(45,212,191,.8) !important;
    border-radius: 16px !important;
    padding: 16px 18px !important;
    backdrop-filter: blur(10px);
}

body.ytn-theme-dinofun .actions h1,
body.ytn-theme-dinofun .actions .muted,
body.ytn-theme-dinofun .actions p,
body.ytn-theme-dinofun .actions div {
    color: #0f172a !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

body.ytn-theme-dinofun .actions .btn,
body.ytn-theme-dinofun .actions .btn *,
body.ytn-theme-dinofun .actions a.btn {
    color: #ffffff !important;
}

/* 2) Buttons need white readable text on all themes */
body[class*="ytn-theme-"] .btn,
body[class*="ytn-theme-"] .btn *,
body[class*="ytn-theme-"] a.btn,
body[class*="ytn-theme-"] button,
body[class*="ytn-theme-"] button * {
    color: #ffffff !important;
    opacity: 1 !important;
}

body[class*="ytn-theme-"] .btn:not(.primary) {
    background: #111827 !important;
    border-color: #334155 !important;
}

/* 3) Top dashboard .ytn-card text: exact class from Dashboard Index */
body[class*="ytn-theme-"] .ytn-card {
    background: #111827 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

body[class*="ytn-theme-"] .ytn-card *,
body[class*="ytn-theme-"] .ytn-card .muted,
body[class*="ytn-theme-"] .ytn-card .smalltext {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

body[class*="ytn-theme-"] .ytn-card .ytn-number {
    color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 800 !important;
}

body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="facc15"] { color: #facc15 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="38bdf8"] { color: #38bdf8 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="ef4444"] { color: #ef4444 !important; }
body[class*="ytn-theme-"] .ytn-card .ytn-number[style*="22c55e"] { color: #22c55e !important; }

/* 4) Inline dark child/alert boxes from Dashboard Index */
body[class*="ytn-theme-"] div[style*="background:#0f172a"],
body[class*="ytn-theme-"] div[style*="background: #0f172a"] {
    color: #f8fafc !important;
}

body[class*="ytn-theme-"] div[style*="background:#0f172a"] *,
body[class*="ytn-theme-"] div[style*="background: #0f172a"] * {
    color: #f8fafc !important;
    opacity: 1 !important;
}

body[class*="ytn-theme-"] div[style*="background:#0f172a"] .muted,
body[class*="ytn-theme-"] div[style*="background: #0f172a"] .muted,
body[class*="ytn-theme-"] div[style*="background:#0f172a"] .smalltext,
body[class*="ytn-theme-"] div[style*="background: #0f172a"] .smalltext {
    color: #cbd5e1 !important;
}

/* 5) Risk score badges in Recent Videos */
body[class*="ytn-theme-"] .badge.risk-low,
body[class*="ytn-theme-"] .badge.risk-medium,
body[class*="ytn-theme-"] .badge.risk-high {
    color: #0f172a !important;
    opacity: 1 !important;
    font-weight: 800 !important;
    border: 1px solid rgba(15,23,42,.18) !important;
}

body[class*="ytn-theme-"] .badge.risk-low {
    background: #bbf7d0 !important;
}

body[class*="ytn-theme-"] .badge.risk-medium {
    background: #fde68a !important;
}

body[class*="ytn-theme-"] .badge.risk-high {
    background: #fecaca !important;
}

/* 6) Theme Preferences light wallpaper page text */
body.ytn-theme-light .content h1,
body.ytn-theme-light .content h2,
body.ytn-theme-light .content h3,
body.ytn-theme-light .content p,
body.ytn-theme-kids .content h1,
body.ytn-theme-kids .content h2,
body.ytn-theme-kids .content h3,
body.ytn-theme-kids .content p,
body.ytn-theme-dinosoft .content h1,
body.ytn-theme-dinosoft .content h2,
body.ytn-theme-dinosoft .content h3,
body.ytn-theme-dinosoft .content p,
body.ytn-theme-dinofun .content h1,
body.ytn-theme-dinofun .content h2,
body.ytn-theme-dinofun .content h3,
body.ytn-theme-dinofun .content p {
    color: #0f172a !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* 7) Theme selection cards: readable text per card color */
body[class*="ytn-theme-"] .theme-card.theme-preview-light *,
body[class*="ytn-theme-"] .theme-card.theme-preview-kids *,
body[class*="ytn-theme-"] .theme-card.theme-preview-dinosoft *,
body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun *,
body[class*="ytn-theme-"] .theme-card.theme-preview-dino *,
body[class*="ytn-theme-"] .theme-card.theme-preview-ocean * {
    color: #0f172a !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

body[class*="ytn-theme-"] .theme-card.theme-preview-dark *,
body[class*="ytn-theme-"] .theme-card.theme-preview-space *,
body[class*="ytn-theme-"] .theme-card.accent-blue *,
body[class*="ytn-theme-"] .theme-card.accent-purple *,
body[class*="ytn-theme-"] .theme-card.accent-green *,
body[class*="ytn-theme-"] .theme-card.accent-pink *,
body[class*="ytn-theme-"] .theme-card.accent-orange * {
    color: #f8fafc !important;
    opacity: 1 !important;
}

/* Make Dino Fun preview readable over thumbnail */
body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun {
    position: relative !important;
    overflow: hidden !important;
}

body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun::before {
    content: "" !important;
    position: absolute !important;
    inset: 8px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,.76) !important;
    pointer-events: none !important;
}

body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun strong,
body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun span,
body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun div,
body[class*="ytn-theme-"] .theme-card.theme-preview-dinofun p {
    position: relative !important;
    z-index: 2 !important;
    color: #0f172a !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

/* Accent card title colors */
body[class*="ytn-theme-"] .theme-card.accent-blue strong { color: #38bdf8 !important; }
body[class*="ytn-theme-"] .theme-card.accent-purple strong { color: #a855f7 !important; }
body[class*="ytn-theme-"] .theme-card.accent-green strong { color: #22c55e !important; }
body[class*="ytn-theme-"] .theme-card.accent-pink strong { color: #ec4899 !important; }
body[class*="ytn-theme-"] .theme-card.accent-orange strong { color: #f97316 !important; }

/* 8) Compact Menu row title/description */
body[class*="ytn-theme-"] .compact-menu-row,
body[class*="ytn-theme-"] .compact-menu-option,
body[class*="ytn-theme-"] .compact-menu-card,
body[class*="ytn-theme-"] .theme-compact-row,
body[class*="ytn-theme-"] .theme-compact-card {
    background: #111827 !important;
    color: #f8fafc !important;
}

body[class*="ytn-theme-"] .compact-menu-row *,
body[class*="ytn-theme-"] .compact-menu-option *,
body[class*="ytn-theme-"] .compact-menu-card *,
body[class*="ytn-theme-"] .theme-compact-row *,
body[class*="ytn-theme-"] .theme-compact-card * {
    color: #f8fafc !important;
    opacity: 1 !important;
}

/* Fallback for current Compact Menu block if it has no custom class */
body[class*="ytn-theme-"] form label:has(input[name="CompactMenu"]),
body[class*="ytn-theme-"] form div:has(> input[name="CompactMenu"]) {
    color: #f8fafc !important;
}

body[class*="ytn-theme-"] form label:has(input[name="CompactMenu"]) *,
body[class*="ytn-theme-"] form div:has(> input[name="CompactMenu"]) * {
    color: #f8fafc !important;
    opacity: 1 !important;
}


/* Keep all portal risk score badges consistent, even when user themes are active. */
body[class*="ytn-theme-"] .badge.risk-low,body[class*="ytn-theme-"] .risk-low{background:linear-gradient(135deg,#bbf7d0,#86efac)!important;color:#052e16!important}
body[class*="ytn-theme-"] .badge.risk-medium,body[class*="ytn-theme-"] .risk-medium{background:linear-gradient(135deg,#fde68a,#facc15)!important;color:#111827!important}
body[class*="ytn-theme-"] .badge.risk-orange,body[class*="ytn-theme-"] .risk-orange{background:linear-gradient(135deg,#fdba74,#f97316)!important;color:#111827!important}
body[class*="ytn-theme-"] .badge.risk-high,body[class*="ytn-theme-"] .risk-high{background:linear-gradient(135deg,#f87171,#ef4444)!important;color:#fff!important}
body[class*="ytn-theme-"] .badge.risk-critical,body[class*="ytn-theme-"] .risk-critical{background:linear-gradient(135deg,#7f1d1d,#581c87)!important;color:#fff!important}

/* YTN unified numeric risk score colors - final override
   0-9 Safe=green, 10-24 Low=yellow, 25-49 Medium=orange, 50-74 High=red, 75-100 Critical=dark red/purple */
.badge.risk-low,.risk-low{background:linear-gradient(135deg,#bbf7d0,#86efac)!important;color:#052e16!important;border:1px solid rgba(134,239,172,.55)!important;box-shadow:0 0 0 1px rgba(134,239,172,.10),0 6px 18px rgba(34,197,94,.16)!important}
.badge.risk-medium,.risk-medium{background:linear-gradient(135deg,#fde68a,#facc15)!important;color:#111827!important;border:1px solid rgba(250,204,21,.55)!important;box-shadow:0 0 0 1px rgba(250,204,21,.10),0 6px 18px rgba(245,158,11,.18)!important}
.badge.risk-orange,.risk-orange{background:linear-gradient(135deg,#fdba74,#f97316)!important;color:#111827!important;border:1px solid rgba(249,115,22,.60)!important;box-shadow:0 0 0 1px rgba(249,115,22,.10),0 6px 18px rgba(249,115,22,.22)!important}
.badge.risk-high,.risk-high{background:linear-gradient(135deg,#f87171,#dc2626)!important;color:#fff!important;border:1px solid rgba(248,113,113,.60)!important;box-shadow:0 0 0 1px rgba(248,113,113,.10),0 6px 18px rgba(220,38,38,.24)!important}
.badge.risk-critical,.risk-critical{background:linear-gradient(135deg,#7f1d1d,#581c87)!important;color:#fff!important;border:1px solid rgba(168,85,247,.60)!important;box-shadow:0 0 0 1px rgba(168,85,247,.10),0 6px 18px rgba(127,29,29,.30)!important}
