/**
 * Unified Loader Component (SVG Spinner)
 *
 * Структура:
 * .loader > .loader-content > .spinner + .loader-text
 *
 * SVG спиннер - ИДЕАЛЬНОЕ центрирование на всех экранах
 */

/* === SPINNER (SVG круг) === */
.spinner {
    width: 40px;
    height: 40px;
    display: block;
    margin: 0 auto;
    position: relative;
}

.spinner::before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-bottom-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* === LOADER CONTAINER (полноэкранный) === */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-background);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader.active {
    display: flex;
}

/* === LOADER CONTENT (центрированный контейнер) === */
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: 20px;
}

.loader-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.4;
    max-width: 280px;
}

/* === OVERLAY LOADER (для модальных окон) === */
.overlay-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
}

.overlay-loader .spinner {
    margin: 0 auto;
}
