/* CSS Custom Properties for Responsive Design */
:root {
    /* Responsive breakpoints */
    --breakpoint-desktop: 1100px;
    --breakpoint-tablet: 768px;
    --breakpoint-mobile-large: 480px;

    /* Fluid typography */
    --font-size-small: clamp(12px, 2.5vw, 14px);
    --font-size-base: clamp(14px, 3vw, 16px);
    --font-size-large: clamp(16px, 3.5vw, 18px);
    --font-size-xlarge: clamp(18px, 4vw, 24px);

    /* Touch targets */
    --min-touch-target: 44px;

    /* Safe area insets for notched devices */
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --safe-area-left: env(safe-area-inset-left);
    --safe-area-right: env(safe-area-inset-right);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Finger Paint', cursive;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
}

/* App container */
#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Page system */
.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

.page.active {
    opacity: 1;
    visibility: visible;
}

/* Common gradient background */
.container, #map-page {
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #07002B 63.94%, #000000 100%);
    position: relative;
    overflow: hidden;
}

/* Animation keyframes */
@keyframes sparkle {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateY(0px);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

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

/* Utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 480px;
    width: 90%;
    padding: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-title {
    font-family: 'Finger Paint', cursive;
    font-size: 24px;
    font-weight: 600;
    color: white;
    text-align: center;
    margin-bottom: 8px;
}

.progress-bar-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF3AA2, #FFD700);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.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 2s linear infinite;
}

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

.progress-percentage {
    font-family: 'Finger Paint', cursive;
    font-size: 16px;
    font-weight: 600;
    color: white;
    min-width: 40px;
    text-align: right;
}

.loading-step-text {
    font-family: 'Finger Paint', cursive;
    font-size: 16px;
    color: #FFD700;
    text-align: center;
    min-height: 24px;
}

.loading-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    opacity: 0.6;
}

.step.active {
    opacity: 1;
    background: rgba(255, 58, 162, 0.2);
    border-color: #FF3AA2;
    transform: scale(1.05);
}

.step.completed {
    opacity: 1;
    background: rgba(255, 215, 0, 0.2);
    border-color: #FFD700;
}

.step-icon {
    font-size: 20px;
    line-height: 1;
}

.step.completed .step-icon {
    filter: grayscale(0);
}

.step:not(.completed) .step-icon {
    filter: grayscale(0.8);
}

.step.active .step-icon {
    filter: grayscale(0);
    animation: bounce 0.6s ease-in-out infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.step-text {
    font-family: 'Finger Paint', cursive;
    font-size: 12px;
    color: white;
    text-align: center;
    line-height: 1.2;
}
