* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f5f5;
}

header {
    background-color: #e63946;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.logo-icon {
    margin-right: 8px;
    font-size: 1.7rem;
}

.menu-toggle {
    display: block;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #e63946;
    flex-direction: column;
    padding: 0.5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-links.active {
    display: flex;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.8rem;
}

.filter-container {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.filter-title {
    font-size: 1.1rem;
    color: #1d3557;
    font-weight: 500;
}

.toggle-filters-btn {
    background: none;
    border: none;
    color: #1d3557;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toggle-filters-btn:hover {
    background-color: #f0f0f0;
    border-radius: 4px;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
    max-height: 300px; /* Adjust based on your content */
    opacity: 1;
}

.filter-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-group {
    display: flex;
    align-items: center;
    flex: 1 1 200px;
}

.filter-label {
    margin-right: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-btn {
    background-color: #1d3557;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-left: auto;
}

.search-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
    align-items: center;
}

.search-box {
    display: flex;
    flex: 1;
    min-width: 200px;
}

#search-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

#search-button {
    background-color: #1d3557;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-weight: 500;
}

.locate-btn {
    display: flex;
    align-items: center;
    background-color: #457b9d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.locate-btn:hover {
    background-color: #1d3557;
}

.locate-icon {
    margin-right: 0.5rem;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 0.5rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    display: none;
}

.content-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.map-container {
    height: 30vh; /* Smaller initial height */
    background-color: white;
    border-radius: 8px 8px 0 0; /* Rounded only at top */
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

#map {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.resizer {
    height: 10px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    cursor: ns-resize;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
}

.resizer::before {
    content: '';
    width: 40px;
    height: 4px;
    background-color: #ccc;
    border-radius: 2px;
}

.info-panel {
    flex-grow: 1;
    background-color: white;
    border-radius: 0 0 8px 8px; /* Rounded only at bottom */
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.info-panel h2 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: #1d3557;
}

.incident-list {
    overflow-y: auto;
    flex-grow: 1;
    max-height: 60vh; /* Larger initial height */
}

.incident-item {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.incident-item:hover {
    background-color: #f9f9f9;
}

.incident-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.incident-type {
    font-weight: 500;
    margin-right: 0.5rem;
}

.incident-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.info-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 16px;
    background-color: #f1f1f1;
    color: #333;
}

.date-chip {
    background-color: #E3F2FD;
    color: #1565C0;
}

.city-chip {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.incident-desc {
    font-size: 0.9rem;
    line-height: 1.4;
}

footer {
    background-color: #1d3557;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
    gap: 0.8rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
}

/* Popup-Stil */
.incident-popup {
    max-width: 250px;
}

.incident-popup-header {
    font-weight: bold;
    margin-bottom: 5px;
    color: #1d3557;
}

.incident-popup-time {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.incident-popup-source {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.incident-popup-desc {
    margin-top: 5px;
    font-size: 0.9rem;
}

/* Legende */
.legend {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 50%;
}

/* Loader */
.loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.loader-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    animation: spin 2s linear infinite;
    margin: 0 auto 8px;
}

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

/* Marker-Stile */
.marker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

.leaflet-div-icon {
    background: transparent;
    border: none;
}

/* Typ-spezifische Stile */
.type-einbruch {
    color: #e63946; /* Rot */
}
.type-brand {
    color: #f4a261; /* Orange */
}
.type-unfall {
    color: #2a9d8f; /* Grün */
}
.type-anschlag {
    color: #9d4edd; /* Lila */
}
.type-gewaltdelikt {
    color: #d90429; /* Dunkelrot */
}

/* Pulsing animation for locating */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

.pulsing {
    animation: pulse 1.5s infinite;
}

/* Resizing cursor styles */
body.resizing {
    cursor: ns-resize;
    user-select: none;
}

body.resizing .map-container,
body.resizing .info-panel {
    transition: none;
}

body.resizing .resizer {
    background-color: #e0e0e0;
}

body.resizing .resizer::before {
    background-color: #999;
}

/* Cookie Consent Banner */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none; /* Initially hidden, controlled by JS */
    padding: 0.8rem;
    border-top: 2px solid #e63946;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    flex: 1;
    min-width: 200px;
}

.cookie-content a {
    color: #1d3557;
    text-decoration: underline;
}

.cookie-btn {
    background-color: #e63946;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cookie-btn:hover {
    background-color: #c42836;
}

/* Media queries for better responsive design */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }
    
    .nav-links {
        display: flex;
        position: static;
        flex-direction: row;
        box-shadow: none;
        padding: 0;
    }
    
    .nav-links a {
        padding: 0.5rem 1rem;
        border-bottom: none;
    }
    
    .content-container {
        flex-direction: row;
        height: 75vh; /* Taller container on desktop */
    }
    
    .map-container {
        width: 40%;
        height: 100% !important; /* Override inline style when in desktop */
        border-radius: 8px 0 0 8px; /* Rounded on left side */
    }
    
    .resizer {
        width: 10px;
        height: auto;
        cursor: ew-resize;
    }
    
    .resizer::before {
        width: 4px;
        height: 40px;
    }
    
    .info-panel {
        width: 60%;
        border-radius: 0 8px 8px 0; /* Rounded on right side */
    }
}