/* Ultra Modern Loading Screen */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
    overflow: hidden;
}

.page-loader.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: scale(1.1) !important;
}

/* Animated Background */
.loader-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 6s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
    animation-duration: 8s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 40%;
    animation-delay: 4s;
    animation-duration: 7s;
}

.particle:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    top: 70%;
    left: 10%;
    animation-delay: 3s;
    animation-duration: 5s;
}

.particle:nth-child(6) {
    top: 10%;
    left: 60%;
    animation-delay: 5s;
    animation-duration: 6s;
}

/* Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
    animation: orbFloat 10s ease-in-out infinite;
}

.orb-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.8) 0%, transparent 70%);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.6) 0%, transparent 70%);
    bottom: 10%;
    right: 10%;
    animation-delay: 3s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(240, 147, 251, 0.7) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 6s;
}

/* Main Content */
.loader-content {
    text-align: center;
    color: white;
    z-index: 2;
    position: relative;
    max-width: 500px;
    padding: 0 20px;
}

/* Logo Container with Advanced Effects */
.loader-logo-container {
    position: relative;
    margin-bottom: 40px;
    display: inline-block;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.loader-logo {
    width: 100px;
    height: 100px;
    position: relative;
    z-index: 3;
    animation: logoFloat 3s ease-in-out infinite;
}

.loader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
}

.logo-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ring-1 {
    width: 120px;
    height: 120px;
    animation: ringRotate 4s linear infinite;
    border-top-color: rgba(255, 255, 255, 0.8);
}

.ring-2 {
    width: 140px;
    height: 140px;
    animation: ringRotate 6s linear infinite reverse;
    border-right-color: rgba(255, 255, 255, 0.6);
}

.ring-3 {
    width: 160px;
    height: 160px;
    animation: ringRotate 8s linear infinite;
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

/* Advanced Spinner */
.advanced-spinner {
    position: relative;
    margin: 30px auto;
    width: 80px;
    height: 80px;
}

.spinner-outer {
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    position: relative;
}

.spinner-inner {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-bottom: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite reverse;
}

.spinner-dots {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.dot-1 {
    top: -30px;
    left: -4px;
    animation-delay: 0s;
}

.dot-2 {
    right: -30px;
    top: -4px;
    animation-delay: 0.375s;
}

.dot-3 {
    bottom: -30px;
    right: -4px;
    animation-delay: 0.75s;
}

.dot-4 {
    left: -30px;
    bottom: -4px;
    animation-delay: 1.125s;
}

/* Animated Text */
.loader-text-container {
    margin-bottom: 40px;
}

.loader-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.text-word {
    display: inline-block;
    animation: wordFadeIn 0.8s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.text-word:nth-child(1) { animation-delay: 0.2s; }
.text-word:nth-child(2) { animation-delay: 0.4s; }
.text-word:nth-child(3) { animation-delay: 0.6s; }

.loader-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

.typing-effect {
    display: inline-block;
    border-right: 2px solid white;
    animation: typing 4s steps(40) infinite, blink 1s infinite;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
}

/* Enhanced Progress Bar */
.progress-container {
    width: 100%;
    max-width: 350px;
    margin: 0 auto 30px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.loader-progress {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    animation: progressShimmer 2s ease-in-out infinite;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #fff, #f093fb, #fff);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-glow {
    position: absolute;
    top: -2px;
    right: -10px;
    width: 20px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-progress-bar:not([style*="width: 0"]) + .progress-glow {
    opacity: 1;
}

/* Loading Steps */
.loading-steps {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    transform: scale(1.1);
}

.step.completed {
    opacity: 0.7;
}

.step-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.step-text {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
}

/* Keyframe Animations */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) translateX(0px); opacity: 0.6; }
    25% { transform: translateY(-20px) translateX(10px); opacity: 1; }
    50% { transform: translateY(-40px) translateX(-5px); opacity: 0.8; }
    75% { transform: translateY(-20px) translateX(-10px); opacity: 1; }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.1); }
    50% { transform: translate(-15px, -30px) scale(0.9); }
    75% { transform: translate(-25px, 15px) scale(1.05); }
}

@keyframes logoGlow {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@keyframes ringRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

@keyframes wordFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 50% { width: 0; }
    100% { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: white; }
    51%, 100% { border-color: transparent; }
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Modern Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
    z-index: 1001;
    transition: width 0.1s ease;
}

/* Modern Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

.scroll-to-top:active {
    transform: translateY(-2px) scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .loader-content {
        padding: 0 15px;
    }
    
    .loader-text {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .loader-subtitle {
        font-size: 1rem;
    }
    
    .progress-container {
        max-width: 280px;
    }
    
    .loading-steps {
        gap: 20px;
    }
    
    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .step-text {
        font-size: 0.7rem;
    }
    
    .loader-logo {
        width: 80px;
        height: 80px;
    }
    
    .logo-glow {
        width: 100px;
        height: 100px;
    }
    
    .ring-1 { width: 100px; height: 100px; }
    .ring-2 { width: 120px; height: 120px; }
    .ring-3 { width: 140px; height: 140px; }
    
    .advanced-spinner {
        width: 60px;
        height: 60px;
    }
    
    .spinner-outer {
        width: 60px;
        height: 60px;
    }
    
    .spinner-inner {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .loading-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .step {
        flex-direction: row;
        gap: 12px;
    }
    
    .step-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* Auto-hide loader after 4 seconds as fallback */
.page-loader {
    animation: autoHideLoader 4s ease-in-out forwards;
}

@keyframes autoHideLoader {
    0%, 85% {
        opacity: 1;
        visibility: visible;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Override animation when manually hidden */
.page-loader.hidden {
    animation: none !important;
}
/
* Additional Modern Enhancements */
.page-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    animation: backgroundPulse 6s ease-in-out infinite;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Enhanced particle effects */
.particle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: particleGlow 2s ease-in-out infinite alternate;
}

@keyframes particleGlow {
    0% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
    100% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 25px rgba(255, 255, 255, 0.5); }
}

/* Smooth entrance animation for loader content */
.loader-content {
    animation: contentFadeIn 1s ease-out forwards;
    opacity: 0;
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced step completion animation */
.step.completed .step-icon {
    background: linear-gradient(135deg, #00b894, #00cec9);
    border-color: #00b894;
    animation: completedPulse 0.6s ease-out;
}

@keyframes completedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Loading text shimmer effect */
.text-word {
    background: linear-gradient(90deg, #fff 0%, #f093fb 50%, #fff 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShimmer 3s ease-in-out infinite, wordFadeIn 0.8s ease forwards;
}

@keyframes textShimmer {
    0%, 100% { background-position: 200% 0; }
    50% { background-position: -200% 0; }
}

/* Progress bar enhancement */
.loader-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-30px); }
    100% { transform: translateX(30px); }
}