
/* ===== Complete theme compatibility patch ===== */
:root{
    --theme-page:#dcecf5;
    --theme-surface:#ffffff;
    --theme-surface-2:#f1f8fb;
    --theme-surface-3:#e7f3f8;
    --theme-text:#263d4b;
    --theme-heading:#183e55;
    --theme-muted:#627985;
    --theme-border:#abc3ce;
    --theme-shadow:#89a7b5;
    --theme-input:#ffffff;
    --theme-link:#176f9d;
    --theme-header:#176f9d;
    --theme-header-2:#105f8d;
    --theme-footer:#102f43;
    --theme-footer-text:#cfe6f2;
    --theme-warning:#f3c641;
    --theme-success:#dff5e3;
    --theme-danger:#f7dddd;
}

html[data-theme="dark"],
html[data-resolved-theme="dark"]{
    color-scheme:dark;
    --theme-page:#0d171f;
    --theme-surface:#162630;
    --theme-surface-2:#1c303c;
    --theme-surface-3:#223945;
    --theme-text:#e8f4f9;
    --theme-heading:#ffffff;
    --theme-muted:#9fb8c5;
    --theme-border:#385968;
    --theme-shadow:#071117;
    --theme-input:#0f202a;
    --theme-link:#70c9ef;
    --theme-header:#102e41;
    --theme-header-2:#0b2231;
    --theme-footer:#061119;
    --theme-footer-text:#bed8e5;
    --theme-warning:#bd9325;
    --theme-success:#193c26;
    --theme-danger:#442326;
}

html,body{
    background:var(--theme-page)!important;
    color:var(--theme-text)!important;
}

body,
main,
.wrap{
    color:var(--theme-text);
}

h1,h2,h3,h4,h5,h6,
.section-heading h2,
.v4-heading h2{
    color:var(--theme-heading);
}

p,small,.muted,
.team-member-bio,
.public-news-content p,
.v4-news-copy p,
.v4-event-card p,
.apply-point p,
.profile-description{
    color:var(--theme-muted);
}

a{
    color:var(--theme-link);
}

/* Header and navigation */
.topbar{
    background:linear-gradient(var(--theme-header),var(--theme-header-2))!important;
}

.main-nav a{
    color:#eaf7fc!important;
}

.main-nav a:hover,
.main-nav a.active{
    color:#3e2e00!important;
}

.site-announcement{
    background:var(--theme-footer)!important;
    color:var(--theme-footer-text)!important;
}

.more-menu{
    position:relative;
}

.more-menu > button{
    appearance:none;
    border:1px solid rgba(255,255,255,.15);
    background:rgba(255,255,255,.08);
    color:#fff;
    border-radius:5px;
    padding:9px 11px;
    cursor:pointer;
    font:inherit;
    font-weight:bold;
}

.more-menu-dropdown{
    display:none;
    position:absolute;
    right:0;
    top:calc(100% + 7px);
    min-width:210px;
    background:var(--theme-surface);
    border:3px solid var(--theme-border);
    border-radius:8px;
    box-shadow:0 5px 0 var(--theme-shadow),0 15px 30px rgba(0,0,0,.2);
    padding:7px;
    z-index:100;
}

.more-menu:hover .more-menu-dropdown,
.more-menu:focus-within .more-menu-dropdown{
    display:grid;
}

.more-menu-dropdown a{
    color:var(--theme-text)!important;
    background:var(--theme-surface-2)!important;
    border:1px solid var(--theme-border)!important;
    margin:3px 0;
}

/* Every major card and panel */
.pixel-card,
.public-news-card,
.today-show-card,
.v4-news-card,
.v4-schedule-widget,
.v4-event-card,
.v4-team-mini,
.apply-form-card,
.apply-info-card,
.schedule-day,
.public-schedule-card,
.public-team-card,
.team-v4-card,
.optimized-team-card,
.optimized-profile-hero,
.profile-news-list,
.profile-show-list article,
.competition-card,
.poll-card,
.spotlight-card,
.change-content,
.contact-options article,
.article-page,
.empty-public-card,
.event-page-card,
.request-options article,
.dj-control-card,
.admin-panel-card,
.admin-heading,
.admin-top,
.admin-stat,
.manage-item,
.rank-admin-card,
.rank-assignment-card,
.optimized-staff-card,
.application-admin-card{
    background:var(--theme-surface)!important;
    color:var(--theme-text)!important;
    border-color:var(--theme-border)!important;
    box-shadow:0 4px 0 var(--theme-shadow)!important;
}

.admin-page{
    background:var(--theme-page)!important;
}

.admin-content,
.admin-shell{
    color:var(--theme-text)!important;
}

.admin-card-heading,
.manage-item,
.admin-list-row,
.compact-row,
.audit-row{
    border-color:var(--theme-border)!important;
}

.widget-empty,
.empty-state,
.next-show-strip,
.competition-form,
.currently-live,
.dj-request-list article,
.staff-admin-card,
.schedule-admin-item,
.request-admin-card,
.poll-option,
.rank-help-card,
.team-rank-navigation,
.dynamic-rank-heading,
.v4-request-banner,
.profile-show-date + div{
    background:var(--theme-surface-2)!important;
    color:var(--theme-text)!important;
    border-color:var(--theme-border)!important;
}

/* Inputs */
input,textarea,select{
    background:var(--theme-input)!important;
    color:var(--theme-text)!important;
    border-color:var(--theme-border)!important;
}

input::placeholder,
textarea::placeholder{
    color:var(--theme-muted)!important;
}

label{
    color:var(--theme-heading)!important;
}

/* Tables/list rows */
.admin-list-row,
.compact-row,
.manage-card,
.schedule-admin-item,
.staff-admin-card,
.request-admin-card,
.rank-assignment-card,
.audit-row{
    color:var(--theme-text)!important;
}

/* Public rank sections */
.dynamic-rank-heading{
    background:var(--theme-surface)!important;
}

/* Hide technical access level from visitors */
.rank-access-indicator{
    display:none!important;
}

/* Radio player/footer */
.site-footer{
    background:var(--theme-footer)!important;
    color:var(--theme-footer-text)!important;
}

.site-footer h3,
.site-footer h4{
    color:#fff!important;
}

.radio-dock{
    background:var(--theme-footer)!important;
}

/* Theme switcher state */
.theme-switcher{
    flex:0 0 auto;
}

.theme-switcher button{
    color:#fff;
}

.theme-switcher button.active{
    color:#3d2d00;
}

/* Light-only areas adjusted in dark mode */
html[data-theme="dark"] .news-art,
html[data-resolved-theme="dark"] .news-art,
html[data-theme="dark"] .v4-news-image,
html[data-resolved-theme="dark"] .v4-news-image,
html[data-theme="dark"] .optimized-team-room,
html[data-resolved-theme="dark"] .optimized-team-room,
html[data-theme="dark"] .optimized-profile-room,
html[data-resolved-theme="dark"] .optimized-profile-room,
html[data-theme="dark"] .team-v4-room,
html[data-resolved-theme="dark"] .team-v4-room{
    filter:brightness(.78) saturate(.85);
}

html[data-theme="dark"] .success,
html[data-resolved-theme="dark"] .success{
    background:var(--theme-success)!important;
    color:#c8f1d2!important;
    border-color:#39764a!important;
}

html[data-theme="dark"] .alert,
html[data-resolved-theme="dark"] .alert{
    background:var(--theme-danger)!important;
    color:#ffd8dc!important;
    border-color:#8b4a50!important;
}

/* Mobile menu including More dropdown */
@media(max-width:850px){
    .more-menu{
        width:100%;
    }
    .more-menu > button{
        width:100%;
        text-align:left;
    }
    .more-menu-dropdown{
        position:static;
        display:grid;
        width:100%;
        box-shadow:none;
        margin-top:6px;
    }
}
