/* ====================================
   ISLAMIC TIMELINE LOADING ANIMATION
   ==================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    overflow: hidden;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated Journey Scene */
.journey-scene {
    position: relative;
    width: 500px;
    height: 250px;
    margin-bottom: 40px;
}

/* Islamic Timeline Path */
.timeline-path {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(100, 149, 237, 0.3) 5%,
        rgba(100, 149, 237, 0.8) 50%,
        rgba(100, 149, 237, 0.3) 95%,
        transparent 100%
    );
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.timeline-path::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(100, 149, 237, 0.8), transparent);
    animation: pathGlow 2s ease-in-out infinite;
}

@keyframes pathGlow {
    0%, 100% { 
        opacity: 0.3;
        box-shadow: 0 0 15px rgba(100, 149, 237, 0.5);
    }
    50% { 
        opacity: 1;
        box-shadow: 0 0 30px rgba(100, 149, 237, 0.9);
    }
}

/* Timeline Milestone Dots */
.milestone {
    position: absolute;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #6495ed 0%, #4169e1 100%);
    border: 3px solid rgba(100, 149, 237, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 25px rgba(100, 149, 237, 0.8),
                inset 0 0 10px rgba(255, 255, 255, 0.3);
    animation: milestoneAppear 0.6s ease-out backwards;
}

.milestone::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(100, 149, 237, 0.7);
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes milestoneAppear {
    from {
        transform: translateY(-50%) scale(0);
        opacity: 0;
    }
    to {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

.milestone:nth-child(2) { left: 5%; animation-delay: 0.2s; }
.milestone:nth-child(3) { left: 22%; animation-delay: 0.5s; }
.milestone:nth-child(4) { left: 39%; animation-delay: 0.8s; }
.milestone:nth-child(5) { left: 56%; animation-delay: 1.1s; }
.milestone:nth-child(6) { left: 73%; animation-delay: 1.4s; }
.milestone:nth-child(7) { left: 90%; animation-delay: 1.7s; }

/* Milestone Labels */
.milestone-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(135, 206, 250, 0.95);
    font-size: 0.65rem;
    white-space: nowrap;
    margin-bottom: 10px;
    opacity: 0;
    animation: labelFade 0.6s ease-out 0.3s forwards;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 0 10px rgba(100, 149, 237, 0.6);
}

@keyframes labelFade {
    to { opacity: 1; }
}

/* Traveling Light/Traveler */
.traveler {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    font-size: 28px;
    animation: travel 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(100, 149, 237, 0.9));
}

@keyframes travel {
    0% {
        left: 0%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Islamic Geometric Pattern Background */
.geometric-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0.1;
}

.pattern-shape {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-color);
    animation: rotate 20s linear infinite;
}

.pattern-shape:nth-child(1) {
    top: 10%;
    left: 10%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.pattern-shape:nth-child(2) {
    top: 70%;
    right: 15%;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    animation-delay: -5s;
}

.pattern-shape:nth-child(3) {
    top: 40%;
    left: 80%;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    animation-delay: -10s;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Stars Background */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

.star:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.star:nth-child(2) { top: 40%; left: 30%; animation-delay: 0.3s; }
.star:nth-child(3) { top: 60%; left: 60%; animation-delay: 0.6s; }
.star:nth-child(4) { top: 30%; left: 80%; animation-delay: 0.9s; }
.star:nth-child(5) { top: 70%; left: 20%; animation-delay: 1.2s; }
.star:nth-child(6) { top: 50%; left: 50%; animation-delay: 1.5s; }
.star:nth-child(7) { top: 15%; left: 70%; animation-delay: 1.8s; }
.star:nth-child(8) { top: 80%; left: 40%; animation-delay: 2.1s; }

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

/* Crescent Moon and Star */
.moon {
    position: absolute;
    top: 20px;
    right: 40px;
    width: 50px;
    height: 50px;
}

.crescent {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: -12px 0 0 0 var(--primary-color);
    animation: crescentGlow 3s ease-in-out infinite;
}

.star-symbol {
    position: absolute;
    top: 5px;
    right: -5px;
    color: var(--primary-color);
    font-size: 20px;
    animation: starTwinkle 2s ease-in-out infinite;
}

@keyframes crescentGlow {
    0%, 100% {
        box-shadow: -12px 0 0 0 var(--primary-color),
                    0 0 20px rgba(212, 175, 55, 0.4);
    }
    50% {
        box-shadow: -12px 0 0 0 var(--primary-color),
                    0 0 40px rgba(212, 175, 55, 0.8);
    }
}

@keyframes starTwinkle {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Loading Text */
.loading-text {
    color: var(--primary-color);
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    animation: fadeInOut 2s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Journey Quote */
.journey-quote {
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
    max-width: 500px;
    margin-bottom: 30px;
    animation: slideUp 1s ease-out 0.5s backwards;
    direction: rtl;
    font-weight: 500;
}

.journey-quote-english {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 10px;
    direction: ltr;
    font-style: normal;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%);
    background-size: 200% 100%;
    width: 0%;
    border-radius: 10px;
    animation: progressFill 2.5s ease-out forwards, shimmer 2s linear infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

@keyframes progressFill {
    to {
        width: 100%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Floating Particles */
.loading-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: floatUp 4s ease-in infinite;
}

.loading-particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.loading-particle:nth-child(2) { left: 20%; animation-delay: 0.5s; }
.loading-particle:nth-child(3) { left: 30%; animation-delay: 1s; }
.loading-particle:nth-child(4) { left: 40%; animation-delay: 1.5s; }
.loading-particle:nth-child(5) { left: 50%; animation-delay: 2s; }
.loading-particle:nth-child(6) { left: 60%; animation-delay: 2.5s; }
.loading-particle:nth-child(7) { left: 70%; animation-delay: 3s; }
.loading-particle:nth-child(8) { left: 80%; animation-delay: 3.5s; }
.loading-particle:nth-child(9) { left: 90%; animation-delay: 4s; }

@keyframes floatUp {
    0% {
        bottom: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        bottom: 100%;
        opacity: 0;
    }
}

/* Loading Icon with Moon and Star */
.loading-icon {
    position: relative;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

.icon-backdrop {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(8px);
    animation: softGlow 3s ease-in-out infinite;
}

.icon-content {
    position: relative;
    font-size: 4rem;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
    z-index: 1;
}

@keyframes softGlow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .journey-scene {
        width: 90%;
        max-width: 400px;
        height: 180px;
    }
    
    .loading-text {
        font-size: 1.5rem;
    }
    
    .journey-quote {
        font-size: 0.95rem;
        max-width: 90%;
        padding: 0 20px;
    }
    
    .loading-progress {
        width: 80%;
        max-width: 300px;
    }
    
    .milestone {
        width: 15px;
        height: 15px;
    }
    
    .milestone-label {
        font-size: 0.65rem;
    }
}
