/* Global Loading Animation - Stylish Black Rolling Design */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 30%, #1a1a1a 70%, #000000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

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

/* Animated Background Pattern */
.loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.015) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(255, 255, 255, 0.01) 0%, transparent 60%);
    animation: backgroundPulse 4s ease-in-out infinite;
    pointer-events: none;
}

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

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

/* Brand Logo/Text */
.loading-brand {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 3rem;
    opacity: 0;
    animation: brandReveal 1s ease-out 0.3s forwards;
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 50%, #ffffff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

@keyframes brandReveal {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rolling Loader */
.rolling-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

/* Main Rolling Circle */
.rolling-circle {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: rollingSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    position: relative;
}

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

/* Inner Pulsing Dot */
.rolling-circle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0.8) 70%, transparent 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: innerPulse 1.5s ease-in-out infinite;
}

@keyframes innerPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
}

/* Orbiting Dots */
.rolling-circle::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4);
    animation: orbitGlow 1.2s ease-in-out infinite;
}

@keyframes orbitGlow {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.3);
    }
}

/* Secondary Ring */
.rolling-loader::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: secondaryRing 2s linear infinite reverse;
}

@keyframes secondaryRing {
    0% {
        transform: rotate(0deg);
        opacity: 0.3;
    }
    100% {
        transform: rotate(360deg);
        opacity: 0.1;
    }
}

/* Loading Text */
.loading-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    animation: textFadeIn 1s ease-out 0.8s forwards;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Dots */
.loading-progress {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
    opacity: 0;
    animation: progressFadeIn 1s ease-out 1s forwards;
}

@keyframes progressFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: progressDots 1.4s ease-in-out infinite;
}

.progress-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.progress-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes progressDots {
    0%, 80%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    40% {
        opacity: 1;
        transform: scale(1.4);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .loading-brand {
        font-size: 2rem;
        letter-spacing: 2px;
        margin-bottom: 2.5rem;
    }
    
    .rolling-loader {
        width: 60px;
        height: 60px;
        margin-bottom: 1.5rem;
    }
    
    .rolling-circle::before {
        width: 16px;
        height: 16px;
    }
    
    .rolling-circle::after {
        width: 6px;
        height: 6px;
    }
    
    .loading-text {
        font-size: 0.8rem;
        letter-spacing: 1.5px;
    }
}

@media (max-width: 480px) {
    .loading-brand {
        font-size: 1.6rem;
        letter-spacing: 1px;
        margin-bottom: 2rem;
    }
    
    .rolling-loader {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .rolling-circle::before {
        width: 12px;
        height: 12px;
    }
    
    .rolling-circle::after {
        width: 5px;
        height: 5px;
    }
    
    .loading-text {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    
    .loading-progress {
        margin-top: 1rem;
        gap: 6px;
    }
    
    .progress-dot {
        width: 4px;
        height: 4px;
    }
}

/* Loading Dots Animation */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.loading-dot {
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    animation-delay: 0s;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 20%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}
