/**
 * Autobahn Visualizer - Frontend Styles
 */

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-red: #FF6B6B;
    --accent-orange: #FFA500;
    --accent-green: #27AE60;
    --text-primary: #ffffff;
    --text-secondary: #B0B0B0;
    --border-color: #2a2a3e;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Container */
.autobahn-visualizer-wrapper {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-primary);
    margin: 20px 0;
    height: 900px;
    display: flex;
    flex-direction: column;
}

/* Header */
.autobahn-header {
    background: linear-gradient(90deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    padding: 20px 25px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.autobahn-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(120deg, #fff 0%, #b0b0b0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Selector */
.autobahn-selector {
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    background-color: rgba(42, 42, 62, 0.8);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    max-width: 300px;
    font-weight: 500;
}

.autobahn-selector:hover {
    border-color: var(--accent-orange);
    background-color: rgba(42, 42, 62, 1);
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.3);
}

.autobahn-selector:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 16px rgba(255, 165, 0, 0.5);
}

.autobahn-selector option {
    background-color: var(--primary-color);
    color: var(--text-primary);
    padding: 10px;
}

/* Map */
.autobahn-map {
    flex: 1;
    position: relative;
    background-color: #1a1a1a;
}

.autobahn-map .leaflet-container {
    font-family: inherit;
    background-color: #2a2a2a;
}

.autobahn-map .leaflet-control-layers {
    background-color: rgba(26, 26, 46, 0.95) !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(10px);
}

.autobahn-map .leaflet-control-layers-list {
    background-color: transparent;
}

.autobahn-map .leaflet-control-layers label {
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-weight: 500;
}

.autobahn-map .leaflet-control-layers input[type="radio"],
.autobahn-map .leaflet-control-layers input[type="checkbox"] {
    accent-color: var(--accent-orange);
}

/* Markers */
.autobahn-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    animation: markerPulse 2s ease-in-out infinite;
}

@keyframes markerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.autobahn-marker-baustelle .marker-icon {
    background-color: var(--accent-red);
}

.autobahn-marker-engstelle .marker-icon {
    background-color: var(--accent-orange);
}

/* Popups */
.autobahn-popup {
    background: var(--primary-color);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
}

.autobahn-popup h4 {
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 6px;
}

.autobahn-popup p {
    margin: 6px 0;
    font-size: 12px;
}

.autobahn-popup .description {
    font-weight: 500;
    color: #FFD700;
}

.autobahn-popup .location {
    color: var(--text-secondary);
}

.leaflet-popup-content-wrapper {
    background-color: var(--primary-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
}

.leaflet-popup-tip {
    background-color: var(--primary-color) !important;
}

/* Info Panel */
.autobahn-info-panel {
    width: 100%;
    max-height: 280px;
    background: linear-gradient(180deg, rgba(34, 34, 54, 0.98) 0%, rgba(26, 26, 46, 0.98) 100%);
    border-top: 2px solid var(--border-color);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.autobahn-info-content {
    padding: 20px 25px;
    flex: 1;
}

.autobahn-info-content h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.info-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--accent-orange);
    font-weight: 700;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(255, 165, 0, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--accent-orange);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-orange);
}

.section-title {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 15px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-weight: 700;
}

.event-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.event-item {
    padding: 12px;
    background-color: rgba(42, 42, 62, 0.8);
    border-radius: 6px;
    border-left: 3px solid var(--accent-orange);
    transition: var(--transition);
}

.event-item.baustelle {
    border-left-color: var(--accent-red);
}

.event-item.engstelle {
    border-left-color: var(--accent-orange);
}

.event-item:hover {
    background-color: rgba(42, 42, 62, 1);
    transform: translateX(4px);
}

.event-item strong {
    display: block;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-item p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Error */
.error-message {
    padding: 15px;
    background-color: rgba(255, 107, 107, 0.1);
    border-left: 3px solid var(--accent-red);
    color: #FFB3B3;
    border-radius: 4px;
    font-size: 13px;
}

/* Info Empty */
.info-empty {
    padding: 15px;
    background-color: rgba(255, 165, 0, 0.1);
    border-left: 3px solid var(--accent-orange);
    color: #FFCC99;
    border-radius: 4px;
    font-size: 13px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 165, 0, 0.3);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
.autobahn-info-panel::-webkit-scrollbar {
    width: 8px;
}

.autobahn-info-panel::-webkit-scrollbar-track {
    background: rgba(42, 42, 62, 0.5);
}

.autobahn-info-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 165, 0, 0.5);
    border-radius: 4px;
}

.autobahn-info-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent-orange);
}

/* Leaflet Control Styles */
.leaflet-control {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    background-color: rgba(26, 26, 46, 0.9) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background-color: rgba(255, 165, 0, 0.2) !important;
    border-color: var(--accent-orange) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .autobahn-visualizer-wrapper {
        height: 600px;
    }

    .autobahn-header {
        flex-direction: column;
        gap: 12px;
    }

    .autobahn-selector {
        max-width: 100%;
    }

    .autobahn-header h2 {
        font-size: 18px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .event-list {
        grid-template-columns: 1fr;
    }

    .autobahn-info-panel {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .autobahn-header {
        padding: 15px;
    }

    .autobahn-header h2 {
        font-size: 16px;
    }

    .autobahn-info-content {
        padding: 15px;
    }

    .event-item strong {
        font-size: 11px;
    }

    .event-item p {
        font-size: 11px;
    }
}
