/*!
 * G2Own Simple Elegant Preloader
 * A clean, professional preloader for the digital marketplace
 */

/* Enhanced Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: all 0.8s ease-in-out;
}

.loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Loading Content Container */
.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
    position: relative;
}

/* Enhanced Logo Styling */
.loading-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2rem;
    position: relative;
    letter-spacing: 0.1em;
    text-shadow: 0 0 30px rgba(139, 0, 0, 0.5);
    animation: logoGlow 2s ease-in-out infinite alternate;
}

.loading-logo::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #8b0000, transparent);
    transform: translateX(-50%);
    animation: underlineGlow 2s ease-in-out infinite;
}

/* Progress Container */
.loading-progress-container {
    margin-bottom: 1.5rem;
    position: relative;
}

/* Enhanced Progress Bar */
.loading-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.loading-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        #8b0000 0%, 
        #dc143c 25%, 
        #ff4444 50%, 
        #dc143c 75%, 
        #8b0000 100%);
    border-radius: 2px;
    transition: left 0.3s ease;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.6);
    animation: progressShimmer 2s ease-in-out infinite;
}

/* Progress Status Text */
.loading-status {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #8b0000;
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.3);
    animation: statusPulse 1.5s ease-in-out infinite;
}

/* Loading Dots Animation */
.loading-dots {
    display: inline-block;
    margin-top: 1rem;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b0000;
    margin: 0 3px;
    animation: dotBounce 1.4s ease-in-out infinite both;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Subtle Background Animation */
.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139, 0, 0, 0.08) 0%, transparent 50%);
    animation: backgroundPulse 4s ease-in-out infinite;
    pointer-events: none;
}

/* Animations */
@keyframes logoGlow {
    0% { 
        text-shadow: 0 0 30px rgba(139, 0, 0, 0.5);
        transform: scale(1);
    }
    100% { 
        text-shadow: 0 0 40px rgba(139, 0, 0, 0.8), 0 0 60px rgba(139, 0, 0, 0.3);
        transform: scale(1.02);
    }
}

@keyframes underlineGlow {
    0%, 100% { 
        opacity: 0.5;
        width: 60px;
    }
    50% { 
        opacity: 1;
        width: 80px;
    }
}

@keyframes progressShimmer {
    0%, 100% { 
        background-position: 0% 50%;
    }
    50% { 
        background-position: 100% 50%;
    }
}

@keyframes statusPulse {
    0%, 100% { 
        opacity: 0.7;
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.05);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes backgroundPulse {
    0%, 100% { 
        opacity: 0.3;
    }
    50% { 
        opacity: 0.6;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-logo {
        font-size: 2.5rem;
    }
    
    .loading-content {
        padding: 1.5rem;
        max-width: 300px;
    }
    
    .loading-status {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        font-size: 2rem;
    }
    
    .loading-content {
        padding: 1rem;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .loading-screen *,
    .loading-screen *::before,
    .loading-screen *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Smooth fade out when loaded */
body.loaded .loading-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
