/* =====================================================
   GLOBAL RESET
   ===================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

/* =====================================================
   BRAND VARIABLES
   ===================================================== */

:root {
    /* App bar brand; NavMenu overlay top offset uses this — keep in sync */
    --wps-appbar-logo-height: 44px;

    /* Legacy WPSNA aliases → WPSI Fluent tokens (wpsi-fluent-theme.css) */
    --brand-accent: var(--wpsi-accent);
    --brand-accent-hover: var(--wpsi-accent-light);
    --brand-accent-soft: var(--wpsi-accent-soft);
    --brand-accent-glow: color-mix(in srgb, var(--wpsi-accent) 35%, transparent);
    --font-base: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --color-valid: var(--success);
    --color-invalid: var(--error);

    --wps-color-surface: var(--neutral-layer-2);
    --wps-color-on-surface: var(--neutral-foreground-rest);
    --wps-color-border: var(--neutral-stroke-rest);
    --wps-color-subtle: var(--neutral-foreground-hint);
    --wps-color-primary: var(--wpsi-accent);

    --kendo-color-surface: var(--neutral-layer-2);
    --kendo-color-on-surface: var(--neutral-foreground-rest);
    --kendo-color-on-app-surface: var(--neutral-foreground-rest);
    --kendo-color-border: var(--neutral-stroke-rest);
    --kendo-color-subtle: var(--neutral-foreground-hint);
    --kendo-color-primary: var(--wpsi-accent);
    --kendo-color-primary-hover: var(--wpsi-accent-light);
    --kendo-color-app-surface: var(--neutral-layer-1);
    --kendo-color-surface-alt: var(--neutral-layer-3);
}

/* =====================================================
   BASE DOCUMENT
   ===================================================== */

html, body {
    font-family: var(--font-base);
    height: 100%;
    margin: 0;
}

a {
    text-decoration: none;
}

/* =====================================================
   VALIDATION FIX FOR DARK MODE
   ===================================================== */

.validation-summary-errors {
    background-color: var(--wpsi-messagebar-error-bg);
    color: var(--wpsi-messagebar-error-text);
    padding: 1rem;
    border-radius: var(--wpsi-border-radius);
    border: 1px solid var(--wpsi-messagebar-error-border);
}

    .validation-summary-errors ul {
        margin: 0;
        padding-left: 1.2rem;
    }

.validation-message {
    color: #ff6b6b;
}

.alert-warning {
    background-color: var(--wpsi-messagebar-warning-bg) !important;
    color: var(--wpsi-messagebar-warning-text) !important;
    border: 1px solid var(--wpsi-messagebar-warning-border);
}

.alert-danger {
    background-color: var(--wpsi-messagebar-error-bg) !important;
    color: var(--wpsi-messagebar-error-text) !important;
    border: 1px solid var(--wpsi-messagebar-error-border);
}

.alert-success {
    background-color: var(--wpsi-messagebar-success-bg) !important;
    color: var(--wpsi-messagebar-success-text) !important;
    border: 1px solid var(--wpsi-messagebar-success-border);
}

.alert-info {
    background-color: var(--wpsi-messagebar-info-bg) !important;
    color: var(--wpsi-messagebar-info-text) !important;
    border: 1px solid var(--wpsi-messagebar-info-border);
}

/* =====================================================
   BLAZOR VALIDATION
   ===================================================== */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-valid);
}

.invalid {
    outline: 1px solid var(--color-invalid);
}

.validation-message {
    color: var(--color-invalid);
}

/* =====================================================
   BLAZOR ERROR BOUNDARY
   ===================================================== */

.blazor-error-boundary {
    background: #7f1d1d;
    padding: 1rem 1rem 1rem 3.7rem;
    color: #ffffff;
}

    .blazor-error-boundary::after {
        content: "An unexpected error has occurred.";
    }

/* =====================================================
   WPSNA THEME (layout-specific; tokens in wpsi-fluent-theme.css)
   ===================================================== */

.wps-body {
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    height: 100%;
    overflow: hidden;
}

/* =====================================================
   ADMIN TAB SECTIONS (grouped panels under /admin tabs)
   ===================================================== */

.wps-admin-section {
    border-radius: 0.5rem;
    border: 1px solid var(--wps-color-border);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

/* Fluent dialogs render inside main; elevate above app bar / nav drawer (1020–1031). */
fluent-dialog .overlay {
    z-index: 2000;
}

fluent-dialog .positioning-region {
    z-index: 2001;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 5vh, 3rem) 0;
    box-sizing: border-box;
}

/* =====================================================
   WPSNA APPBAR
   ===================================================== */

.wps-appbar {
    background-color: var(--wps-color-surface);
    color: var(--wps-color-on-surface);
    border-bottom: 1px solid var(--wps-color-border);
    backdrop-filter: none;
    transition: backdrop-filter 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    min-height: 0;
    padding-block: 0.35rem;
    box-sizing: border-box;
}

.wps-appbar .wps-appbar-section {
    padding-block: 0;
}

/* Scroll blur class */
.wps-appbar.scrolled {
    backdrop-filter: blur(12px);
    background-color: var(--wpsi-surface-overlay);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

/* ============================================
   BRAND (AppBar)
   ============================================ */

.wps-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    color: inherit;
    transition: color 0.2s ease;
}
    .wps-brand:hover {
        color: var(--brand-accent);
    }

/* ============================================
   BRAND LOGO (Telerik AppBar Safe)
   ============================================ */

.wps-brand-logo {
    height: var(--wps-appbar-logo-height);
    width: auto;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.wps-login-logo {
    height: calc(var(--wps-appbar-logo-height) * 3);
    width: auto;
    max-width: 100%;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
}

    .wps-brand-logo:hover {
        transform: scale(1.05);
        filter: brightness(1.08);
    }

    .wps-login-logo:hover {
        transform: scale(1.03);
        filter: brightness(1.08);
    }

/* Dark mode logo accent glow */
.wps-brand-logo,
.wps-login-logo {
    filter: drop-shadow(0 0 6px color-mix(in srgb, var(--wpsi-accent) 35%, transparent));
}

/* =====================================================
   ENTERPRISE NAVIGATION (UNIFIED)
   ===================================================== */

.wps-appbar .nav-link {
    position: relative;
    color: inherit;
    font-weight: 500;
    padding: 4px 6px;
    margin: 0 4px;
    border-radius: 8px;
    transition: color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.wps-appbar .nav-link.wps-appbar-profile {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.55rem;
    margin: 0;
    overflow: visible;
}

    /* Remove focus flash */

    .wps-appbar .nav-link:focus,
    .wps-appbar .nav-link:active,
    .wps-appbar .nav-link:focus-visible {
        outline: none;
        box-shadow: none;
    }

    /* Hover */

    .wps-appbar .nav-link:hover {
        color: var(--brand-accent);
    }

    /* Active state */

    .wps-appbar .nav-link.active {
        color: var(--brand-accent);
        background-color: var(--wpsi-accent-soft);
        box-shadow: 0 0 10px var(--brand-accent-glow);
    }

/* =====================================================
   SLIDING INDICATOR
   ===================================================== */

.wps-nav-container {
    position: relative;
    display: flex;
    gap: 18px;
}

.wps-nav-indicator {
    position: absolute;
    bottom: -6px;
    height: 3px;
    width: 0;
    background: linear-gradient( 90deg, var(--brand-accent), var(--brand-accent-hover) );
    border-radius: 4px;
    transition: left 0.35s cubic-bezier(.4,0,.2,1), width 0.35s cubic-bezier(.4,0,.2,1);
}

/* =====================================================
   RIPPLE CLICK EFFECT
   ===================================================== */

.wps-appbar .nav-link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--brand-accent-soft);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
}

.wps-appbar .nav-link:active::before {
    width: 180%;
    height: 180%;
    opacity: 1;
    transition: 0s;
}

/* =====================================================
   LAYOUT
   ===================================================== */

.layout,
.wps-site-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    overscroll-behavior-y: contain;
    --wps-site-chrome-height: max(
        6.5rem,
        calc(max(2.75rem, var(--wps-appbar-logo-height, 44px)) + 0.7rem + 2.5rem + 0.35rem));
}

.main-content,
.wps-site-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
    padding-top: 1rem;
}

.wps-footer-bar {
    flex: 0 0 auto;
    width: 100%;
    margin: 0;
    border-top: 1px solid var(--neutral-stroke-divider);
    background-color: var(--kendo-color-surface);
}

.wps-site-footer {
    margin: 0;
    padding: 0.2rem 0.5rem;
    text-align: center;
}

.wps-site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 0.4rem;
    margin: 0;
    padding: 0;
}

.wps-site-footer-muted,
.wps-site-footer-separator {
    color: var(--neutral-foreground-hint);
    font-size: 8pt;
    line-height: 1.2;
}

.wps-site-footer-separator {
    opacity: 0.65;
}

.wps-page-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.wps-page-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* =====================================================
   BLAZOR GLOBAL ERROR UI (PRODUCTION SAFE)
   ===================================================== */

#blazor-error-ui {
    background: var(--neutral-layer-2);
    color: var(--wpsi-messagebar-error-text);
    padding: 1rem 1.5rem;
    border-top: 3px solid var(--error);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.4);
    font-weight: 500;
    z-index: 11000;
}

    #blazor-error-ui a.reload {
        color: var(--brand-accent);
        font-weight: 600;
        margin-left: 1rem;
    }

    #blazor-error-ui .dismiss {
        color: #ff6b6b;
        cursor: pointer;
        margin-left: 1rem;
    }

    #blazor-error-ui.show {
        display: block;
    }

/* ================================
   Admin Fade Animation
================================ */

.admin-fade {
    animation: adminFadeIn 0.25s ease-out;
}

@keyframes adminFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Tab Loading Centering
================================ */

.admin-tab-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
}

/* ================================
   Auth Indicators
================================ */
.auth-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.auth-ok {
    background-color: var(--success);
    box-shadow: 0 0 6px color-mix(in srgb, var(--success) 50%, transparent);
}

.auth-bad {
    background-color: var(--error);
    box-shadow: 0 0 6px color-mix(in srgb, var(--error) 50%, transparent);
}

/* =====================================================
   HERO AREA
   ===================================================== */

.hero-section {
    position: relative;
    height: 50vh;
    min-height: 380px;
    max-height: 520px;
    overflow: hidden;
    border-bottom: 1px solid var(--kendo-color-border);
}

.hero-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.65) 45%, color-mix(in srgb, var(--wpsi-accent) 35%, transparent) 100%);
    display: flex;
    align-items: center;
    padding-left: 8%;
}

.hero-content {
    max-width: 700px;
    color: white;
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
}

    /* FocusOnNavigate targets h1 after route changes; hero titles are not interactive. */
    .hero-section .hero-title:focus,
    .hero-section .hero-title:focus-visible {
        outline: none;
        box-shadow: none;
    }

    .hero-title .accent {
        color: var(--brand-accent);
    }

.hero-subtitle {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    opacity: 0.85;
}

.hero-cta {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* =====================================================
   CTA BUTTONS
   ===================================================== */

.cta-primary {
    background: var(--brand-accent);
    color: white;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.3s;
}

    .cta-primary:hover {
        background: var(--brand-accent-hover);
    }

.cta-secondary {
    border: 1px solid white;
    padding: 0.9rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    color: white;
    transition: 0.3s;
}

    .cta-secondary:hover {
        background: rgba(255,255,255,0.15);
    }

/* =====================================================
   CAPABILITIES SECTION
   ===================================================== */

.capabilities-section {
    padding: 5rem 10%;
}

.capabilities-content {
    max-width: 1200px;
    margin: auto;
}

.capability-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

    .capability-columns ul {
        list-style: none;
        padding: 0;
    }

    .capability-columns li {
        margin-bottom: 0.8rem;
        padding-left: 1rem;
        position: relative;
    }

        .capability-columns li::before {
            content: "•";
            position: absolute;
            left: 0;
            color: var(--brand-accent);
        }


/* =====================================================
   AUTHORITY SECTION
   ===================================================== */

.authority-section {
    background: var(--neutral-layer-1);
    color: var(--neutral-foreground-rest);
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.spotlight-info-page {
    padding: 4rem 10%;
}

.spotlight-info-container {
    max-width: 900px;
    margin: 0 auto;
}

.spotlight-info-container h1 {
    margin-bottom: 1.25rem;
}

.spotlight-info-container p {
    font-size: 1.1rem;
    line-height: 1.75;
    color: #374151;
}