/* =================================================================
   SITE-LOADING.CSS — Global Loading Overlay & Spinner
   Egitim Sosyal Tesisler Mudurlugu
   =================================================================
   v1.0 — _Layout.cshtml inline stillerinden çıkarıldı
   ================================================================= */

/* -----------------------------------------------------------------
   1. GLOBAL LOADING OVERLAY
   ----------------------------------------------------------------- */

#global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: var(--z-modal, 1050);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-slow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#global-loading.is-active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="dark"] #global-loading {
    background: rgba(15, 23, 42, 0.85);
}

[data-theme="dark"] #global-loading .text-primary {
    color: var(--brand-accent) !important;
}

/* -----------------------------------------------------------------
   1.1 PAGE NAVIGATION SKELETON PREVIEW
   ----------------------------------------------------------------- */
.global-skeleton-preview {
    width: 92%;
    max-width: 1140px;
    padding: var(--space-4, 16px);
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 16px);
    pointer-events: none;
}

.global-skeleton-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.global-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

/* -----------------------------------------------------------------
   2. SCOPED LOADING OVERLAY (loading-helper.ts)
   ----------------------------------------------------------------- */

.estm-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

[data-theme="dark"] .estm-loading-overlay {
    background: rgba(15, 23, 42, 0.85);
}

.estm-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -----------------------------------------------------------------
   3. BUTTON LOADING STATE
   ----------------------------------------------------------------- */

button[data-submitting="true"],
.btn[data-submitting="true"] {
    pointer-events: none !important;
    opacity: 0.85;
}

.estm-btn-loading {
    position: relative;
}

.estm-btn-loading .spinner-border {
    vertical-align: middle;
    margin-right: var(--space-2);
}

/* -----------------------------------------------------------------
   4. WCAG 2.2 AA
   ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    #global-loading,
    .estm-loading-overlay,
    .spinner-border {
        transition: none !important;
        animation-duration: 1.5s !important;
    }
}