/* ============================================
   WREN DESIGN SYSTEM - LOADING COMPONENTS
   App loading overlay and spinner states
   ============================================ */

/* ========================================
   APP LOADING OVERLAY
   Full-screen loading overlay with logo
   ======================================== */

.app-loading {
    position: fixed;
    inset: 0;
    background: var(--white);
    z-index: var(--z-popover);
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}

.app-loading.show {
    display: flex;
}

.app-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.app-loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.app-loading-content img {
    animation: pulse 2s ease-in-out infinite;
}

.app-loading-text {
    color: var(--gray-600);
    font-weight: 600;
    font-size: var(--text-sm);
    margin: 0;
}

/* ========================================
   SPINNER COMPONENT
   Standalone spinner for buttons/inline use
   ======================================== */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 0.75s linear infinite;
}

.spinner-sm {
    width: 12px;
    height: 12px;
    border-width: 1.5px;
}

.spinner-lg {
    width: 24px;
    height: 24px;
    border-width: 2.5px;
}

.spinner-xl {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Spinner colors */
.spinner-primary {
    color: var(--wren-terracotta);
}

.spinner-white {
    color: var(--white);
}

.spinner-gray {
    color: var(--gray-400);
}

/* ========================================
   LOADING STATES
   Classes for loading states on elements
   ======================================== */

.is-loading {
    position: relative;
    pointer-events: none;
}

.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
}

/* ========================================
   MAIN CONTENT AREA
   Content below navbar
   ======================================== */

.main-content {
    min-height: calc(100vh - 73px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .app-loading-content img {
        width: 48px;
        height: 48px;
    }

    .app-loading-text {
        font-size: var(--text-xs);
    }
}
