/* ====================================
   LOADING SCREEN STYLES
   ==================================== */

/* Loader Container */
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--brown-primary), var(--burgundy-light));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Animated Background Pattern */
.loader-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%);
    animation: patternMove 20s ease-in-out infinite;
}

@keyframes patternMove {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Geometric Islamic Pattern */
/* .geometric-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.3) 35px, rgba(212, 175, 55, 0.3) 70px),
        repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.3) 35px, rgba(212, 175, 55, 0.3) 70px);
} */

/* Logo Animation Container */
.loader-logo-wrapper {
    position: relative;
    z-index: 2;
    margin-bottom: 40px;
    animation: logoEntrance 1s ease-out;
}

@keyframes logoEntrance {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(180deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.loader-logo {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(212, 175, 55));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Decorative Circle */
.logo-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: circleRotate 8s linear infinite;
}

.logo-circle::before,
.logo-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border:2px solid rgba(255, 255, 255, 0.3);
}

.logo-circle::before {
    width: 250px;
    height: 250px;
    animation: circleRotate 10s linear infinite reverse;
}

.logo-circle::after {
    width: 190px;
    height: 190px;
    animation: circleRotate 6s linear infinite;
}

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

/* Site Title */
.loader-title {
    position: relative;
    z-index: 2;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
    animation: titleFadeIn 1s ease-out 0.3s both;
}

@keyframes titleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader-subtitle {
    position: relative;
    z-index: 2;
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 50px;
    animation: titleFadeIn 1s ease-out 0.5s both;
}

/* Progress Bar Container */
.loader-progress-container {
    position: relative;
    z-index: 2;
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: progressEntrance 1s ease-out 0.7s both;
}

@keyframes progressEntrance {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Progress Bar */
.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        #d4af37 0%, 
        #f4d03f 50%, 
        #d4af37 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Progress Bar Shine Effect */
.loader-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { left: -100%; }
    50%, 100% { left: 100%; }
}

/* Loading Percentage */
.loader-percentage {
    position: relative;
    z-index: 2;
    margin-top: 15px;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    color: #fff;
    font-weight: 600;
    text-align: center;
    animation: percentageFadeIn 1s ease-out 0.9s both;
}

@keyframes percentageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Decorative Dots */
.loader-dots {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.loader-dot {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.loader-dot:nth-child(1) { animation-delay: 0s; }
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

/* Particles Effect */
.loader-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--gold-accent, #d4af37);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-logo {
        width: 140px;
    }
    
    .logo-circle {
        width: 180px;
        height: 180px;
    }
    
    .logo-circle::before {
        width: 210px;
        height: 210px;
    }
    
    .logo-circle::after {
        width: 150px;
        height: 150px;
    }
    
    .loader-title {
        font-size: 2rem;
    }
    
    .loader-subtitle {
        font-size: 0.95rem;
        padding: 0 20px;
    }
    
    .loader-progress-container {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .loader-logo {
        width: 120px;
    }
    
    .logo-circle {
        width: 150px;
        height: 150px;
    }
    
    .logo-circle::before {
        width: 180px;
        height: 180px;
    }
    
    .logo-circle::after {
        width: 120px;
        height: 120px;
    }
    
    .loader-title {
        font-size: 1.75rem;
    }
    
    .loader-subtitle {
        font-size: 0.9rem;
    }
    
    .loader-progress-container {
        width: 220px;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .loader-container {
    background: linear-gradient(135deg, #0a1f15 0%, #050f0a 100%);
}

/* Performance Optimizations */
.loader-container * {
    will-change: transform, opacity;
}

/* Ensure smooth animations */
@media (prefers-reduced-motion: reduce) {
    .loader-container *,
    .loader-container *::before,
    .loader-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
