/* Global animations and UI utilities — extracted from debug.php */

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Tables grid loading spinner — centered in grid container */
.tables-grid-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 536px;
}

.tables-grid-loading .table-loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

/* Inline spinner utilities — use these instead of "Loading..." text
   in modal content areas (table rows, dropdown labels, data panels). */
@keyframes inlineLoaderRotate {
    to { transform: rotate(360deg); }
}

.inline-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: inlineLoaderRotate 0.9s linear infinite;
    vertical-align: middle;
}

.inline-loader.sm { width: 14px; height: 14px; border-width: 2px; }
.inline-loader.lg { width: 32px; height: 32px; border-width: 3px; }

.inline-loader-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.inline-loader-wrap.compact {
    padding: 0.5rem;
}

@keyframes tableUpdate {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

/* Focus states for better accessibility */
.form-input:focus {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
    outline: none !important;
}

/* Button hover effects */
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

/* Navigation button states */
.member-nav-btn:hover div {
    background: rgba(34, 197, 94, 0.3) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
}

.member-nav-btn.active div {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.3) !important;
}

/* ============================================================================
   CANONICAL APP LOADER — single shared spinner used across the app.
   Matches the first loader users see on page reload (#authLoadingOverlay in
   shared/php/app-head.php). No text labels — just the spinning ring.
   ============================================================================ */
.app-loader-overlay {
    position: fixed;
    inset: 0;
    background: #0a1a0d;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.app-loader-overlay.app-loader-overlay--scoped {
    position: absolute;
    inset: 0;
    background: var(--theme-overlay-dim);
    border-radius: 8px;
    z-index: 9999;
}

.app-loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #22c55e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
