/**
 * Rotating Globe Loader Animation
 * Beautiful spinning earth with location markers
 */

/* Globe Loader Container */
.globe-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.globe-loader-container.active {
    opacity: 1;
    visibility: visible;
}

/* Globe Loader Content */
.globe-loader-content {
    text-align: center;
    max-width: 500px;
    padding: 40px 20px;
    position: relative;
}

/* Close Button */
.globe-loader-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.globe-loader-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: rotate(90deg);
}

.globe-loader-close:active {
    transform: rotate(90deg) scale(0.9);
}

.globe-loader-close svg {
    width: 20px;
    height: 20px;
}

/* Globe Container */
.globe-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    perspective: 1000px;
}

/* Globe */
.globe {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateGlobe 20s linear infinite;
}

@keyframes rotateGlobe {
    0% {
        transform: rotateY(0deg) rotateX(10deg);
    }
    100% {
        transform: rotateY(360deg) rotateX(10deg);
    }
}

/* Globe Sphere */
.globe-sphere {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f 0%, #0d1f3c 100%);
    box-shadow: 
        inset -20px -20px 50px rgba(0, 0, 0, 0.5),
        inset 20px 20px 50px rgba(255, 255, 255, 0.1),
        0 0 50px rgba(59, 130, 246, 0.3),
        0 0 100px rgba(59, 130, 246, 0.2);
    overflow: hidden;
}

/* Globe Grid Lines */
.globe-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.globe-grid::before,
.globe-grid::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
}

/* Latitude lines */
.globe-grid::before {
    top: 25%;
    left: 10%;
    right: 10%;
    height: 50%;
}

/* Longitude line */
.globe-grid::after {
    top: 10%;
    left: 25%;
    width: 50%;
    height: 80%;
}

/* Continents */
.globe-continents {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: 
        radial-gradient(ellipse 30px 40px at 35% 40%, rgba(102, 187, 106, 0.6) 0%, transparent 100%),
        radial-gradient(ellipse 25px 35px at 65% 35%, rgba(102, 187, 106, 0.6) 0%, transparent 100%),
        radial-gradient(ellipse 35px 30px at 45% 65%, rgba(102, 187, 106, 0.6) 0%, transparent 100%);
    animation: driftContinents 30s linear infinite;
}

@keyframes driftContinents {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-10px);
    }
}

/* Location Markers */
.globe-markers {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.location-marker {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    animation: markerPulse 2s ease-in-out infinite;
}

.location-marker:nth-child(1) {
    top: 30%;
    left: 40%;
    animation-delay: 0s;
}

.location-marker:nth-child(2) {
    top: 50%;
    left: 65%;
    animation-delay: 0.5s;
}

.location-marker:nth-child(3) {
    top: 60%;
    left: 35%;
    animation-delay: 1s;
}

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

/* Orbiting Satellites */
.globe-orbit {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    border: 1px dashed rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    animation: orbitRotate 15s linear infinite;
}

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

.satellite {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.satellite::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    top: 50%;
    left: -3px;
    transform: translateY(-50%);
}

/* Globe Glow Effect */
.globe-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Loading Text */
.globe-loader-text {
    margin-top: 30px;
}

.globe-loader-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.globe-loader-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Progress Steps */
.globe-loader-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.loader-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    transition: all 0.3s ease;
}

.loader-step.active {
    color: #3b82f6;
}

.loader-step.completed {
    color: #10b981;
}

.step-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.step-icon::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader-step.active .step-icon::after {
    opacity: 1;
    animation: stepPulse 1.5s ease-in-out infinite;
}

.loader-step.completed .step-icon::after {
    opacity: 1;
}

@keyframes stepPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Progress Bar */
.globe-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 25px;
}

.globe-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.globe-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .globe-container {
        width: 160px;
        height: 160px;
    }
    
    .globe-loader-title {
        font-size: 20px;
    }
    
    .globe-loader-subtitle {
        font-size: 13px;
    }
    
    .globe-loader-steps {
        flex-direction: column;
        gap: 12px;
    }
}

/* Dark Theme Compatibility */
@media (prefers-color-scheme: dark) {
    .globe-loader-container {
        background: rgba(0, 0, 0, 0.9);
    }
}
