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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #3498db;
    color: white;
    text-decoration: none;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-icon {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-icon:hover {
    background: #f8f9fa;
}

/* Main Container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: #f8f9fa;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    transition: margin-left 0.3s;
}

.sidebar.collapsed {
    margin-left: -300px;
}

.sidebar-section {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.75rem;
}

.select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Layer List */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.layer-item:hover {
    background: #e9ecef;
}

.layer-item input[type="checkbox"] {
    cursor: pointer;
}

.layer-item span {
    font-size: 0.875rem;
}

.info-text {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

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

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

/* Map Controls */
.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
}

/* Coordinates Display */
.coordinates {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* MapLibre Popup Customization */
.maplibregl-popup-content {
    padding: 1rem;
    min-width: 200px;
}

.maplibregl-popup-content h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.maplibregl-popup-content table {
    width: 100%;
    font-size: 0.875rem;
}

.maplibregl-popup-content td {
    padding: 0.25rem 0;
}

.maplibregl-popup-content td:first-child {
    font-weight: 600;
    padding-right: 1rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 100;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        margin-left: -300px;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    .header h1 {
        font-size: 1rem;
    }
}
