
/* =========================
   APP-WIDE LOADING SCREEN
========================= */

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f6f8fb;

    opacity: 1;
    visibility: visible;
    pointer-events: all;

    transition:
        opacity 0.45s ease,
        visibility 0.45s ease;
}

.app-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
}

/* =========================
   DUMBBELL ANIMATION
========================= */

.loader-animation {
    width: 110px;
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;
}

.dumbbell {
    display: flex;
    align-items: center;
    justify-content: center;

    animation: dumbbell-lift 1.2s ease-in-out infinite;
    transform-origin: center;
}

.dumbbell-bar {
    width: 42px;
    height: 8px;

    background: #f5c542;
    border-radius: 5px;
}

.dumbbell-weight {
    display: block;
    width: 13px;
    height: 35px;

    background: #172b4d;
    border-radius: 4px;
    position: relative;
}

.dumbbell-weight-left {
    margin-right: -2px;
}

.dumbbell-weight-right {
    margin-left: -2px;
}

.loader-title {
    margin: 0;

    color: #172b4d;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.loader-subtitle {
    margin: 0;

    color: #718096;
    font-size: 13px;
}

/* =========================
   ANIMATION
========================= */

@keyframes dumbbell-lift {
    0%, 100% {
        transform: translateY(5px) rotate(-8deg);
    }

    50% {
        transform: translateY(-7px) rotate(8deg);
    }
}

/* =========================
   DARK MODE
========================= */

html[data-theme="dark"] .app-loader {
    background: #111827;
}

html[data-theme="dark"] .loader-title {
    color: #f3f4f6;
}

html[data-theme="dark"] .loader-subtitle {
    color: #9ca3af;
}

html[data-theme="dark"] .dumbbell-weight {
    background: #f5c542;
}

html[data-theme="dark"] .dumbbell-bar {
    background: #e5e7eb;
}

/* =========================
   ACCESSIBILITY
========================= */

@media (prefers-reduced-motion: reduce) {
    .dumbbell {
        animation: none;
    }

    .app-loader {
        transition: none;
    }
}
