/* ================================================
   Premium Loading Screen - SmartBridge Real Estate
   ================================================ */

/* Loading Screen Container - Premium Layered Background */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Multi-layer premium background */
    background: 
        /* Subtle noise texture overlay */
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="300" height="300" filter="url(%23noise)" opacity="0.05"/></svg>'),
        /* Radial gradient spotlight effect */
        radial-gradient(ellipse at 50% 30%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(244, 208, 63, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(194, 127, 58, 0.08) 0%, transparent 40%),
        /* Premium diagonal stripes pattern */
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 100px,
            rgba(255, 255, 255, 0.01) 100px,
            rgba(255, 255, 255, 0.01) 200px
        ),
        /* Rich deep gradient base */
        linear-gradient(135deg, 
            #0f2744 0%,
            #1a3c6d 20%,
            #2d5a8f 50%,
            #1a3c6d 80%,
            #0f2744 100%
        );
    background-size: 
        300px 300px,
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
    background-position: 
        0 0,
        center,
        top right,
        bottom left,
        center,
        center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
    /* Add subtle vignette effect */
    box-shadow: inset 0 0 200px rgba(0, 0, 0, 0.4);
}

/* Animated background overlay for premium effect */
#loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    animation: backgroundPulse 8s ease-in-out infinite;
    pointer-events: none;
}

/* Elegant geometric pattern overlay */
#loading-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(30deg, rgba(255,255,255,0.02) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.02) 87.5%, rgba(255,255,255,0.02)),
        linear-gradient(150deg, rgba(255,255,255,0.02) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.02) 87.5%, rgba(255,255,255,0.02)),
        linear-gradient(30deg, rgba(255,255,255,0.02) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.02) 87.5%, rgba(255,255,255,0.02)),
        linear-gradient(150deg, rgba(255,255,255,0.02) 12%, transparent 12.5%, transparent 87%, rgba(255,255,255,0.02) 87.5%, rgba(255,255,255,0.02));
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px;
    pointer-events: none;
    opacity: 0.3;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Premium Logo Container */
.loading-logo-container {
    position: relative;
    margin-bottom: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* SmartBridge Logo Text */
.loading-logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 50%, #c27f3a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.08em;
    position: relative;
    animation: logoFadeIn 1s ease-out;
    margin: 0;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

/* Shimmer Effect */
.loading-logo-text::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
    animation: shimmer 2.5s infinite linear;
    z-index: 1;
}

/* Subtitle - Real Estate */
.loading-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    color: #d4af37;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    margin: 0;
    padding-top: 0.3rem;
    animation: subtitleFadeIn 1s ease-out 0.3s both;
    text-align: center;
    display: block;
}

/* Premium Loading Spinner */
.loading-spinner-container {
    position: relative;
    width: 120px;
    height: 120px;
}

/* Outer Ring */
.loading-spinner-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(212, 175, 55, 0.2);
    border-top: 3px solid #d4af37;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Middle Ring */
.loading-spinner-middle {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border: 3px solid rgba(244, 208, 63, 0.2);
    border-right: 3px solid #f4d03f;
    border-radius: 50%;
    animation: spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
}

/* Inner Ring */
.loading-spinner-inner {
    position: absolute;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border: 3px solid rgba(194, 127, 58, 0.2);
    border-bottom: 3px solid #c27f3a;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

/* Center Dot */
.loading-spinner-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #d4af37 0%, #f4d03f 100%);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Loading Text - Premium Excellence */
.loading-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-top: 3rem;
    letter-spacing: 0.15em;
    animation: textPulse 2s ease-in-out infinite;
    text-shadow: 0 2px 15px rgba(212, 175, 55, 0.5);
    position: relative;
}

.loading-text::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    animation: lineGlow 2s ease-in-out infinite;
}

/* Premium Progress Bar */
.loading-progress-container {
    width: 350px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    margin-top: 2.5rem;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d4af37 0%, #f4d03f 50%, #d4af37 100%);
    border-radius: 10px;
    width: 0%;
    animation: progressFill 2.5s ease-out forwards;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* Progress Bar Shine Effect */
.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 1.5s infinite linear;
}

/* Progress Percentage Text */
.loading-percentage {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #d4af37;
    margin-top: 1rem;
    letter-spacing: 0.05em;
    animation: textPulse 2s ease-in-out infinite;
}

/* Decorative Particles - Enhanced Premium */
.loading-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.6) 0%, rgba(212, 175, 55, 0.2) 50%, transparent 100%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    box-shadow: 
        0 0 10px rgba(212, 175, 55, 0.4),
        0 0 20px rgba(212, 175, 55, 0.2),
        0 0 30px rgba(212, 175, 55, 0.1);
}

/* Varied particle sizes for depth */
.particle:nth-child(odd) {
    width: 6px;
    height: 6px;
}

.particle:nth-child(even) {
    width: 4px;
    height: 4px;
}

.particle:nth-child(3n) {
    width: 8px;
    height: 8px;
    animation-duration: 8s;
}

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

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes subtitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.7;
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

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

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

@keyframes lineGlow {
    0%, 100% {
        opacity: 0.5;
        width: 60px;
    }
    50% {
        opacity: 1;
        width: 80px;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    50% {
        transform: translateY(0) translateX(20px);
    }
}

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

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
    .loading-logo-text {
        font-size: 3rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
        letter-spacing: 0.25em;
    }
    
    .loading-text {
        font-size: 1.1rem;
    }
    
    .loading-spinner-container {
        width: 100px;
        height: 100px;
    }
    
    .loading-progress-container {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .loading-logo-text {
        font-size: 2.2rem;
    }
    
    .loading-subtitle {
        font-size: 0.75rem;
        letter-spacing: 0.2em;
    }
    
    .loading-text {
        font-size: 0.95rem;
    }
    
    .loading-spinner-container {
        width: 80px;
        height: 80px;
    }
    
    .loading-progress-container {
        width: 220px;
        height: 5px;
    }
}
