/* ===================================
   🎬 AD2ER Loading Screen Styles
   احترافية وجميلة مع تأثيرات حديثة
   =================================== */

/* Loading Screen Container */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loadingScreen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animated Background */
.loading-bg-animation {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.loading-bg-animation::before,
.loading-bg-animation::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
}

.loading-bg-animation::before {
    background: linear-gradient(135deg, #ea580c, #dc2626);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.loading-bg-animation::after {
    background: linear-gradient(135deg, #f97316, #ef4444);
    bottom: -200px;
    right: -200px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

/* Loading Content */
.loading-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Logo Animation */
.loading-logo {
    width: 200px;
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 40px rgba(234, 88, 12, 0.8));
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 40px rgba(234, 88, 12, 0.8));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 60px rgba(234, 88, 12, 1));
        transform: scale(1.05);
    }
}

/* Film Reel Spinner */
.film-reel-spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.film-reel {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 6px solid transparent;
    border-top-color: #ea580c;
    border-right-color: #f97316;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.film-reel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 80%;
    border: 6px solid transparent;
    border-bottom-color: #dc2626;
    border-left-color: #ef4444;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 2s linear infinite reverse;
}

.film-reel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #ea580c, #dc2626);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.8);
}

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

/* Loading Text */
.loading-text {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #ea580c, #f97316, #ea580c);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 2s linear infinite;
}

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

/* Loading Subtitle */
.loading-subtitle {
    color: #9ca3af;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 25px;
    animation: fadeInOut 2s ease-in-out infinite;
}

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

/* Progress Bar */
.loading-progress-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ea580c, #f97316, #dc2626);
    background-size: 200% 100%;
    border-radius: 10px;
    animation: progressFill 2s ease-out forwards, progressGlow 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.6);
}

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

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% center;
        box-shadow: 0 0 20px rgba(234, 88, 12, 0.6);
    }
    50% {
        background-position: 100% center;
        box-shadow: 0 0 30px rgba(234, 88, 12, 0.9);
    }
}

/* Film Strip Animation */
.film-strip {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    animation: filmMove 1.5s ease-in-out infinite;
}

.film-frame {
    width: 50px;
    height: 35px;
    background: linear-gradient(135deg, #ea580c, #dc2626);
    border-radius: 4px;
    position: relative;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.film-frame::before,
.film-frame::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 50%;
}

.film-frame::before {
    top: 5px;
    left: 5px;
}

.film-frame::after {
    bottom: 5px;
    right: 5px;
}

.film-frame:nth-child(1) {
    animation: frameFlash 1.5s ease-in-out infinite;
    animation-delay: 0s;
}

.film-frame:nth-child(2) {
    animation: frameFlash 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.film-frame:nth-child(3) {
    animation: frameFlash 1.5s ease-in-out infinite;
    animation-delay: 0.6s;
}

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

@keyframes filmMove {
    0%, 100% {
        transform: translateX(-5px);
    }
    50% {
        transform: translateX(5px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-logo {
        width: 150px;
        margin-bottom: 30px;
    }

    .film-reel-spinner {
        width: 100px;
        height: 100px;
        margin-bottom: 25px;
    }

    .loading-text {
        font-size: 24px;
    }

    .loading-subtitle {
        font-size: 14px;
    }

    .loading-progress-container {
        width: 250px;
    }

    .film-frame {
        width: 40px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 120px;
        margin-bottom: 20px;
    }

    .film-reel-spinner {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .loading-text {
        font-size: 20px;
    }

    .loading-subtitle {
        font-size: 12px;
    }

    .loading-progress-container {
        width: 200px;
    }

    .film-strip {
        gap: 8px;
    }

    .film-frame {
        width: 35px;
        height: 24px;
    }
}

/* Loading Tips */
.loading-tips {
    margin-top: 40px;
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
    animation: fadeInOut 3s ease-in-out infinite;
}

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

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(234, 88, 12, 0.6);
    border-radius: 50%;
    animation: particleFloat 10s linear infinite;
}

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

@keyframes particleFloat {
    0% {
        bottom: -10px;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(50px);
    }
}
