/* ============================================
   IRON EMPIRE GYM - ENHANCED PAGE LOADER
   Premium Animated Barbell Loader with Effects
   ============================================ */

/* Loader Overlay */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #0d0d0d 100%);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Animated Background Particles */
.page-loader::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(196, 30, 58, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(196, 30, 58, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(196, 30, 58, 0.05) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
}

/* Barbell Container */
.barbell-loader {
    position: relative;
    width: 300px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 10px 30px rgba(196, 30, 58, 0.4));
    flex-shrink: 0;
}

/* Barbell Bar */
.barbell-bar {
    width: 160px;
    height: 8px;
    background: linear-gradient(90deg, #c0c5ce 0%, #f5f5f5 25%, #8a8f98 50%, #f5f5f5 75%, #c0c5ce 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    position: relative;
    box-shadow:
        0 2px 8px rgba(196, 30, 58, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
    animation: barPulse 1.5s ease-in-out infinite, barShine 3s linear infinite;
}

/* Barbell Weights */
.barbell-weight {
    position: absolute;
    width: 40px;
    height: 65px;
    background: linear-gradient(135deg, #c41e3a 0%, #ff4757 50%, #c41e3a 100%);
    background-size: 200% 200%;
    border-radius: 5px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow:
        0 4px 15px rgba(196, 30, 58, 0.6),
        inset 0 2px 4px rgba(255, 255, 255, 0.2),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    animation: weightBounce 1.5s ease-in-out infinite, weightGlow 2s ease-in-out infinite;
    overflow: hidden;
}

.barbell-weight.left {
    left: -45px;
    animation-delay: 0s;
}

.barbell-weight.right {
    right: -45px;
    animation-delay: 0.75s;
}

/* Weight Inner Detail */
.barbell-weight::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 50px;
    background: linear-gradient(135deg, #ff5252 0%, #ff3b3b 50%, #c41e3a 100%);
    border-radius: 3px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Weight Shine Effect */
.barbell-weight::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: weightShine 2s ease-in-out infinite;
}

/* Grip Marks on Bar */
.barbell-bar::before,
.barbell-bar::after {
    content: '';
    position: absolute;
    width: 3px;
    height: 14px;
    background: #2a2d34;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 1px;
}

.barbell-bar::before {
    left: 30%;
}

.barbell-bar::after {
    right: 30%;
}

/* Loading Text */
.loader-text {
    margin-top: 50px;
    font-family: var(--font-heading), 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-white, #ffffff);
    text-transform: uppercase;
    animation: textPulse 1.5s ease-in-out infinite;
    text-shadow:
        0 0 10px rgba(196, 30, 58, 0.5),
        0 0 20px rgba(196, 30, 58, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.8);
    position: relative;
}

.loader-text::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c41e3a, transparent);
    box-shadow: 0 0 10px rgba(196, 30, 58, 0.8);
    animation: lineExpand 1.5s ease-in-out infinite;
}

.loader-text .dot {
    animation: dotBounce 1.5s ease-in-out infinite;
    display: inline-block;
}

.loader-text .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-text .dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Loading Progress Bar */
.loader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c41e3a 0%, #ff4757 50%, #c41e3a 100%);
    background-size: 200% 100%;
    border-radius: 2px;
    animation: progressSlide 2s ease-in-out infinite, progressGlow 1.5s ease-in-out infinite;
    box-shadow:
        0 0 15px rgba(196, 30, 58, 0.8),
        0 0 30px rgba(196, 30, 58, 0.4);
}

/* Percentage Text */
.loader-percentage {
    margin-top: 15px;
    font-family: var(--font-heading), 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.6);
    animation: textPulse 1.5s ease-in-out infinite;
}

/* Circular Rings Around Loader */
.loader-ring {
    position: absolute;
    border: 2px solid rgba(196, 30, 58, 0.2);
    border-radius: 50%;
    animation: ringPulse 3s ease-in-out infinite;
}

.loader-ring:nth-child(1) {
    width: 300px;
    height: 300px;
    animation-delay: 0s;
}

.loader-ring:nth-child(2) {
    width: 350px;
    height: 350px;
    animation-delay: 0.5s;
}

.loader-ring:nth-child(3) {
    width: 400px;
    height: 400px;
    animation-delay: 1s;
}

/* Animations */
@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes barPulse {

    0%,
    100% {
        transform: scaleX(1);
        box-shadow:
            0 2px 8px rgba(196, 30, 58, 0.3),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }

    50% {
        transform: scaleX(1.08);
        box-shadow:
            0 2px 15px rgba(196, 30, 58, 0.6),
            inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }
}

@keyframes barShine {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 200% 50%;
    }
}

@keyframes weightBounce {

    0%,
    100% {
        transform: translateY(-50%) scale(1) rotateY(0deg);
    }

    50% {
        transform: translateY(-50%) scale(1.15) rotateY(5deg);
    }
}

@keyframes weightGlow {

    0%,
    100% {
        box-shadow:
            0 4px 15px rgba(196, 30, 58, 0.6),
            inset 0 2px 4px rgba(255, 255, 255, 0.2),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow:
            0 4px 25px rgba(196, 30, 58, 0.9),
            0 0 40px rgba(196, 30, 58, 0.5),
            inset 0 2px 4px rgba(255, 255, 255, 0.2),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }
}

@keyframes weightShine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.7;
        text-shadow:
            0 0 10px rgba(196, 30, 58, 0.5),
            0 0 20px rgba(196, 30, 58, 0.3),
            0 2px 4px rgba(0, 0, 0, 0.8);
    }

    50% {
        opacity: 1;
        text-shadow:
            0 0 20px rgba(196, 30, 58, 0.8),
            0 0 40px rgba(196, 30, 58, 0.5),
            0 2px 4px rgba(0, 0, 0, 0.8);
    }
}

@keyframes lineExpand {

    0%,
    100% {
        width: 40px;
        opacity: 0.5;
    }

    50% {
        width: 80px;
        opacity: 1;
    }
}

@keyframes dotBounce {

    0%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-5px);
    }
}

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

    100% {
        transform: translateX(400%);
    }
}

@keyframes progressGlow {

    0%,
    100% {
        background-position: 0% 50%;
        box-shadow:
            0 0 15px rgba(196, 30, 58, 0.8),
            0 0 30px rgba(196, 30, 58, 0.4);
    }

    50% {
        background-position: 100% 50%;
        box-shadow:
            0 0 25px rgba(196, 30, 58, 1),
            0 0 50px rgba(196, 30, 58, 0.6);
    }
}

@keyframes ringPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .barbell-loader {
        transform: scale(0.75);
    }

    .loader-text {
        font-size: 1.4rem;
    }

    .loader-progress {
        width: 180px;
    }

    .loader-ring {
        display: none;
    }
}