/* --- ESSENTIAL STYLES FOR MAP CONTAINER --- */
/* These ensure the map takes up the full viewport */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
#map {
    height: 100%; /* Map will fill the height of its parent (body) */
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0; /* Behind controls */
}
/* --- END ESSENTIAL STYLES --- */


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden; /* Prevent scrollbars */
    /* Ensure body takes full viewport height and width for map to fill */

    /* --- BACKGROUND IMAGE STYLES - NOW USING HTTPS --- */
    background-image: url('https://googleusercontent.com/image_generation_content/2'); /* The generated image URL */
    background-size: cover; /* Ensures the image covers the entire background */
    background-position: center; /* Centers the image */
    background-repeat: no-repeat; /* Prevents the image from repeating */
    background-attachment: fixed; /* Keeps the background image fixed when content scrolls */
    /* Add a subtle overlay to make content more readable on top of the image */
    background-color: rgba(0, 0, 0, 0.3); /* Dark overlay */
    background-blend-mode: overlay; /* Blends the overlay with the image */
}


/* Control Panel */
.controls-panel {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    /* Background adjusted for better contrast against new body background */
    background-color: rgba(255, 255, 255, 0.5); /* More opaque white */
    padding: 25px 35px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1; /* Ensure controls are above the map */
    min-width: 320px;
    border: 1px solid rgba(220, 220, 220, 0.7);
    backdrop-filter: blur(5px); /* Keep frosted glass effect */
}

/* Control Group styling */
.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Buttons */
.controls-panel button {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#playPauseBtn {
    background-color: #007bff;
    color: white;
}

#playPauseBtn:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

#resetBtn {
    background-color: #dc3545;
    color: white;
}

#resetBtn:hover {
    background-color: #a71d2a;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Speed Slider */
.controls-panel label {
    font-size: 15px;
    color: #555;
    white-space: nowrap;
}

#speedSlider {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #d3d3d3;
    outline: none;
    border-radius: 5px;
    opacity: 0.8;
    transition: opacity .2s;
}

#speedSlider:hover {
    opacity: 1;
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#speedSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#speedValue {
    font-size: 15px;
    font-weight: bold;
    color: #007bff;
    min-width: 40px;
    text-align: right;
}

/* Metadata Display */
.metadata {
    background-color: #e9ecef;
    padding: 15px 20px;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.metadata p {
    margin: 0;
    font-size: 14px;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metadata span {
    font-weight: bold;
    color: #222;
    min-width: 100px;
    text-align: right;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Slightly darker overlay */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    color: white;
    z-index: 100;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s ease;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Basic Spinner */
.loading-overlay::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-panel {
        bottom: 15px;
        padding: 15px 20px;
        width: 90%;
        gap: 15px;
    }
    .controls-panel button {
        font-size: 14px;
        padding: 10px 18px;
    }
    .control-group {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .control-group button {
        width: 100%;
    }
    .metadata p {
        font-size: 13px;
    }
    .loading-overlay {
        font-size: 1.2em;
    }
}

