/**
 * Tempo Unified Loading System
 * Single source of truth for all loading states
 * 
 * Variants:
 *   .tempo-loader--fullscreen  (initial app load)
 *   .tempo-loader--section     (cards/panels)
 *   .tempo-loader--inline      (buttons/small areas)
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    --tempo-loader-primary: #FF4D8D;
    --tempo-loader-secondary: #7C5CFC;
    --tempo-loader-bg: rgba(10, 10, 15, 0.95);
    --tempo-loader-text: rgba(255, 255, 255, 0.7);
}

/* ==================== BASE LOADER ==================== */
.tempo-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.tempo-loader[hidden] {
    display: none !important;
}

/* ==================== SPINNER ==================== */
.tempo-spinner {
    position: relative;
    width: 48px;
    height: 48px;
}

.tempo-spinner__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--tempo-loader-primary);
    border-right-color: var(--tempo-loader-secondary);
    animation: tempo-spin 1s linear infinite;
}

.tempo-spinner__icon {
    position: absolute;
    inset: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tempo-pulse 2s ease-in-out infinite;
}

.tempo-spinner__icon svg {
    width: 100%;
    height: 100%;
}

@keyframes tempo-spin {
    to { transform: rotate(360deg); }
}

@keyframes tempo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

/* ==================== LOADING TEXT ==================== */
.tempo-loader__text {
    font-size: 14px;
    color: var(--tempo-loader-text);
    text-align: center;
}

.tempo-loader__brand {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--tempo-loader-primary), var(--tempo-loader-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* ==================== LOADING DOTS ==================== */
.tempo-dots {
    display: flex;
    gap: 6px;
}

.tempo-dots span {
    width: 6px;
    height: 6px;
    background: var(--tempo-loader-primary);
    border-radius: 50%;
    animation: tempo-bounce 1.4s ease-in-out infinite;
}

.tempo-dots span:nth-child(1) { animation-delay: 0s; }
.tempo-dots span:nth-child(2) { animation-delay: 0.2s; }
.tempo-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes tempo-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-8px); opacity: 1; }
}

/* ==================== FULLSCREEN VARIANT ==================== */
.tempo-loader--fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--tempo-loader-bg);
    gap: 20px;
}

.tempo-loader--fullscreen .tempo-spinner {
    width: 64px;
    height: 64px;
}

.tempo-loader--fullscreen .tempo-spinner__ring {
    border-width: 4px;
}

.tempo-loader--fullscreen .tempo-loader__brand {
    font-size: 28px;
    margin-top: 8px;
}

/* ==================== SECTION VARIANT ==================== */
.tempo-loader--section {
    padding: 40px 20px;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.tempo-loader--section .tempo-spinner {
    width: 40px;
    height: 40px;
}

.tempo-loader--section .tempo-spinner__ring {
    border-width: 2px;
}

/* ==================== INLINE VARIANT ==================== */
.tempo-loader--inline {
    flex-direction: row;
    gap: 8px;
    padding: 8px;
}

.tempo-loader--inline .tempo-spinner {
    width: 20px;
    height: 20px;
}

.tempo-loader--inline .tempo-spinner__ring {
    border-width: 2px;
}

.tempo-loader--inline .tempo-spinner__icon {
    display: none;
}

.tempo-loader--inline .tempo-loader__text {
    font-size: 13px;
}

.tempo-loader--inline .tempo-dots,
.tempo-loader--inline .tempo-loader__brand {
    display: none;
}

/* ==================== OVERLAY MODE ==================== */
.tempo-loader--overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.8);
    border-radius: inherit;
    z-index: 10;
}

/* ==================== TRANSITION ==================== */
.tempo-loader--fade-out {
    animation: tempo-fade-out 0.3s ease-out forwards;
}

@keyframes tempo-fade-out {
    to { opacity: 0; visibility: hidden; }
}
