body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.sidebar {
    width: 100%;
    height: 70px;
    background: white;
    padding: 0 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
}

.sidebar img {
    margin: 0;
    height: 40px;
    width: auto;
}

.sidebar h2 {
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid #ddd;
    color: #333;
}

.main-content {
    flex: 1;
    padding: 20px;
    margin-top: 0;
}

#map {
    height: 55vh;
    width: 100%;
    margin: 0 auto 20px auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.controls {
    margin: 20px 0;
    width: 100%;
    text-align: center;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background-color: #45a049;
}


#tile-count {
    margin: 0;
    padding: 10px 0;
    font-size: 14px;
    color: #333;
    text-align: center;
    min-height: 20px;
}

.altitude-range-container.hidden {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.altitude-range-container.hidden h4 {
    color: #999;
}

.altitude-range-container.hidden .range-slider {
    background: #f0f0f0;
}

.altitude-range-container.hidden .range-track {
    background: #ccc;
}

.altitude-range-container.hidden .range-thumb {
    background: #ccc;
    border-color: #999;
}

.altitude-range-container.hidden::after {
    content: "Select an area on the map to adjust altitude range";
    display: block;
    text-align: center;
    color: #999;
    font-style: italic;
    margin-top: 10px;
    font-size: 12px;
}

/* Range slider styles */
.altitude-range-container {
    margin: 20px auto;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.range-slider-container {
    position: relative;
    margin: 20px 0;
}

.range-slider {
    position: relative;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin: 15px 0;
}

.range-track {
    position: absolute;
    height: 6px;
    background: #ff7800;
    border-radius: 3px;
}

.range-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #ff7800;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    top: -7px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transform: translateX(-50%);
}

.range-thumb:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.range-thumb.active {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 4px 8px rgba(255,120,0,0.4);
}

.range-scale {
    position: relative;
    margin-top: 10px;
    height: 20px;
}

.scale-label {
    position: absolute;
    font-size: 12px;
    color: #666;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: -1; 
}

.scale-label::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 8px;
    background-color: #ccc;
}

.altitude-display {
    font-weight: 500;
    color: #333;
    margin: 10px 0;
}


#progress-container {
    display: none;
    margin: 20px auto;
    width: 80%;
    max-width: 1200px;
    text-align: center;
    /* Force vertical stacking when visible */
    flex-direction: column;
    align-items: center;
}


.progress {
    width: 100%;
    height: 20px;
    background-color: #dbdbdb;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #4CAF50;
    transition: width 0.3s ease;
}

/* Progress bar tick marks at 33% and 66% */
.progress::before,
.progress::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #b3b3b3;
    z-index: 1;
}

.progress::before {
    left: 33.33%;
}

.progress::after {
    left: 66.66%;
}


/* Add new spinner styles */
.spinner {
    display: none;
    width: 40px;
    height: 40px;
    margin: 0 auto 15px auto; /* Add bottom margin to separate from progress bar */
    border: 4px solid #f0f0f0;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#download-container {
    display: none;
    margin: 20px auto;
    width: 80%;
    max-width: 1200px;
    text-align: center;
}

.controls button {
    margin: 0 5px;
}

.controls button:not(.process-button) {
    background-color: #2196F3;
}

.controls button:not(.process-button):hover {
    background-color: #1976D2;
}

.process-button {
    background-color: #0D47A1;
    font-weight: 500;
    padding: 12px 24px;
}

.process-button.hidden {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.process-button:hover {
    background-color: #0A3880;
}

@keyframes indeterminate {
    0% { left: -100%; width: 100%; }
    50% { left: 100%; width: 10%; }
    100% { left: 100%; width: 10%; }
}

.progress-bar.indeterminate {
    position: relative;
    width: 100% !important;
}

.progress-bar.indeterminate::after {
    content: '';
    position: absolute;
    background-color: inherit;
    top: 0;
    left: 0;
    bottom: 0;
    will-change: left, right;
    animation: indeterminate 2s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}

#progress-text {
    margin: 10px 0;
    text-align: center;
}

.error-container {
    display: none;
    margin: 20px auto;
    width: 80%;
    max-width: 1200px;
    text-align: center;
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 15px;
    color: #c62828;
}

.error-container h3 {
    margin: 0 0 10px 0;
    color: #d32f2f;
}

.error-container p {
    margin: 5px 0;
    font-size: 14px;
}

.retry-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.retry-button:hover {
    background-color: #d32f2f;
}

.success-icon {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    margin: 5px auto;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.fail-icon {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f44336;
    color: white;
    font-weight: bold;
    font-size: 20px;
    line-height: 40px;
    text-align: center;
    margin: 5px auto;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.progress-text-error {
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 10px;
    color: #c62828;
    margin: 10px 0;
}

/* Version information styles */
.version-info {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
}

.version-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-label {
    font-weight: 500;
    min-width: 60px;
}

.version-hash {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #333;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.version-hash:hover {
    overflow: visible;
    white-space: normal;
    max-width: none;
    background-color: #e0e0e0;
    z-index: 1000;
    position: relative;
}