* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #008080;
}

.container {
    display: flex;
    height: 100vh;
    border: 2px solid #000;
}

/* Sidebar Styles */
.sidebar {
    width: 350px;
    background: #c0c0c0;
    color: #000;
    padding: 10px;
    overflow-y: auto;
    border-right: 2px solid #000;
}

.sidebar h1 {
    font-size: 20px;
    margin-bottom: 5px;
    color: #000;
    font-weight: bold;
}

.subtitle {
    font-size: 12px;
    color: #000;
    margin-bottom: 10px;
}

.instructions {
    background: #c0c0c0;
    padding: 10px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    margin-bottom: 10px;
}

.instructions h3 {
    margin-bottom: 5px;
    font-size: 12px;
    color: #000;
    font-weight: bold;
}

.instructions ol {
    margin-left: 20px;
    font-size: 11px;
    line-height: 1.4;
}

.instructions li {
    margin-bottom: 3px;
}

/* Stats */
.stats {
    background: #c0c0c0;
    padding: 10px;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 11px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #000;
}

.stat-value {
    font-weight: bold;
    color: #000080;
    font-size: 14px;
}

/* Actions */
.actions {
    margin-bottom: 10px;
}

.btn {
    width: 100%;
    padding: 5px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 5px;
    background: #c0c0c0;
    color: #000;
}

.btn:disabled {
    color: #808080;
    cursor: default;
}

.btn:active:not(:disabled) {
    border-color: #000 #fff #fff #000;
}

.btn-primary {
    background: #c0c0c0;
    color: #000;
}

.btn-secondary {
    background: #c0c0c0;
    color: #000;
}

.btn-danger {
    background: #c0c0c0;
    color: #000;
}

.btn-export {
    background: #c0c0c0;
    color: #000;
}

.btn-check {
    background: #c0c0c0;
    color: #000;
}

/* Cities List */
.cities-list {
    margin-bottom: 10px;
}

.cities-list h3 {
    margin-bottom: 5px;
    font-size: 12px;
    color: #000;
    font-weight: bold;
}

.cities-container {
    max-height: 300px;
    overflow-y: auto;
}

.empty-message {
    color: #000;
    font-size: 11px;
    text-align: center;
    padding: 10px;
}

.city-item {
    background: #c0c0c0;
    padding: 8px;
    margin-bottom: 5px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
}

.city-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.city-name {
    font-weight: bold;
    font-size: 12px;
    color: #000;
    flex: 1;
}

.city-actions {
    display: flex;
    gap: 3px;
}

.city-rename,
.city-delete {
    background: #c0c0c0;
    color: #000;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.city-rename:active,
.city-delete:active {
    border-color: #000 #fff #fff #000;
}

.city-info {
    font-size: 11px;
    color: #000;
    margin-bottom: 5px;
}

.city-central {
    font-size: 11px;
    color: #000;
    margin-bottom: 5px;
}

.city-central strong {
    color: #000;
    display: block;
    margin-bottom: 3px;
}

.central-select {
    width: 100%;
    padding: 3px;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    background: #fff;
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
    font-size: 11px;
}

.central-select:focus {
    outline: none;
}

.city-districts {
    font-size: 10px;
    color: #000;
    line-height: 1.4;
}

.city-districts strong {
    color: #000;
}

/* Export Section */
.export-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #808080;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zoom-btn {
    width: 30px;
    height: 30px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    color: #000;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.zoom-btn:hover:not(:disabled) {
    background: #d4d4d4;
}

.zoom-btn:active {
    border-color: #000 #fff #fff #000;
}

.zoom-btn:disabled {
    color: #808080;
    cursor: default;
}

.maplibregl-popup-content {
    background: #ffffe0;
    border: 1px solid #000;
    border-radius: 0;
    padding: 3px 6px;
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
    font-size: 11px;
    box-shadow: none;
}

.maplibregl-popup-tip {
    display: none;
}

/* City Info Popup */
.city-info-popup .maplibregl-popup-content {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    border-radius: 0;
    padding: 8px;
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.city-info-popup .maplibregl-popup-close-button {
    color: #000;
    font-size: 16px;
    font-weight: bold;
    padding: 2px 6px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #000000 #000000 #ffffff;
    right: 4px;
    top: 4px;
}

.city-info-popup .maplibregl-popup-close-button:hover {
    background: #d4d4d4;
}

.city-popup-title {
    font-weight: bold;
    font-size: 12px;
    color: #000;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #808080;
}

.city-popup-info {
    font-size: 10px;
    color: #000;
    margin-bottom: 4px;
    font-style: italic;
}

.city-popup-districts {
    font-size: 9px;
    color: #000;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
}

.city-label-marker {
    pointer-events: auto;
}

.city-label-box {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    padding: 2px 4px;
    box-shadow: 1px 1px 0 #000000;
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
    user-select: none;
    display: inline-block;
    cursor: pointer;
}

.city-label-box:hover {
    background: #d4d4d4;
}

.city-label-text {
    font-size: 9px;
    font-weight: bold;
    color: #000000;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #c0c0c0;
    padding: 8px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 11px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 5px;
    border: 1px solid #000;
}

/* Custom Alert */
.custom-alert {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.custom-alert.active {
    display: flex;
}

.alert-content {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    padding: 15px;
    min-width: 300px;
    max-width: 500px;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
}

.alert-icon {
    font-size: 32px;
    text-align: center;
    margin-bottom: 10px;
}

.alert-message {
    color: #000;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: center;
    line-height: 1.4;
}

.alert-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.confirm-buttons button {
    width: 70px;
}

.alert-close {
    width: 80px;
    padding: 5px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    background: #c0c0c0;
    color: #000;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
}

.alert-close:active {
    border-color: #000 #fff #fff #000;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #c0c0c0;
    padding: 10px;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    max-width: 300px;
    width: 90%;
}

.modal-content h2 {
    color: #000;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

.modal-content p {
    color: #000;
    margin-bottom: 10px;
    font-size: 11px;
}

#cityNameInput,
#renameInput {
    width: 100%;
    padding: 5px;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    font-size: 12px;
    margin-bottom: 10px;
    font-family: 'Oxanium', 'Funnel Sans', Arial, sans-serif;
}

#cityNameInput:focus,
#renameInput:focus {
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 5px;
}

.modal-actions .btn {
    flex: 1;
    margin-bottom: 0;
}

/* Preview Modal */
.preview-modal-content {
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
}

.preview-info {
    font-size: 11px;
    color: #000;
    margin-bottom: 10px;
    font-style: italic;
}

.preview-image-container {
    margin: 10px 0;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    padding: 5px;
    background: #fff;
    text-align: center;
    max-height: 60vh;
    overflow: auto;
}

.preview-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid #808080;
}

.preview-details {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    padding: 8px;
    margin: 10px 0;
    font-size: 11px;
}

.detail-item {
    margin-bottom: 5px;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-item strong {
    color: #000;
    margin-right: 5px;
}

/* Accuracy Modal */
.accuracy-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.accuracy-info {
    font-size: 11px;
    color: #000;
    margin-bottom: 10px;
    font-style: italic;
}

.accuracy-summary {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.accuracy-summary h3 {
    color: #000080;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.accuracy-summary p {
    font-size: 11px;
    color: #000;
    margin-bottom: 5px;
}

.accuracy-summary p:last-child {
    margin-bottom: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #fff;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    margin-top: 10px;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    transition: width 0.3s ease;
    min-width: 2px;
}

.perfect-badge {
    display: inline-block;
    background: #27ae60;
    color: #fff;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    border-radius: 3px;
    margin-left: 5px;
}

.accuracy-details {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #000 #fff #fff #000;
    padding: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.accuracy-details h4 {
    color: #000;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: bold;
}

.accuracy-city-item {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
    padding: 10px;
    margin-bottom: 8px;
}

.accuracy-city-item:last-child {
    margin-bottom: 0;
}

.accuracy-city-name {
    font-weight: bold;
    font-size: 13px;
    color: #000;
    margin-bottom: 5px;
}

.accuracy-city-stats {
    font-size: 11px;
    margin-bottom: 5px;
}

.accuracy-metric {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.metric-label {
    font-weight: bold;
    color: #000;
}

.accuracy-percentage {
    font-weight: bold;
    font-size: 14px;
}

.metric-detail {
    font-size: 10px;
    color: #000;
    font-style: italic;
}

.accuracy-match {
    font-size: 11px;
    color: #000;
    margin-bottom: 5px;
}

.accuracy-match strong {
    color: #000080;
}

.accuracy-warning {
    background: #ffebcd;
    border: 1px solid #ff8c00;
    padding: 5px;
    margin-top: 5px;
    font-size: 10px;
    color: #000;
}

.accuracy-info {
    background: #e6f3ff;
    border: 1px solid #4a90e2;
    padding: 5px;
    margin-top: 5px;
    font-size: 10px;
    color: #000;
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar,
.cities-container::-webkit-scrollbar {
    width: 16px;
}

.sidebar::-webkit-scrollbar-track,
.cities-container::-webkit-scrollbar-track {
    background: #c0c0c0;
}

.sidebar::-webkit-scrollbar-thumb,
.cities-container::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #000 #000 #fff;
}



/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
    }
    
    .map-container {
        height: 60vh;
    }
}

