body { margin: 0; font-family: Arial, sans-serif; }
#sidebar {
    width: 350px;
    height: 100vh;
    float: left;
    background: #34495e;
    border-right: 1px solid #2c3e50;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    color: #ecf0f1;
}
#map { height: 100vh; margin-left: 350px; }
h2 {
    color: #3498db;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

/* Elevation stats styling */
.elevation-stats {
    margin-top: 15px;
    border-radius: 5px;
}

.elevation-stats h4 {
    color: #3498db;
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.elevation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #ecf0f1;
}

.elevation-table th, .elevation-table td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid rgba(236, 240, 241, 0.3);
}

.elevation-table th {
    background-color: rgba(41, 128, 185, 0.4);
    font-weight: 600;
}

.elevation-table tr:hover {
    background-color: rgba(41, 128, 185, 0.2);
}
.option-group { 
    margin-bottom: 20px; 
    padding: 15px;
    background: #2c3e50;
    border-radius: 6px;
    border: 1px solid #34495e;
}
.btn { background: #0078d7; color: #fff; border: none; padding: 8px 16px; cursor: pointer; border-radius: 4px; }
.location-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.location-buttons .btn {
    width: 100%;
    margin: 0;
}
.location-item {
    display: flex;
    align-items: flex-start;
    margin: 4px 0;
    font-size: 13px;
    line-height: 1.4;
}
.location-icon {
    margin-right: 8px;
    font-size: 14px;
    flex-shrink: 0;
}
.watershed-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
}
.watershed-summary-text {
    font-size: 12px;
    color: #b8c5d6;
    line-height: 1.5;
    word-wrap: break-word;
    margin-top: 5px;
}
.download-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.download-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn-yellow { background: #ffd700; color: #333; }
.info { margin-top: 10px; }
#result { 
    margin-left: 360px; 
    margin-top: 10px;
    min-height: 0; /* Don't take up space when empty */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: #34495e;
    margin: 20% auto;
    border-radius: 6px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.modal-header {
    background-color: #34495e;
    color: #3498db;
    padding: 16px 20px 8px;
    font-size: 13px;
    font-weight: 600;
}

.site-name {
    color: #3498db;
}

.modal-body {
    padding: 12px 20px 16px;
    color: #ecf0f1;
    background-color: #34495e;
    font-size: 13px;
    line-height: 1.4;
}

.modal-body p {
    margin: 0 0 8px 0;
}

.example {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    color: #3498db;
    margin: 8px 0 12px 0 !important;
    font-weight: 500;
    font-size: 13px;
}

#coord-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #5d6d7e;
    border-radius: 3px;
    background-color: #2c3e50;
    color: #ecf0f1;
    font-size: 13px;
    box-sizing: border-box;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

#coord-input:focus {
    outline: none;
    border-color: #3498db;
    background-color: #34495e;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.modal-footer {
    padding: 12px 16px 16px;
    text-align: right;
    background-color: #34495e;
}

.modal-btn {
    padding: 6px 16px;
    margin-left: 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    min-width: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.modal-btn-ok {
    background-color: #4a69bd;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.modal-btn-ok:hover {
    background-color: #3c5aa6;
}

.modal-btn-ok:active {
    background-color: #2f4788;
    transform: translateY(1px);
}

.modal-btn-cancel {
    background-color: #7f8c8d;
    color: #ffffff;
}

.modal-btn-cancel:hover {
    background-color: #6c7a7b;
}

.modal-btn-cancel:active {
    background-color: #5a6769;
    transform: translateY(1px);
}

/* Custom Leaflet Popup Styles */
.custom-popup {
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-popup h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.delineate-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    min-width: 80px;
}

.delineate-btn:hover {
    background-color: #2980b9;
}

.cancel-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    min-width: 60px;
}

.cancel-btn:hover {
    background-color: #c0392b;
}

.processing-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #2c3e50;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ecf0f1;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}