/* ===================================
   Professional Page Loader with Phone Animation
   =================================== */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #26316d 0%, #4a5a9e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hide {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    position: relative;
}

/* Phone Container */
.phone-container {
    width: 200px;
    height: 400px;
    position: relative;
    margin: 0 auto 30px;
    perspective: 1000px;
}

/* Phone Device */
.phone {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: rotatePhone 3s ease-in-out infinite;
}

@keyframes rotatePhone {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
    }
    25% {
        transform: rotateY(180deg) rotateX(10deg);
    }
    50% {
        transform: rotateY(360deg) rotateX(0deg);
    }
    75% {
        transform: rotateY(540deg) rotateX(-10deg);
    }
    100% {
        transform: rotateY(720deg) rotateX(0deg);
    }
}

.phone-frame {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    border-radius: 35px;
    padding: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 3px solid #2d2d44;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #26316d 0%, #4a5a9e 100%);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notch */
.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #1a1a2e;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.phone-notch::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 5px;
    background: #333;
    border-radius: 10px;
}

/* Logo on Screen */
.phone-logo {
    width: 100px;
    height: 100px;
    position: relative;
    z-index: 5;
    animation: pulseLogo 2s ease-in-out infinite;
}

.phone-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

/* Loading Dots */
.loading-dots {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loader Text */
.loader-text {
    color: white;
    margin-top: 40px;
}

.loader-text h2 {
    font-family: 'Cairo', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    animation: fadeInUp 1s ease;
}

.loader-text p {
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.loader-progress {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin: 30px auto 0;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.8));
    border-radius: 10px;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
        transform: translateX(0);
    }
    50% {
        width: 100%;
        transform: translateX(0);
    }
    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* Particles Background */
.loader-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 6s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 20%; animation-delay: 0.5s; }
.particle:nth-child(3) { left: 30%; animation-delay: 1s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1.5s; }
.particle:nth-child(5) { left: 50%; animation-delay: 2s; }
.particle:nth-child(6) { left: 60%; animation-delay: 2.5s; }
.particle:nth-child(7) { left: 70%; animation-delay: 3s; }
.particle:nth-child(8) { left: 80%; animation-delay: 3.5s; }
.particle:nth-child(9) { left: 90%; animation-delay: 4s; }

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .phone-container {
        width: 150px;
        height: 300px;
    }
    
    .phone-logo {
        width: 70px;
        height: 70px;
    }
    
    .loader-text h2 {
        font-size: 24px;
    }
    
    .loader-text p {
        font-size: 14px;
    }
    
    .loader-progress {
        width: 250px;
    }
}
