/* GIP Projects Map Styling */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

#header {
    background: #ff4000;
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#header h1 {
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 300;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.app-hidden {
    display: none;
}

#controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
}

#controls h1 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

#year-legend {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

#year-legend h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #fff;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.legend-2025 {
    background-color: #ff4000;
}

.legend-2026 {
    background-color: #3f334d;
}

.legend-2027 {
    background-color: #c1809d;
}

.legend-no-budget {
    background-color: #bababa;
}

/* Map container - single definition */
#map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#budget-info {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 250px;
}

#budget-info h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
}

#budget-details p {
    margin: 5px 0;
    font-size: 14px;
}

.budget-breakdown {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.budget-breakdown h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #555;
}

.popup-content h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.popup-content p {
    margin: 5px 0;
    font-size: 14px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
}

.filter-group select {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
}

.filter-group button {
    padding: 6px 16px;
    border: 2px solid white;
    border-radius: 4px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-group button:hover {
    background: white;
    color: #2c3e50;
}

#stats {
    font-size: 14px;
    opacity: 0.9;
}

/* Map container */
.map-container {
    display: flex;
    flex: 1;
    height: calc(100vh - 120px);
}

#sidebar {
    width: 350px;
    background: white;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
    z-index: 1000;
}

#sidebar h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

#project-details {
    font-size: 14px;
    line-height: 1.6;
}

.project-info {
    margin-bottom: 20px;
}

.project-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.project-meta {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.project-meta-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

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

.meta-label {
    font-weight: 600;
    color: #666;
}

.meta-value {
    color: #333;
    text-align: right;
    max-width: 200px;
    overflow-wrap: break-word;
}

.budget-info {
    background: #e8f5e8;
    border-left: 4px solid #27ae60;
    padding: 12px;
    border-radius: 0 6px 6px 0;
}

.budget-total {
    font-size: 16px;
    font-weight: bold;
    color: #27ae60;
}

/* Custom marker styles */
.marker-wegen { background-color: #e74c3c; }
.marker-fietsinfrastructuur { background-color: #2ecc71; }
.marker-bruggen { background-color: #f39c12; }
.marker-waterinfrastructuur { background-color: #3498db; }
.marker-tunnels { background-color: #9b59b6; }
.marker-overig { background-color: #95a5a6; }

/* Legend styles */
#legend {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: white;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    flex-shrink: 0;
}

.legend-label {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid white;
}

.legend-color.year-2025 { background-color: #FF6B6B; }
.legend-color.year-2026 { background-color: #4ECDC4; }
.legend-color.year-2027 { background-color: #45B7D1; }
.legend-color.no-budget { background-color: #95A5A6; }

/* Budget section in popup */
.budget-section {
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 13px;
}

.start-year {
    font-weight: bold;
    margin-top: 8px;
    font-size: 14px;
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.popup-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
}

.popup-budget {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    margin-top: 8px;
}

/* Responsive design */
@media (max-width: 768px) {
    #controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    .map-container {
        flex-direction: column;
    }
    
    #sidebar {
        width: 100%;
        height: 300px;
        order: -1;
    }
    
    #map {
        height: calc(100vh - 420px);
    }
}

/* Loading indicator */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
    font-size: 16px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Route lines styling */
.route-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.3s ease;
}

.route-line:hover {
    opacity: 1 !important;
    stroke-width: 8 !important;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.3));
}