/**
 * UX4G (User Experience for Government) Design Framework & Accessibility Stylesheet
 * Aligned with GIGW 3.0 (Guidelines for Indian Government Websites) & WCAG 2.1 AA Standards
 * Authored for Sahil Schools ERP & Web Portal
 */

/* ==========================================================================
   1. Universal Focus Visibility & Keyboard Accessibility
   ========================================================================== */
:focus-visible {
    outline: 2.5px solid #0284c7 !important;
    outline-offset: 2.5px !important;
    border-radius: 3px !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.25) !important;
    transition: outline-offset 0.15s ease-in-out;
}

/* Skip to Main Content Link (GIGW 3.0 Mandate) */
.ux4g-skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: #0f172a;
    color: #facc15;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 13.5px;
    border-radius: 0 0 8px 8px;
    border: 2px solid #facc15;
    border-top: none;
    z-index: 99999;
    text-decoration: none;
    transition: top 0.2s ease-in-out, box-shadow 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.ux4g-skip-link:focus,
.ux4g-skip-link:focus-visible {
    top: 0;
    outline: none !important;
}

/* ==========================================================================
   2. UX4G Top Utility / Universal Accessibility Strip
   ========================================================================== */
.ux4g-accessibility-strip {
    background: #071527;
    color: #cbd5e1;
    font-size: 11.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1045;
    line-height: 1.4;
}

.ux4g-strip-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    min-height: 36px;
    padding: 3px 0;
}

.ux4g-gov-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    color: #cbd5e1;
    letter-spacing: 0.3px;
    font-size: 11.5px;
}

.ux4g-emblem {
    width: 14px;
    height: 14px;
    display: inline-block;
    color: #f59e0b;
}

.ux4g-tools-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Tool Buttons & Pill Switches */
.ux4g-tool-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
    min-height: 24px;
}

.ux4g-tool-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.ux4g-tool-btn.active {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
    font-weight: 700;
}

/* Font Resizing Buttons (A- / A / A+) */
.ux4g-font-switcher {
    display: inline-flex;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.ux4g-font-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.ux4g-font-btn:last-child {
    border-right: none;
}

.ux4g-font-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.ux4g-font-btn.active {
    background: #0284c7;
    color: #ffffff;
}

/* Contrast Switcher Button */
.ux4g-contrast-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 50px;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #fef08a;
    background: rgba(251, 191, 36, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ux4g-contrast-btn:hover {
    background: rgba(251, 191, 36, 0.22);
    color: #ffffff;
    border-color: #fbbf24;
}

/* Language Toggle Button */
.ux4g-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 50px;
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ux4g-lang-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
    border-color: #38bdf8;
}

/* ==========================================================================
   3. Dynamic Font Size Rescaling Engine
   ========================================================================== */
html[data-ux4g-font="small"] {
    font-size: 90% !important;
}

html[data-ux4g-font="normal"] {
    font-size: 100% !important;
}

html[data-ux4g-font="large"] {
    font-size: 115% !important;
}

/* ==========================================================================
   4. High Contrast Mode (WCAG 2.1 AAA - Yellow on Black / High Vis)
   ========================================================================== */
html[data-ux4g-contrast="high"] body {
    background-color: #000000 !important;
    color: #ffffff !important;
}

html[data-ux4g-contrast="high"] .ux4g-accessibility-strip {
    background: #000000 !important;
    border-bottom: 2px solid #ffff00 !important;
}

html[data-ux4g-contrast="high"] .site-header,
html[data-ux4g-contrast="high"] .site-top-bar,
html[data-ux4g-contrast="high"] .navbar,
html[data-ux4g-contrast="high"] .site-footer {
    background: #000000 !important;
    border-color: #ffff00 !important;
    color: #ffffff !important;
}

html[data-ux4g-contrast="high"] a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

html[data-ux4g-contrast="high"] a:hover {
    color: #00ffff !important;
}

html[data-ux4g-contrast="high"] :focus-visible {
    outline: 3px solid #ffff00 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 5px #000000 !important;
}

html[data-ux4g-contrast="high"] .card,
html[data-ux4g-contrast="high"] .section-block,
html[data-ux4g-contrast="high"] .modal-content,
html[data-ux4g-contrast="high"] .dropdown-menu {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffff00 !important;
}

html[data-ux4g-contrast="high"] h1,
html[data-ux4g-contrast="high"] h2,
html[data-ux4g-contrast="high"] h3,
html[data-ux4g-contrast="high"] h4,
html[data-ux4g-contrast="high"] h5,
html[data-ux4g-contrast="high"] h6 {
    color: #ffff00 !important;
}

html[data-ux4g-contrast="high"] p,
html[data-ux4g-contrast="high"] span,
html[data-ux4g-contrast="high"] li,
html[data-ux4g-contrast="high"] label {
    color: #ffffff !important;
}

html[data-ux4g-contrast="high"] .btn-primary,
html[data-ux4g-contrast="high"] .btn-warning,
html[data-ux4g-contrast="high"] .btn-apply {
    background: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #ffffff !important;
    font-weight: 800 !important;
}

html[data-ux4g-contrast="high"] input,
html[data-ux4g-contrast="high"] select,
html[data-ux4g-contrast="high"] textarea {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffff00 !important;
}

/* ==========================================================================
   5. UX4G Institutional Footer & Compliance Strip
   ========================================================================== */
.ux4g-compliance-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 12.5px;
    line-height: 1.6;
}

.ux4g-compliance-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.16) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.38) !important;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.ux4g-compliance-dock {
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.09) !important;
    border-radius: 16px !important;
    padding: 18px 22px !important;
    margin-top: 24px;
    margin-bottom: 12px;
}

.ux4g-compliance-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 4px 11px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ux4g-compliance-pill:hover {
    background: rgba(250, 204, 21, 0.15);
    border-color: #facc15;
    color: #facc15 !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.ux4g-wim-card {
    background: rgba(56, 189, 248, 0.06) !important;
    border-left: 3.5px solid #38bdf8 !important;
    border-top: 1px solid rgba(56, 189, 248, 0.15);
    border-right: 1px solid rgba(56, 189, 248, 0.15);
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    padding: 12px 16px !important;
    border-radius: 0 12px 12px 0 !important;
    font-size: 11.5px;
    color: #cbd5e1 !important;
}

.ux4g-mandated-links a {
    color: #cbd5e1 !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

.ux4g-mandated-links a:hover {
    color: #facc15 !important;
    text-decoration: underline;
}

/* Screen Reader Only Utility Class */
.sr-only,
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   6. Touch Target Optimization (44px min for mobile GIGW accessibility)
   ========================================================================== */
@media (max-width: 768px) {
    .btn,
    .nav-link,
    .dropdown-item,
    .pagination .page-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* ==========================================================================
   7. GIGW 3.0 & WCAG 2.1 AA Master Typography & Contrast Architecture
   ========================================================================== */

/* Universal Light Mode Body Copy: Readable Slate-800 (13.5:1 contrast against white) */
body:not([data-theme="dark"]) {
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Universal Light Headings: Authoritative Royal Navy (15.2:1 contrast against white) */
body:not([data-theme="dark"]) h1:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) h2:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) h3:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) h4:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) h5:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) h6:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *),
body:not([data-theme="dark"]) .section-title,
body:not([data-theme="dark"]) .card-title,
body:not([data-theme="dark"]) .display-1,
body:not([data-theme="dark"]) .display-2,
body:not([data-theme="dark"]) .display-3,
body:not([data-theme="dark"]) .display-4,
body:not([data-theme="dark"]) .display-5,
body:not([data-theme="dark"]) .display-6 {
    color: #0b2545;
}

/* Universal Light Body Text (p, li, table td) */
body:not([data-theme="dark"]) p:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *):not(.text-white):not(.text-white-50):not(.text-muted),
body:not([data-theme="dark"]) li:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *):not(.text-white):not(.text-white-50):not(.text-muted) {
    color: #1e293b;
}

/* Universal Light Secondary / Muted Text: Slate-600 (5.9:1 contrast, firmly passes WCAG AA) */
body:not([data-theme="dark"]) .text-muted:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *):not(.text-white-50),
body:not([data-theme="dark"]) .text-secondary:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *):not(.text-white-50),
body:not([data-theme="dark"]) small.text-muted:not(.site-footer *):not(.digital-kiosk-section *):not(.hero-slide *):not(.hero-content *):not(.modal-content *):not(.join-box *):not(.text-white *):not(.bg-dark *):not(.bg-primary *):not(.about-hero-banner *):not(.contact-hero-banner *):not(.admissions-hero *):not(.text-white-50),
body:not([data-theme="dark"]) .section-subtitle,
body:not([data-theme="dark"]) .lead-para {
    color: #475569;
}

/* Ensure .text-dark on Light Surfaces NEVER Washes Out */
body:not([data-theme="dark"]) .text-dark:not(.btn-warning):not(.btn-warning *):not(.badge-warning):not(.badge-warning *):not(.bg-warning):not(.bg-warning *) {
    color: #0b2545 !important;
}

/* Warning & Gold Elements: Charcoal Dark Text on Yellow Background (9.5:1 contrast - WCAG AAA) */
.btn-warning,
.btn-warning *,
.badge-warning,
.badge-warning *,
.bg-warning,
.bg-warning *,
.btn-warning .text-dark,
.badge.bg-warning,
.badge.bg-warning * {
    color: #0f172a !important;
}

.btn-warning {
    background-color: #f59e0b !important;
    border-color: #d97706 !important;
    font-weight: 700;
}

.btn-warning:hover {
    background-color: #d97706 !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
}

.btn-warning:hover * {
    color: #ffffff !important;
}

/* Accessible Warning / Yellow Text on Light Surfaces (Avoids unreadable #ffc107) */
body:not([data-theme="dark"]) .text-warning:not(.site-top-bar *):not(.site-footer *):not(.badge-warning *):not(.hero-content *):not(.digital-kiosk-section *):not(.modal-content *):not(.bg-dark *):not(.bg-primary *) {
    color: #b45309; /* Deep amber (5.1:1 on white) */
}

/* Badges with High-Contrast Pairs */
.badge.bg-light.text-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
    font-weight: 700;
}

.badge.bg-light.text-primary {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 700;
}

.badge.bg-light.text-success {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 700;
}

/* Dark Surface Headings & Typography (Hero, Digital Kiosk, Join CTA, Footer, Modals) */
.hero-content h1,
.hero-content h2,
.hero-content h3,
.hero-title,
.slide-heading,
.digital-kiosk-section h1,
.digital-kiosk-section h2,
.digital-kiosk-section h3,
.digital-kiosk-section h4,
.digital-kiosk-section h5,
.digital-kiosk-section h6,
.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6,
.site-footer .footer-title,
section.text-white h1,
section.text-white h2,
section.text-white h3,
section.text-white h4,
section.text-white h5,
section.text-white h6,
.join-box h2,
.join-box h3,
.join-box h4,
.about-hero-banner h1,
.about-hero-banner h2,
.contact-hero-banner h1,
.contact-hero-banner h2,
.admissions-hero h1,
.admissions-hero h2,
.modal-content.text-white h1,
.modal-content.text-white h2,
.modal-content.text-white h3,
.modal-content.text-white h4,
.modal-content.text-white h5,
.modal-content.text-white h6 {
    color: #ffffff !important;
}

/* Dark Surface Secondary Text: Slate-300 / Slate-200 (10:1 contrast on dark navy) */
.hero-content .text-muted,
.hero-description,
.slide-desc,
.digital-kiosk-section .text-muted,
.digital-kiosk-section .text-white-50,
.site-footer .text-white-50,
.site-footer .text-muted,
section.text-white .text-muted,
section.text-white .text-white-50,
.join-box p,
.about-hero-banner p,
.contact-hero-banner p,
.admissions-hero p {
    color: #cbd5e1 !important;
}

/* Alternating Section Backgrounds with Subtle Border Separation */
.section-bg,
.section.section-bg {
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

/* Cards & Content Blocks */
.future-pillar-card,
.facility-card,
.academic-card,
.testimonial-card,
.news-card,
.award-card,
.team-card {
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(11, 37, 69, 0.05);
}

/* Form Controls (Inputs, Selects): Boundary Contrast SC 1.4.11 */
.form-control,
.form-select {
    border: 1.5px solid #94a3b8;
    color: #0f172a;
    font-size: 14.5px;
}

.form-control:focus,
.form-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
    color: #0f172a;
}

.form-control::placeholder {
    color: #64748b;
    opacity: 1;
}

.form-label {
    color: #0f172a;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Button Accessibility (Primary) */
.btn-primary {
    background-color: #1d4ed8;
    border-color: #1e40af;
    color: #ffffff !important;
    font-weight: 700;
}

.btn-primary:hover {
    background-color: #1e40af;
    border-color: #172554;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   Seamless Dark Mode Support (Zero Contrast Clashes / Zero Inverted Faint Text)
   ══════════════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] body {
    color: #f1f5f9;
    background-color: #0b1329;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .fst-title,
html[data-theme="dark"] .aj-title,
html[data-theme="dark"] .aj-step-title {
    color: #ffffff !important;
}

html[data-theme="dark"] p,
html[data-theme="dark"] span:not(.badge):not(.step-num-badge):not(.btn *):not(.btn-warning *):not(.badge-warning *):not(.bg-warning *),
html[data-theme="dark"] li,
html[data-theme="dark"] .lead-para {
    color: #e2e8f0;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] small.text-muted,
html[data-theme="dark"] .section-subtitle,
html[data-theme="dark"] .fst-sub,
html[data-theme="dark"] .aj-subtitle,
html[data-theme="dark"] .aj-step-sub {
    color: #94a3b8 !important;
}

html[data-theme="dark"] .section-bg,
html[data-theme="dark"] .section.section-bg {
    background-color: #0e172a !important;
    border-color: #1e293b !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .future-pillar-card,
html[data-theme="dark"] .facility-card,
html[data-theme="dark"] .academic-card,
html[data-theme="dark"] .testimonial-card,
html[data-theme="dark"] .news-card,
html[data-theme="dark"] .award-card,
html[data-theme="dark"] .team-card,
html[data-theme="dark"] .admission-journey-card,
html[data-theme="dark"] .feature-strip-container {
    background-color: #111d33 !important;
    border-color: #1e293b !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background-color: #0b1329 !important;
    color: #f1f5f9 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .form-label {
    color: #f1f5f9 !important;
}


