/* Portal-wide dust overlay + light/dark theme */
:root,
[data-theme="light"] {
    --portal-bg: #ffffff;
    --portal-surface: #f8fafc;
    --portal-surface-2: #f1f5f9;
    --portal-text: #0f172a;
    --portal-text-muted: #64748b;
    --portal-border: #e2e8f0;
    --portal-dust: rgba(196, 30, 58, 0.65);
    --portal-dust-glow: rgba(196, 30, 58, 0.25);
    --portal-toggle-bg: #ffffff;
    --portal-toggle-border: #e2e8f0;
    --portal-toggle-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

[data-theme="dark"] {
    color-scheme: dark;
    --portal-bg: #0a0e17;
    --portal-surface: #111827;
    --portal-surface-2: #1a2234;
    --portal-text: #e2e8f0;
    --portal-text-muted: #94a3b8;
    --portal-border: rgba(255, 255, 255, 0.1);
    --portal-dust: rgba(255, 255, 255, 0.55);
    --portal-dust-glow: rgba(196, 30, 58, 0.35);
    --portal-toggle-bg: #1a2234;
    --portal-toggle-border: rgba(255, 255, 255, 0.12);
    --portal-toggle-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.portal-dust-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

.portal-theme-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 9999;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 1px solid var(--portal-toggle-border);
    background: var(--portal-toggle-bg);
    box-shadow: var(--portal-toggle-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-theme-toggle:hover {
    transform: scale(1.06);
}

.portal-theme-toggle__icon {
    position: absolute;
    transition: opacity 0.25s ease, transform 0.25s ease;
    color: #f59e0b;
}

[data-theme="dark"] .portal-theme-toggle__icon {
    color: #e2e8f0;
}

.portal-theme-toggle__icon svg {
    display: block;
}

[data-theme="light"] .portal-theme-toggle__icon--sun,
[data-theme="dark"] .portal-theme-toggle__icon--moon {
    opacity: 1;
    transform: scale(1);
}

[data-theme="light"] .portal-theme-toggle__icon--moon,
[data-theme="dark"] .portal-theme-toggle__icon--sun {
    opacity: 0;
    transform: scale(0.6);
}

/* —— Frontend (corporate + inner pages) —— */
[data-theme="dark"] body.th-stripe-theme {
    background: var(--portal-bg);
    color: var(--portal-text);
}

[data-theme="dark"] .st-header__top:not(.st-header__top--light),
[data-theme="dark"] .st-header__sub:not(.st-header__sub--corporate) {
    background: #0d1220 !important;
    border-color: var(--portal-border) !important;
}

/* Corporate nav bar: dark navy background + white menu text (all themes) */
.st-header__sub--corporate,
[data-theme="dark"] .st-header__sub--corporate {
    background: #1a1a2e !important;
    border-color: transparent !important;
}

.st-header__sub--corporate .st-header__pill--corp,
body.th-stripe-theme .st-header__sub--corporate a.st-header__pill--corp,
[data-theme="dark"] .st-header__sub--corporate .st-header__pill--corp {
    color: #fff !important;
}

.st-header__sub--corporate .st-header__pill--corp:hover,
[data-theme="dark"] .st-header__sub--corporate .st-header__pill--corp:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18) !important;
}

.st-header__sub--corporate .st-header__pill--corp-cta,
[data-theme="dark"] .st-header__sub--corporate .st-header__pill--corp-cta {
    color: #fff !important;
}

/* Top contact row stays white with navy text in all themes */
.st-header__top--light,
[data-theme="dark"] .st-header__top--light {
    background: #fff !important;
    color: #1a1a2e !important;
    border-bottom: 1px solid #e8e8ed !important;
}

.st-header__top--light .st-header__contact-item,
.st-header__top--light .st-header__contact-text,
.st-header__top--light .st-header__contact-text a,
body.th-stripe-theme .st-header__top--light a:not(.st-btn):not(.st-header__cta),
[data-theme="dark"] .st-header__top--light .st-header__contact-text a {
    color: #1a1a2e !important;
}

.st-header__top--light .st-header__signin,
[data-theme="dark"] .st-header__top--light .st-header__signin {
    color: #1a1a2e !important;
}

.st-header__top--light .st-header__menu-btn span,
[data-theme="dark"] .st-header__top--light .st-header__menu-btn span {
    background: #1a1a2e !important;
}

[data-theme="dark"] .st-header__pill:not(.st-header__pill--corp):not(.st-header__pill--corp-cta) {
    color: var(--portal-text-muted) !important;
}

[data-theme="dark"] .st-header__pill:not(.st-header__pill--corp):hover,
[data-theme="dark"] .st-header__pill--corp-cta {
    color: #fff !important;
}

[data-theme="dark"] .corp-section {
    background: var(--portal-bg) !important;
    color: var(--portal-text);
}

[data-theme="dark"] .corp-section--alt {
    background: var(--portal-surface) !important;
}

[data-theme="dark"] .corp-section--dark {
    background: #070b14 !important;
}

[data-theme="dark"] .corp-title,
[data-theme="dark"] .corp-card h3,
[data-theme="dark"] .corp-feed-card__title a {
    color: var(--portal-text) !important;
}

[data-theme="dark"] .corp-lead,
[data-theme="dark"] .corp-card p,
[data-theme="dark"] .corp-feed-card__excerpt {
    color: var(--portal-text-muted) !important;
}

[data-theme="dark"] .corp-card,
[data-theme="dark"] .corp-feed-card,
[data-theme="dark"] .corp-mv-card,
[data-theme="dark"] .corp-team-card,
[data-theme="dark"] .corp-testimonial {
    background: var(--portal-surface-2) !important;
    border-color: var(--portal-border) !important;
    color: var(--portal-text);
}

[data-theme="dark"] .site-footer--rich,
[data-theme="dark"] .site-footer__bottom {
    background: var(--portal-surface) !important;
    border-color: var(--portal-border) !important;
    color: var(--portal-text-muted);
}

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

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

[data-theme="dark"] .page-header-area,
[data-theme="dark"] .inner-all-news-area,
[data-theme="dark"] .page-contact-info-area {
    background: var(--portal-bg) !important;
    color: var(--portal-text);
}

[data-theme="dark"] .single-news,
[data-theme="dark"] .single-event,
[data-theme="dark"] .admission-form {
    background: var(--portal-surface) !important;
    color: var(--portal-text);
}

/* —— Login —— */
[data-theme="dark"] .adm-auth-page {
    background: var(--portal-bg);
}

[data-theme="dark"] .adm-auth-main {
    background: var(--portal-bg);
}

[data-theme="dark"] .adm-auth-card {
    background: var(--portal-surface) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .adm-auth-card-title {
    color: var(--portal-text) !important;
}

[data-theme="dark"] .adm-auth-card-subtitle,
[data-theme="dark"] .adm-auth-legal {
    color: var(--portal-text-muted) !important;
}

[data-theme="light"] .adm-auth-page {
    background: var(--portal-bg);
}

/* —— Admin dashboard —— */
[data-theme="dark"] body.nav-md,
[data-theme="dark"] .container.body,
[data-theme="dark"] .main_container {
    background: var(--portal-bg) !important;
    color: var(--portal-text);
}

[data-theme="dark"] .right_col,
[data-theme="dark"] .left_col {
    background: var(--portal-bg) !important;
}

[data-theme="dark"] .nav_menu,
[data-theme="dark"] .top_nav {
    background: var(--portal-surface) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .nav.side-menu > li > a,
[data-theme="dark"] .nav.child_menu > li > a {
    color: var(--portal-text-muted) !important;
}

[data-theme="dark"] .nav.side-menu > li.active > a,
[data-theme="dark"] .nav.side-menu > li.current-page > a {
    color: #fff !important;
}

[data-theme="dark"] .left_col,
[data-theme="dark"] .nav-sm ul.nav.child_menu {
    background: #0d1220 !important;
}

[data-theme="dark"] .x_panel,
[data-theme="dark"] .x_content,
[data-theme="dark"] .dashboard-widget,
[data-theme="dark"] .tile-stats {
    background: var(--portal-surface) !important;
    color: var(--portal-text) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .x_title h2,
[data-theme="dark"] .school-name,
[data-theme="dark"] label,
[data-theme="dark"] .table {
    color: var(--portal-text) !important;
}

[data-theme="dark"] .table > thead > tr > th,
[data-theme="dark"] .table > tbody > tr > td {
    background: var(--portal-surface) !important;
    color: var(--portal-text) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
    background: var(--portal-surface-2) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] select.form-control,
[data-theme="dark"] input.form-control {
    background: var(--portal-surface-2) !important;
    color: var(--portal-text) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .dropdown-menu {
    background: var(--portal-surface) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .dropdown-menu > li > a {
    color: var(--portal-text) !important;
}

[data-theme="dark"] footer {
    background: var(--portal-surface) !important;
    color: var(--portal-text-muted) !important;
    border-color: var(--portal-border) !important;
}

[data-theme="dark"] .modal-content {
    background: var(--portal-surface) !important;
    color: var(--portal-text);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .well {
    background: var(--portal-surface) !important;
    color: var(--portal-text);
    border-color: var(--portal-border) !important;
}

@media (prefers-reduced-motion: reduce) {
    .portal-dust-canvas {
        display: none !important;
    }
}

@media print {
    .portal-dust-canvas,
    .portal-theme-toggle {
        display: none !important;
    }
}
