/* ===================================
   SPLASH SCREEN WITH LOGO & BUBBLES
   =================================== */

/* Reset and base styles for splash */
* {
    box-sizing: border-box;
}

/* Splash Container - Always centered from the start */
.splash-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* World Map Background */
.world-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 500'%3E%3Cpath fill='%23ffffff' d='M150 50h80v30h-80zM250 80h60v40h-60zM320 60h90v50h-90zM450 40h70v35h-70zM530 75h85v45h-85zM650 55h75v40h-75zM750 35h90v50h-90zM100 150h110v60h-110zM230 180h90v50h-90zM350 160h120v70h-120zM500 140h95v55h-95zM620 175h100v65h-100zM750 155h85v50h-85zM50 280h130v80h-130zM200 290h100v70h-100zM320 270h140v90h-140zM480 260h110v75h-110zM610 285h120v85h-120zM750 275h95v70h-95zM80 400h90v50h-90zM190 420h110v60h-110zM320 410h85v55h-85zM430 400h100v65h-100zM550 415h95v55h-95zM670 405h120v70h-120z'/%3E%3C/svg%3E");
    background-size: 120%;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    animation: mapFloat 20s ease-in-out infinite;
}

/* GPS Signal Icons */
.gps-signals {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.gps-icon {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0.3;
    animation: gpsSignal 3s ease-in-out infinite;
}

.gps-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        0 0 0 6px rgba(255, 255, 255, 0.2),
        0 0 0 12px rgba(255, 255, 255, 0.1),
        0 0 0 18px rgba(255, 255, 255, 0.05);
    animation: gpsWaves 2s ease-out infinite;
}

.gps-icon::after {
    content: '📍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    z-index: 2;
}

/* GPS Icons positioning */
.gps-1 {
    top: 15%;
    left: 20%;
    animation-delay: 0s;
}

.gps-2 {
    top: 30%;
    right: 25%;
    animation-delay: -1s;
}

.gps-3 {
    bottom: 25%;
    left: 15%;
    animation-delay: -2s;
}

.gps-4 {
    bottom: 15%;
    right: 20%;
    animation-delay: -0.5s;
}

.gps-5 {
    top: 45%;
    left: 10%;
    animation-delay: -1.5s;
}

.gps-6 {
    top: 60%;
    right: 10%;
    animation-delay: -2.5s;
}

/* Splash Content - Centered container */
.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 10;
    max-width: 350px;
    padding: 20px;
}

/* Logo Container with Animation */
.logo-container {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: logoEntrance 1.5s ease-out forwards;
    z-index: 2;
    position: relative;
}

/* Logo Pulse Background */
.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: logoPulse 2s ease-in-out infinite;
    z-index: 1;
}

/* App Title */
.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    animation: titleSlideUp 1s ease-out 0.3s both;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* App Subtitle */
.app-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 40px 0;
    animation: subtitleFadeIn 1s ease-out 0.6s both;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* Loading Text */
.loading-text {
    animation: textFadeIn 1s ease-out 1.2s both;
}

.loading-dots {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

/* Background Animation */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: -2s;
}

.shape-3 {
    width: 40px;
    height: 40px;
    top: 80%;
    left: 20%;
    animation-delay: -4s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 10%;
    right: 10%;
    animation-delay: -1s;
}

/* Animations */
@keyframes logoEntrance {
    /*0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) rotate(-90deg);
    }*/
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logoPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.3;
    }
}

@keyframes titleSlideUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loaderFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* GPS and Map Animations */
@keyframes mapFloat {
    0%, 100% {
        transform: translateX(0px) translateY(0px) scale(1);
        opacity: 0.1;
    }
    33% {
        transform: translateX(-10px) translateY(-5px) scale(1.02);
        opacity: 0.15;
    }
    66% {
        transform: translateX(5px) translateY(-8px) scale(0.98);
        opacity: 0.12;
    }
}

@keyframes gpsSignal {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes gpsWaves {
    0% {
        box-shadow: 
            0 0 0 0 rgba(255, 255, 255, 0.4),
            0 0 0 0 rgba(255, 255, 255, 0.2),
            0 0 0 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 0 8px rgba(255, 255, 255, 0.2),
            0 0 0 16px rgba(255, 255, 255, 0.1),
            0 0 0 24px rgba(255, 255, 255, 0.05);
    }
    100% {
        box-shadow: 
            0 0 0 12px rgba(255, 255, 255, 0),
            0 0 0 24px rgba(255, 255, 255, 0),
            0 0 0 36px rgba(255, 255, 255, 0);
    }
}

/* Splash Exit Animation */
.splash-container.fade-out {
    animation: splashFadeOut 0.8s ease-out forwards;
}

@keyframes splashFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1.1);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .app-title {
        font-size: 2rem;
    }
    
    .app-subtitle {
        font-size: 1rem;
    }
    
    .splash-logo {
        width: 80px;
        height: 80px;
    }
    
    .logo-pulse {
        width: 100px;
        height: 100px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .splash-container {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .splash-container {
        background: #000;
    }
    
    .app-title,
    .app-subtitle,
    .loading-dots {
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .splash-logo,
    .logo-pulse,
    .app-title,
    .app-subtitle,
    .modern-loader,
    .loading-text,
    .floating-shape {
        animation: none;
    }
    
    .splash-logo {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    
    .app-title,
    .app-subtitle,
    .modern-loader,
    .loading-text {
        opacity: 1;
        transform: none;
    }
}
