/**
 * Religion-Specific Loading Animations
 * Unique loading experiences for each spiritual tradition
 */

:root {
    --religion-primary: #ff0000;
    --religion-secondary: #ffff00;
}

/* Fallback bright colors for debugging */
.religion-loading-overlay * {
    color: white !important;
}

.religion-loading-overlay .loading-icon {
    background: #ff0000 !important;
    color: #ffffff !important;
}

.religion-loading-overlay .loading-message h3 {
    color: #ffff00 !important;
}

.religion-loading-overlay .loading-text {
    color: #00ff00 !important;
}

/* Main Loading Overlay */
.religion-loading-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.religion-loading-overlay.visible {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.loading-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.98)) !important;
    z-index: 1;
}

.loading-content {
    position: relative !important;
    text-align: center !important;
    color: white !important;
    max-width: 500px !important;
    padding: 3rem !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 30px !important;
    border: 3px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
    z-index: 100 !important;
    display: block !important;
    visibility: visible !important;
    min-height: 400px !important;
}

.loading-content.premium-loading {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
}

/* Icon Container */
.loading-icon-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.loading-icon {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 120px !important;
    height: 120px !important;
    background: radial-gradient(circle, var(--religion-primary), var(--religion-secondary)) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 4rem !important;
    color: white !important;
    z-index: 1000 !important;
    box-shadow: 0 0 60px var(--religion-primary), 0 0 120px var(--religion-secondary) !important;
    animation: basePulse 2s ease-in-out infinite !important;
    visibility: visible !important;
}

.premium-loading .loading-icon {
    background: radial-gradient(circle, var(--religion-primary), #FFD700);
    box-shadow: 0 0 40px var(--religion-primary), 0 0 80px rgba(255, 215, 0, 0.4);
}

/* Rotating Rings */
.loading-rings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loading-rings .ring {
    position: absolute;
    border: 3px solid transparent !important;
    border-top: 3px solid #ffff00 !important;
    border-right: 3px solid rgba(255, 0, 0, 0.5) !important;
    border-bottom: 3px solid transparent !important;
    border-left: 3px solid #ff0000 !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    box-shadow: 0 0 30px #ff0000 !important;
}

.loading-rings .ring-1 {
    width: 100px;
    height: 100px;
    top: 10px;
    left: 10px;
    animation: ringRotate 3s linear infinite;
}

.loading-rings .ring-2 {
    width: 110px;
    height: 110px;
    top: 5px;
    left: 5px;
    animation: ringRotate 4s linear infinite reverse;
}

.loading-rings .ring-3 {
    width: 120px;
    height: 120px;
    top: 0;
    left: 0;
    animation: ringRotate 5s linear infinite;
}

@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes basePulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 50px var(--religion-primary), 0 0 100px var(--religion-secondary);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05);
        box-shadow: 0 0 70px var(--religion-primary), 0 0 140px var(--religion-secondary);
    }
}

/* Floating Particles */
.loading-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.loading-particles::before,
.loading-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--religion-secondary);
    border-radius: 50%;
    opacity: 0.7;
    animation: floatParticle 4s linear infinite;
    box-shadow: 0 0 10px var(--religion-secondary);
}

.loading-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 3s;
}

.loading-particles::after {
    top: 70%;
    right: 15%;
    animation-delay: 1.5s;
    animation-duration: 4s;
}

@keyframes floatParticle {
    0% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-200px) rotate(360deg);
        opacity: 0;
    }
}

/* Loading Message */
.loading-message {
    z-index: 1001 !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
}

.loading-message h3 {
    font-size: 2rem !important;
    margin-bottom: 1rem !important;
    color: var(--religion-secondary) !important;
    text-shadow: 0 0 30px var(--religion-primary) !important;
    animation: textGlow 3s ease-in-out infinite !important;
    display: block !important;
    visibility: visible !important;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px var(--religion-primary);
    }
    50% {
        text-shadow: 0 0 30px var(--religion-secondary), 0 0 40px var(--religion-primary);
    }
}

.loading-message .loading-text {
    font-size: 1.3rem !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
    margin-bottom: 2rem !important;
    min-height: 2rem !important;
    color: white !important;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5) !important;
    display: block !important;
    visibility: visible !important;
    z-index: 1001 !important;
}

/* Progress Bar */
.loading-progress {
    width: 100% !important;
    height: 6px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    margin-bottom: 1rem !important;
    display: block !important;
    visibility: visible !important;
    z-index: 1001 !important;
}

.progress-bar {
    height: 100% !important;
    background: linear-gradient(90deg, #ff0000, #ffff00) !important;
    border-radius: 3px !important;
    width: 0% !important;
    transition: width 0.5s ease !important;
    box-shadow: 0 0 20px #ff0000 !important;
    display: block !important;
    visibility: visible !important;
}

/* Religion-Specific Animations */

/* Christianity - Cross Glow */
.crossGlow .loading-icon {
    animation: crossPulse 2s ease-in-out infinite;
}

@keyframes crossPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px var(--religion-primary);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 50px var(--religion-primary), 0 0 80px var(--religion-secondary);
    }
}

/* Judaism - Star Pulse */
.starPulse .loading-icon {
    animation: starRotate 4s linear infinite;
}

@keyframes starRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -50%) rotate(90deg) scale(1.05); }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1); }
    75% { transform: translate(-50%, -50%) rotate(270deg) scale(1.05); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

/* Islam - Crescent Rotate */
.crescentRotate .loading-icon {
    animation: crescentSway 3s ease-in-out infinite;
}

@keyframes crescentSway {
    0%, 100% { transform: translate(-50%, -50%) rotate(-10deg); }
    50% { transform: translate(-50%, -50%) rotate(10deg); }
}

/* Buddhism - Dharma Wheel Spin */
.wheelSpin .loading-icon {
    animation: dharmaWheel 6s linear infinite;
}

@keyframes dharmaWheel {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Hinduism - Om Vibration */
.omVibration .loading-icon {
    animation: omPulse 1.5s ease-in-out infinite;
}

@keyframes omPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1) hue-rotate(0deg);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15);
        filter: brightness(1.3) hue-rotate(30deg);
    }
}

/* Old Norse - Hammer Strike */
.hammerStrike .loading-icon {
    animation: mjolnirStrike 2s ease-in-out infinite;
}

@keyframes mjolnirStrike {
    0%, 90%, 100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
    10% { transform: translate(-50%, -50%) scale(1.2) rotate(10deg); }
    20% { transform: translate(-50%, -50%) scale(0.9) rotate(-5deg); }
}

/* Ancient Greek - Column Rise */
.columnRise .loading-icon {
    animation: templeRise 4s ease-in-out infinite;
}

@keyframes templeRise {
    0%, 100% { transform: translate(-50%, -60%) scale(1); }
    50% { transform: translate(-50%, -40%) scale(1.1); }
}

/* Ancient Egyptian - Ankh Glow */
.ankhGlow .loading-icon {
    animation: ankhPower 3s ease-in-out infinite;
}

@keyframes ankhPower {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px var(--religion-primary);
    }
    33% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 50px #FFD700, 0 0 100px #8B008B;
    }
    66% { 
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 0 40px #8B008B, 0 0 80px #FFD700;
    }
}

/* Pastafarian - Noodle Wave */
.noodleWave .loading-icon {
    animation: noodlyWave 2.5s ease-in-out infinite;
}

@keyframes noodlyWave {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -45%) rotate(5deg) scale(1.05); }
    50% { transform: translate(-50%, -50%) rotate(0deg) scale(0.95); }
    75% { transform: translate(-50%, -55%) rotate(-5deg) scale(1.05); }
}

/* Jedi - Force Flow */
.forceFlow .loading-icon {
    animation: forceEnergy 3s ease-in-out infinite;
}

@keyframes forceEnergy {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px #00CED1, 0 0 60px #32CD32;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 50px #32CD32, 0 0 100px #00CED1;
    }
}

/* Celtic Druid - Tree Grow */
.treeGrow .loading-icon {
    animation: oakGrowth 4s ease-in-out infinite;
}

@keyframes oakGrowth {
    0% { transform: translate(-50%, -70%) scale(0.8); }
    50% { transform: translate(-50%, -40%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Aztec - Sun Rise */
.sunRise .loading-icon {
    animation: sunAscend 5s linear infinite;
}

@keyframes sunAscend {
    0% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        box-shadow: 0 0 30px #8B0000;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15) rotate(180deg);
        box-shadow: 0 0 60px #FFD700, 0 0 100px #8B0000;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        box-shadow: 0 0 30px #8B0000;
    }
}

/* Shinto - Gate Glow */
.gateGlow .loading-icon {
    animation: toriiGlow 3s ease-in-out infinite;
}

@keyframes toriiGlow {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        filter: brightness(1) drop-shadow(0 0 20px #DC143C);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05);
        filter: brightness(1.4) drop-shadow(0 0 40px #FFFFFF);
    }
}

/* Cosmic - Stellar Drift */
.stellarDrift .loading-icon {
    animation: cosmicFloat 6s ease-in-out infinite;
}

@keyframes cosmicFloat {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        box-shadow: 0 0 30px #4B0082, 0 0 60px #00BFFF;
    }
    33% { 
        transform: translate(-45%, -45%) scale(1.1) rotate(120deg);
        box-shadow: 0 0 50px #00BFFF, 0 0 100px #4B0082;
    }
    66% { 
        transform: translate(-55%, -55%) scale(0.9) rotate(240deg);
        box-shadow: 0 0 40px #4B0082, 0 0 80px #00BFFF;
    }
}

/* Universal - Infinity Loop */
.infinityLoop .loading-icon {
    animation: infinityRotate 4s ease-in-out infinite;
}

@keyframes infinityRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    25% { transform: translate(-50%, -50%) rotate(90deg) scale(1.1); }
    50% { transform: translate(-50%, -50%) rotate(180deg) scale(1); }
    75% { transform: translate(-50%, -50%) rotate(270deg) scale(1.1); }
    100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-content {
        max-width: 350px;
        padding: 2rem;
    }
    
    .loading-icon-container {
        width: 100px;
        height: 100px;
    }
    
    .loading-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .loading-rings .ring-1 {
        width: 80px;
        height: 80px;
        top: 10px;
        left: 10px;
    }
    
    .loading-rings .ring-2 {
        width: 90px;
        height: 90px;
        top: 5px;
        left: 5px;
    }
    
    .loading-rings .ring-3 {
        width: 100px;
        height: 100px;
        top: 0;
        left: 0;
    }
    
    .loading-message h3 {
        font-size: 1.3rem;
    }
    
    .loading-message .loading-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-content {
        max-width: 300px;
        padding: 1.5rem;
    }
    
    .loading-icon-container {
        width: 80px;
        height: 80px;
        margin-bottom: 1.5rem;
    }
    
    .loading-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}