/* =========================================================================
   Kelasema design system
   Layered on top of stock Bootstrap 5 RTL — no other UI framework.
   Overrides Bootstrap's CSS custom properties so every Bootstrap component
   (buttons, badges, forms, alerts, pagination...) already speaks the new
   palette without needing a Sass rebuild (no npm/libman in this repo).
   ========================================================================= */

:root {
    /* Brand palette */
    --brand-violet: #6d5df6;
    --brand-violet-rgb: 109, 93, 246;
    --brand-violet-dark: #4c3fd0;
    --brand-cyan: #06b6d4;
    --brand-cyan-rgb: 6, 182, 212;
    --brand-coral: #ff6b6b;
    --brand-amber: #ffb020;

    --ink-900: #191934;
    --ink-700: #46466b;
    --ink-500: #6f6f92;
    --ink-300: #a9a9c7;

    --surface-page: #f7f7fd;
    --surface-card: #ffffff;
    --surface-alt: #f1effe;
    --surface-border: #e7e5f7;

    --gradient-brand: linear-gradient(135deg, var(--brand-violet) 0%, var(--brand-cyan) 100%);
    --gradient-warm: linear-gradient(135deg, var(--brand-coral) 0%, var(--brand-amber) 100%);

    --shadow-soft: 0 6px 20px -8px rgba(25, 25, 52, 0.12);
    --shadow-lift: 0 20px 40px -16px rgba(109, 93, 246, 0.35);

    --radius-sm: 0.6rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-pill: 999px;

    /* Bootstrap variable overrides — cascade into every .btn-*, .text-*,
       .bg-*, .border-*, badge, alert, form-control focus ring, etc. */
    --bs-primary: var(--brand-violet);
    --bs-primary-rgb: var(--brand-violet-rgb);
    --bs-secondary: var(--ink-500);
    --bs-secondary-rgb: 111, 111, 146;
    --bs-info: var(--brand-cyan);
    --bs-info-rgb: var(--brand-cyan-rgb);
    --bs-success: #17b26a;
    --bs-success-rgb: 23, 178, 106;
    --bs-warning: var(--brand-amber);
    --bs-warning-rgb: 255, 176, 32;
    --bs-danger: #f04452;
    --bs-danger-rgb: 240, 68, 82;
    --bs-body-bg: var(--surface-page);
    --bs-body-color: var(--ink-900);
    --bs-body-font-family: Vazirmatn, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius-md);
    --bs-border-radius-xl: var(--radius-lg);
    --bs-border-radius-pill: var(--radius-pill);
    --bs-border-color: var(--surface-border);
    --bs-link-color: var(--brand-violet);
    --bs-link-color-rgb: var(--brand-violet-rgb);
    --bs-link-hover-color: var(--brand-violet-dark);
    --bs-link-hover-color-rgb: 76, 63, 208;
}

/* ---------- Base ---------------------------------------------------- */

html, body {
    font-family: Vazirmatn, 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--surface-page);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    color: var(--ink-900);
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

::selection {
    background: rgba(var(--brand-violet-rgb), 0.22);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--surface-page);
}

::-webkit-scrollbar-thumb {
    background: var(--ink-300);
    border-radius: var(--radius-pill);
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--brand-violet);
    }

.content {
    padding-top: 1.1rem;
}

/* ---------- Buttons --------------------------------------------------- */

.btn {
    border-radius: var(--radius-pill);
    font-weight: 700;
    padding-inline: 1.25rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary, .btn-warm {
    border: none;
    color: #fff;
    background: var(--gradient-brand);
    box-shadow: 0 8px 20px -8px rgba(var(--brand-violet-rgb), 0.55);
}

.btn-warm {
    background: var(--gradient-warm);
    box-shadow: 0 8px 20px -8px rgba(255, 107, 107, 0.55);
}

.btn-primary:hover, .btn-primary:focus,
.btn-warm:hover, .btn-warm:focus {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-2px);
}

.btn-primary:active, .btn-warm:active {
    transform: translateY(0);
}

.btn-outline-primary {
    border-width: 2px;
    font-weight: 700;
}

    .btn-outline-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 18px -10px rgba(var(--brand-violet-rgb), 0.5);
    }

.btn-lg {
    padding: 0.75rem 1.75rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus, .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-violet-rgb), 0.25);
}

/* ---------- Cards ------------------------------------------------------ */

.card {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface-card);
}

.card-modern, .card.shadow-sm {
    box-shadow: var(--shadow-soft) !important;
    border: 1px solid var(--surface-border);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card-hover:hover, a:hover > .card-hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift) !important;
}

.card-img-top {
    background: var(--surface-alt);
}

/* ---------- Badges & soft tints ---------------------------------------- */

.badge {
    font-weight: 700;
    border-radius: var(--radius-pill);
    padding: 0.4em 0.85em;
}

.badge-soft-violet {
    background: rgba(var(--brand-violet-rgb), 0.12);
    color: var(--brand-violet-dark);
}

.badge-soft-cyan {
    background: rgba(var(--brand-cyan-rgb), 0.14);
    color: #0a7c91;
}

.badge-soft-success {
    background: rgba(23, 178, 106, 0.14);
    color: #0f8a54;
}

.badge-soft-amber {
    background: rgba(255, 176, 32, 0.16);
    color: #9a6300;
}

.badge-soft-neutral {
    background: var(--surface-alt);
    color: var(--ink-700);
}

/* ---------- Forms -------------------------------------------------------*/

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--surface-border);
    padding: 0.65rem 0.9rem;
}

.form-label {
    font-weight: 700;
    color: var(--ink-700);
}

.form-floating > label {
    color: var(--ink-500);
}

/* ---------- Alerts ------------------------------------------------------*/

.alert {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.alert-danger {
    background: rgba(240, 68, 82, 0.1);
    color: #c62834;
}

.alert-success {
    background: rgba(23, 178, 106, 0.12);
    color: #0f8a54;
}

/* ---------- Pagination --------------------------------------------------*/

.pagination {
    gap: 0.35rem;
}

.page-link {
    border: none;
    border-radius: var(--radius-pill) !important;
    color: var(--ink-700);
    font-weight: 700;
    min-width: 2.5rem;
    text-align: center;
}

.page-item.active .page-link {
    background: var(--gradient-brand);
    color: #fff;
}

/* ---------- Layout helpers ----------------------------------------------*/

.section {
    padding-block: 3rem;
}

.section-alt {
    background: var(--surface-alt);
    border-radius: var(--radius-lg);
}

.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: var(--brand-violet-dark);
    background: rgba(var(--brand-violet-rgb), 0.1);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.9rem;
}

.avatar-ring {
    padding: 3px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: inline-block;
}

    .avatar-ring img {
        display: block;
        border: 3px solid var(--surface-card);
        border-radius: 50%;
    }

/* ---------- Entrance animation --------------------------------------------
   Plays automatically as soon as an element is inserted (Blazor render, SPA
   navigation, async data arriving) — no IntersectionObserver, so nothing can
   ever get stuck invisible when a scroll trigger never fires (below-the-fold
   content, headless/screenshot capture, fast navigation, etc). */

.reveal {
    animation: kelasema-fade-in 0.5s ease both;
}

@keyframes kelasema-fade-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        animation: none;
    }
}

/* ---------- Site chrome: navbar / hero / footer -------------------------*/

.site-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(247, 247, 253, 0.78);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--surface-border);
    transition: box-shadow 0.2s ease;
}

.site-navbar.is-scrolled {
    box-shadow: var(--shadow-soft);
}

.site-navbar .navbar-brand {
    font-weight: 900;
    font-size: 1.4rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-navbar .nav-link {
    font-weight: 700;
    color: var(--ink-700);
    border-radius: var(--radius-pill);
    padding: 0.5rem 0.9rem !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-navbar .nav-link:hover {
    color: var(--brand-violet);
    background: rgba(var(--brand-violet-rgb), 0.08);
}

.site-navbar .nav-link.active {
    color: var(--brand-violet-dark);
    background: rgba(var(--brand-violet-rgb), 0.12);
}

.site-navbar .dropdown-menu {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--gradient-brand);
    color: #fff;
    padding: 3.5rem 2rem;
    isolation: isolate;
}

    .hero::before, .hero::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        filter: blur(6px);
        opacity: 0.35;
        z-index: -1;
    }

    .hero::before {
        width: 22rem;
        height: 22rem;
        background: #ffffff;
        top: -10rem;
        inset-inline-end: -6rem;
        opacity: 0.14;
    }

    .hero::after {
        width: 16rem;
        height: 16rem;
        background: var(--brand-amber);
        bottom: -8rem;
        inset-inline-start: -4rem;
        opacity: 0.28;
    }

.hero h1 {
    color: #fff;
    font-size: clamp(1.9rem, 1.4rem + 2vw, 3rem);
}

.hero p {
    color: rgba(255, 255, 255, 0.9);
}

/* Photo hero variant (the home page banner) — the source image is already a
   finished, fully-designed marketing banner (logo, headline, CTA strip baked
   in), so this shows it as-is rather than tinting/cropping it as a CSS
   background, and floats the real, clickable buttons over its bottom CTA
   strip instead of duplicating a heading/paragraph on top of it. */
.hero-banner-wrap {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    line-height: 0;
}

.hero-banner-photo {
    display: block;
    width: 100%;
    height: auto;
}

.hero-banner-cta {
    position: absolute;
    inset-inline: 0;
    bottom: 3.5%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-inline: 1rem;
    line-height: normal;
}

    .hero-banner::before, .hero-banner::after {
        display: none;
    }

.site-footer {
    margin-top: 4rem;
    padding: 2.5rem 0;
    background: var(--ink-900);
    color: rgba(255, 255, 255, 0.75);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer .brand {
    font-weight: 900;
    font-size: 1.25rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =========================================================================
   Blazor framework chrome (unchanged behaviour, restyled to match brand)
   ========================================================================= */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

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

.validation-message {
    color: var(--bs-danger);
    font-weight: 600;
}

#blazor-error-ui {
    background: #fff7e0;
    bottom: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjU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i4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: var(--surface-alt);
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: var(--brand-violet);
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* ---------- Admin panel shell (/admin/*) ---------- */
.admin-shell {
    display: flex;
    min-height: 100vh;
    background: #f4f5fa;
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #1a1526;
    color: #fff;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-brand {
    padding: 1.1rem 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.admin-nav {
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    overflow-y: auto;
}

.admin-nav-group-title {
    font-size: .72rem;
    text-transform: uppercase;
    opacity: .55;
    margin: .9rem .5rem .25rem;
    letter-spacing: .03em;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .75rem;
    border-radius: .6rem;
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-size: .9rem;
}

    .admin-nav-link:hover {
        background: rgba(255, 255, 255, .08);
        color: #fff;
    }

    .admin-nav-link.active {
        background: var(--gradient-brand);
        color: #fff;
    }

.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    z-index: 1039;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-content {
    padding: 1.5rem;
    flex: 1;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        inset-inline-start: 0;
        top: 0;
        bottom: 0;
        transform: translateX(100%);
        transition: transform .2s ease-in-out;
        z-index: 1040;
    }

        .admin-sidebar.show {
            transform: translateX(0);
        }
}
