body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #e3f1fb 0%, #fafdff 100%);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #222;
}

html, body { 
    height: 100%; 
    width: 100%;
    margin: 0;
    padding: 0;
}

@media (min-width: 901px) {
    html, body {
        overflow: hidden;
        height: 100vh;
    }
    main.flex-shrink-0 {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 58px); /* Height of footer */
        overflow: hidden;
    }
    .map-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-bottom: 0.5rem;
    }
    .map-row {
        flex: 1;
        display: flex;
        min-height: 0;
    }
}

#loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 24px;
    text-align: center;
    padding-top: 50vh;
}

.marker-cluster, .marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    border: 2px solid #fff;
    color: #222;
    font-weight: bold;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center;
    min-width: 40px;
    min-height: 40px;
    height: 40px;
    width: 40px;
}
.marker-cluster span {
    width: 100%;
    text-align: center;
    display: block;
    line-height: 40px;
    font-size: 1em;
}
.marker-cluster:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 1000;
}
.marker-cluster-small {
    background: linear-gradient(135deg, #ffb3b3 0%, #e62424 100%);
}
.marker-cluster-medium {
    background: linear-gradient(135deg, #fff3b0 0%, #f0c20c 100%);
}
.marker-cluster-large {
    background: linear-gradient(135deg, #ffd6b0 0%, #f18017 100%);
}
.marker-cluster div {
    background: none !important;
}

#map { 
    width: 100%; 
    height: 90vh; 
    min-height: 400px; 
}
#chart-sidebar {
    width: 28vw;
    min-width: 300px;
    max-width: 500px;
    height: 90vh;
    overflow-y: auto;
    background: #fafdff;
    border: 1.5px solid #e0e4ea;
    border-radius: 1.1rem;
    box-shadow: 0 2px 12px rgba(52,152,219,0.07), 0 1.5px 4px rgba(0,0,0,0.04);
    padding: 1.2em 1.3em 1.1em 1.3em;
    position: relative;
    margin: 0.2em 0.1em;
    transition: box-shadow 0.18s, border-color 0.18s;
}
#chart-sidebar:focus-within, #chart-sidebar:hover {
    box-shadow: 0 4px 20px rgba(52,152,219,0.13), 0 2px 8px rgba(0,0,0,0.07);
    border-color: #b3d6f7;
}
.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2em auto;
    display: block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Anpassung für Bootstrap-Grid */
@media (max-width: 900px) {
    #map, #chart-sidebar { width: 100vw; float: none; display: block; height: 50vh; }
}

#map-col, #sidebar-col {
    height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    padding: 0;
    margin-top: 0 !important;
    margin-left: 0.5em;
}
#map, #chart-sidebar {
    height: 100% !important;
}

@media (max-width: 900px) {
    #map-col, #sidebar-col {
        height: 50vh !important;
        min-height: 200px;
    }
    #map, #chart-sidebar {
        height: 100% !important;
    }
}

.nav {
    border-radius: 0.8rem 0.8rem 0 0;
    background: #fafdff;
    box-shadow: 0 1px 6px rgba(52,152,219,0.06);
    padding: 0.3em 0.7em 0 0.7em;
    margin-bottom: 0;
    border: 1.5px solid #e0e4ea;
    border-bottom: none;
    font-weight: 500;
}


.nav .nav-link {
    border-radius: 0.6rem 0.6rem 0 0;
    color: #217dbb;
    background: transparent;
    margin-right: 0.2em;
    transition: background 0.15s, color 0.15s;
}
.nav .nav-link.active {
    background: linear-gradient(135deg, #3498db 0%, #e3f1fb 100%);
    color: #fff;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(52,152,219,0.12);
}
.tab-content {
    background: #fafdff;
    border: 1.5px solid #e0e4ea;
    border-radius: 0 0 1.1rem 1.1rem;
    box-shadow: 0 2px 12px rgba(52,152,219,0.04);
    padding: 1.1em 1.2em 1em 1.2em;
    margin-top: 0;
    margin-bottom: 0;
    min-height: 180px;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.tab-content:focus-within, .tab-content:hover {
    box-shadow: 0 4px 20px rgba(52,152,219,0.09), 0 2px 8px rgba(0,0,0,0.04);
    border-color: #b3d6f7;
}
.nav.nav-tabs.mb-3 {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}
.sidebar-toggle-btn {
    background: linear-gradient(135deg, #1766a0 0%, #3498db 100%);
    color: #fff;
    position: fixed;
    right: 30px;
    top: 110px;
    z-index: 3000;
    box-shadow: 0 4px 16px rgba(52,152,219,0.18);
    font-size: 1.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #3498db 0%, #1766a0 100%);
    transform: scale(1.08);
}
.sidebar-toggle-btn[title]:after {
    content: attr(title);
    position: absolute;
    right: 110%;
    top: 50%;
    transform: translateY(-50%);
    background: #1766a0;
    color: #fff;
    padding: 0.3em 0.7em;
    border-radius: 0.5em;
    font-size: 0.9em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.sidebar-toggle-btn:hover[title]:after {
    opacity: 1;
}
.chartjs-render-monitor {
    border-radius: 0.7em;
    box-shadow: 0 2px 8px rgba(52,152,219,0.08);
}

#sidebar-col {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 8px 36px rgba(52,152,219,0.16), 0 2px 8px rgba(0,0,0,0.07);
    border: 2px solid #e0e4ea;
    padding: 1.5em 1.5em 1.2em 1.5em;
    margin: 0.7em 0.2em 0.7em 0.2em;
    min-width: 320px;
    max-width: 520px;
    transition: box-shadow 0.18s, border-color 0.18s, background 0.18s;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
}
#sidebar-col:focus-within, #sidebar-col:hover {
    box-shadow: 0 12px 48px rgba(52,152,219,0.22), 0 4px 16px rgba(0,0,0,0.10);
    border-color: #3498db;
    background: #fafdff;
}
#sidebar-toolbar {
    background: #fafdff;
    border-radius: 0.8rem;
    box-shadow: 0 1px 6px rgba(52,152,219,0.08);
    padding: 0.7em 0.7em 0.5em 0.7em;
    margin-bottom: 1.2em;
    border: 1.5px solid #e0e4ea;
    display: flex;
    gap: 0.7em;
    flex-wrap: wrap;
    align-items: center;
}
#sidebar-toggle, #sidebar-fab {
    background: linear-gradient(135deg, #1766a0 0%, #3498db 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 0 4px 16px rgba(52,152,219,0.18);
    font-size: 1.5em;
    align-items: center;
    justify-content: center;
    display: flex;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
#sidebar-toggle:hover, #sidebar-fab:hover {
    background: #217dbb;
    color: #fff;
    box-shadow: 0 8px 32px rgba(52,152,219,0.22);
}
#chart-sidebar {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 0;
}
.tab-content {
    background: #fafdff;
    border: 1.5px solid #e0e4ea;
    border-radius: 0 0 1.1rem 1.1rem;
    box-shadow: 0 2px 12px rgba(52,152,219,0.04);
    padding: 1.1em 1.2em 1em 1.2em;
    margin-top: 0;
    margin-bottom: 0;
    min-height: 180px;
    transition: box-shadow 0.18s, border-color 0.18s;
}
.tab-content:focus-within, .tab-content:hover {
    box-shadow: 0 4px 20px rgba(52,152,219,0.09), 0 2px 8px rgba(0,0,0,0.04);
    border-color: #b3d6f7;
}
.table {
    background: #fff;
    border-radius: 0.7em;
    box-shadow: 0 2px 8px rgba(52,152,219,0.08);
    font-size: 1em;
}
.table thead th {
    background: #e3f1fb;
    color: #217dbb;
    border-bottom: 2px solid #b3d6f7;
}
.table-bordered td, .table-bordered th {
    border: 1.5px solid #e0e4ea;
}
.btn-outline-primary, .btn-outline-secondary {
    border-radius: 0.5em;
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 4px rgba(52,152,219,0.07);
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-outline-primary:hover, .btn-outline-secondary:hover {
    background: #3498db;
    color: #fff;
    box-shadow: 0 2px 8px rgba(52,152,219,0.13);
}
.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2em auto;
    display: block;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
::-webkit-scrollbar {
    width: 10px;
    background: #e3f1fb;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb {
    background: #b3d6f7;
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3498db;
}
@media (max-width: 600px) {
    body, html {
        font-size: 15px;
    }
    #sidebar-col {
        min-width: 100vw;
        max-width: 100vw;
        border-radius: 0 0 1.2rem 1.2rem;
        margin: 0;
        box-shadow: 0 2px 12px rgba(52,152,219,0.13);
        padding: 1em 0.5em 0.7em 0.5em;
    }
    #sidebar-toolbar {
        flex-direction: column;
        gap: 0.5em;
        padding: 0.5em 0.3em 0.3em 0.3em;
    }
    #sidebar-toggle, #sidebar-fab, .sidebar-toggle-btn {
        width: 54px;
        height: 54px;
        font-size: 2em;
        right: 12px;
        top: 12px;
    }
    .tab-content {
        padding: 0.7em 0.3em 0.7em 0.3em;
        min-height: 120px;
    }
    .table {
        font-size: 0.95em;
    }
    .navbar, .nav {
        border-radius: 0 0 1.2rem 1.2rem !important;
        padding: 0.2em 0.3em 0 0.3em;
    }
    #map, #chart-sidebar {
        min-width: 100vw;
        max-width: 100vw;
        min-height: 180px;
        height: 40vh !important;
    }
    .chartjs-render-monitor {
        min-width: 0;
        width: 100% !important;
        max-width: 100vw;
    }
    .loader {
        width: 32px;
        height: 32px;
        border-width: 5px;
    }
}

@media (max-width: 400px) {
    body, html {
        font-size: 13px;
    }
    #sidebar-col, #sidebar-toolbar, .tab-content {
        padding-left: 0.1em;
        padding-right: 0.1em;
    }
    #sidebar-toggle, #sidebar-fab, .sidebar-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3em;
    }
    .table {
        font-size: 0.9em;
    }
}

/* Tabellen und Diagramme horizontal scrollbar auf kleinen Geräten */
@media (max-width: 900px) {
    .table-responsive, .tab-content, #chart-sidebar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table {
        min-width: 420px;
    }
    .chartjs-render-monitor {
        min-width: 320px;
    }
}

/* Inputs und Buttons größer für Touch */
@media (max-width: 900px) {
    input, select, button, .btn {
        min-height: 44px;
        font-size: 1.1em;
    }
}

/* DWD Premium Weather Warning Styles */
.alert-dwd-minor {
    background-color: #fffde7 !important;
    border: 2px solid #ffeb3b !important;
    color: #5d4037 !important;
}
.alert-dwd-minor .alert-link {
    color: #3e2723 !important;
}
.alert-dwd-moderate {
    background-color: #fff3e0 !important;
    border: 2px solid #ffb74d !important;
    color: #e65100 !important;
}
.alert-dwd-moderate .alert-link {
    color: #bf360c !important;
}
.alert-dwd-severe {
    background-color: #ffebee !important;
    border: 2px solid #e57373 !important;
    color: #b71c1c !important;
}
.alert-dwd-severe .alert-link {
    color: #880e4f !important;
}
.alert-dwd-extreme {
    background-color: #f3e5f5 !important;
    border: 2px solid #ba68c8 !important;
    color: #4a148c !important;
}
.alert-dwd-extreme .alert-link {
    color: #311b92 !important;
}

