/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

/* Container Styles */
.app-container {
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.app-container:not(.hidden) {
    opacity: 1;
}

/* Map Styles */
.map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    margin: 15px auto;
    animation: spin 0.8s linear infinite;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    z-index: 1000;
}

.progress-bar {
    height: 100%;
    background: #4285f4;
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
}

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

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

.welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    z-index: 2000;
}

.background-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    filter: blur(8px) brightness(0.7);
    transition: all 0.5s ease;
}

.welcome-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 90%;
    text-align: center;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-content h1 {
    color: #1f2937;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.book-cover {
    margin: 2rem auto;
}

.book-cover img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.welcome-text {
    color: #4b5563;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 1.5rem 0;
    padding: 0 1rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.start-journey-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.start-journey-btn:hover {
    background-color: #3574e2;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}

gmp-map-3d {
    width: 100%;
    height: 100%;
}

/* Map Controls Container */
.gmp-map-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Control Groups */
.gmp-control-group {
    display: flex;
    gap: 2px;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.gmp-control-group:last-child {
    border-right: none;
}

/* Control Buttons */
.gmp-control-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.gmp-control-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Specific control groups */
.zoom-controls,
.tilt-controls,
.rotate-controls,
.move-controls {
    display: flex;
    gap: 2px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    70% {
        transform: scale(2);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Add hover effect for markers */
.location-marker:hover .pulse-ring {
    background-color: rgba(66, 133, 244, 0.6);
    animation-duration: 1s;
}

.point-info-content h3 {
    color: #4285f4;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    font-size: 18px;
}

.point-info-content p {
    margin: 0;
    line-height: 1.5;
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

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


.story-panel {
    position: absolute;
    left: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.story-panel.visible {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

/* Styles for the new point-info-window class */
.point-info-window {
    position: relative;
}

.close-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-info-btn:hover {
    color: #4285f4;
}

.story-content h2 {
    color: #4285f4;
    margin: 0 0 12px 0;
    padding-right: 30px; /* Make room for close button */
}

.story-content p {
    margin: 0;
    line-height: 1.5;
    color: #333;
}


.globe-message {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-style: italic;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap; /* Prevent text wrapping */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.globe-message.visible {
    opacity: 1;
}



.seven-wonders-nav {
    position: fixed;
    bottom: 40px;
    left: 20px;          
    transform: none;      
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 999;        
    opacity: 0;
    transition: opacity 0.3s ease;
}

.seven-wonders-nav.visible {
    opacity: 1;
}

.wonder-nav-btn {
    background: none;
    border: none;
    color: #4285f4;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.2s ease;
}

.wonder-nav-btn:hover {
    transform: scale(1.1);
}

.wonder-name {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
    min-width: 200px;
    text-align: center;
}


.wonders-navigation {
    position: fixed;
    bottom: 100px;
    left: 20px;           
    transform: none;      
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 999;        /* Set lower than narration z-index */
}