/**
 * Layali (Food) Theme - Page Loader Styles
 * Visual Identity: Elegant Black & Gold
 * Primary: #0A0A0A (Black), Secondary: #D4AF37 (Gold)
 * 
 * @package AlOmran
 */

/* Loader Container */
#alomran-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FAF9F6 0%, #F5F3F0 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    overflow: hidden;
}

#alomran-page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated Background - Black & Gold Theme */
#alomran-page-loader::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(10, 10, 10, 0.08) 0%, transparent 70%);
    animation: loader-bg-rotate 20s linear infinite;
}

#alomran-page-loader::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    animation: loader-bg-rotate 25s linear infinite reverse;
}

@keyframes loader-bg-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loader Content */
.loader-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Logo/Icon Animation - Black & Gold Gradient */
.loader-logo {
    width: 90px;
    height: 90px;
    margin: 0 auto 2rem;
    position: relative;
    animation: loader-logo-pulse 2s ease-in-out infinite;
}

.loader-logo-inner {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1a 50%, #D4AF37 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: #D4AF37;
    box-shadow: 0 20px 60px rgba(10, 10, 10, 0.3), 0 0 40px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.3);
}

.loader-logo-inner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loader-shine 2s infinite;
}

@keyframes loader-logo-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes loader-shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Spinner - Black & Gold Theme */
.loader-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.loader-spinner::before,
.loader-spinner::after {
    content: '';
    position: absolute;
    border: 4px solid transparent;
    border-top-color: #0A0A0A;
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

.loader-spinner::before {
    width: 60px;
    height: 60px;
    border-top-color: #0A0A0A;
    border-right-color: #0A0A0A;
}

.loader-spinner::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
    border-top-color: #D4AF37;
    border-right-color: #D4AF37;
    animation-duration: 0.8s;
    animation-direction: reverse;
}

@keyframes loader-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Progress Bar - Black & Gold Gradient */
.loader-progress {
    width: 200px;
    height: 5px;
    background: rgba(10, 10, 10, 0.15);
    border-radius: 3px;
    margin: 0 auto 1rem;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0A0A0A 0%, #2a2a2a 50%, #D4AF37 100%);
    border-radius: 3px;
    width: 0%;
    animation: loader-progress 2s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loader-progress-shine 1.5s infinite;
}

@keyframes loader-progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

@keyframes loader-progress-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

/* Loading Text - Black */
.loader-text {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0A0A0A;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 1rem;
    animation: loader-text-fade 2s ease-in-out infinite;
}

@keyframes loader-text-fade {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Dots Animation - Black & Gold Theme */
.loader-dots {
    display: inline-flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: #0A0A0A;
    border-radius: 50%;
    animation: loader-dots-bounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) {
    animation-delay: 0s;
    background: #0A0A0A;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
    background: #2a2a2a;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
    background: #D4AF37;
}

@keyframes loader-dots-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Cooking Icons Animation */
.loader-cooking-icons {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.loader-cooking-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: loader-icon-float 6s ease-in-out infinite;
}

.loader-cooking-icon:nth-child(1) {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.loader-cooking-icon:nth-child(2) {
    top: 25%;
    right: 15%;
    animation-delay: 1s;
}

.loader-cooking-icon:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

.loader-cooking-icon:nth-child(4) {
    bottom: 30%;
    right: 10%;
    animation-delay: 3s;
}

.loader-cooking-icon:nth-child(5) {
    top: 50%;
    left: 5%;
    animation-delay: 4s;
}

.loader-cooking-icon:nth-child(6) {
    top: 60%;
    right: 5%;
    animation-delay: 5s;
}

@keyframes loader-icon-float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.15;
    }
    50% {
        transform: translateY(-20px) rotate(10deg);
        opacity: 0.25;
    }
}

/* RTL Support */
[dir="rtl"] .loader-content {
    direction: rtl;
}

/* Responsive */
@media (max-width: 640px) {
    .loader-logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1.5rem;
    }
    
    .loader-logo-inner {
        font-size: 2rem;
        border-radius: 15px;
    }
    
    .loader-spinner {
        width: 50px;
        height: 50px;
    }
    
    .loader-spinner::after {
        width: 30px;
        height: 30px;
        top: 10px;
        left: 10px;
    }
    
    .loader-progress {
        width: 150px;
    }
    
    .loader-text {
        font-size: 0.75rem;
    }
}
