:root {
    --primary-color: #0069B4;
    /* Extracted Blue */
    --secondary-color: #a855f7;
    /* Keep accent or adjust? Let's keep purple as secondary for now or make it gray */
    --accent-color: #0ea5e9;

    /* Light/Clean Theme matching medienzentrenbw.de */
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --text-color: #333333;
    --text-muted: #666666;

    --bg-color: #ffffff;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Standard clean web font */
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
}

/* Remove blobs */
.background-blobs {
    display: none;
}

/* Update Logo */
.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

/* Glass Card -> Clean Card */
.glass-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    /* Less rounded */
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Subtle shadow */
    margin-bottom: 2rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem;
    /* Add padding to container */
    margin-top: 7rem; /* Increased to avoid overlap with nav */
    height: calc(100vh - 11rem);
    /* Adjust for padding/nav */
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: move 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: purple;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: blue;
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: teal;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* App Container */
.app-container {
    max-width: 1400px; /* Increased for better map view */
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3 {
    margin-top: 0;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(to right, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Forms */
input,
select {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    color: #334155;
    font-size: 1rem;
    box-sizing: border-box;
    /* Include padding in width */
}

/* Buttons */
button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
}

/* Inputs */
input:focus,
select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 105, 180, 0.2);
    outline: none;
}

/* Layout Utils */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Login Page specific */
.login-view {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    margin-top: 15vh;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 100px;
    /* Fixed height to accommodate logo */
    display: flex;
    align-items: center;
}

.nav-content {
    max-width: 1400px;
    /* Wider container */
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.nav-links a {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    margin-left: 2rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    /* Fixed gradient text issue */
    background: none; 
    -webkit-text-fill-color: initial;
    color: var(--primary-color);
}

/* Map specific */
#map {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    z-index: 1;
    background: #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar {
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Cleaner Cards in Sidebar */
.center-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.center-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.center-card strong {
    font-size: 1.1rem;
    color: #1e293b;
    display: block;
    margin-bottom: 0.25rem;
}

/* Badges - Larger & More readable */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.badge-blue {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-purple {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
}

.badge-green {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}


.map-popup {
    color: #0f172a;
}

/* Cube Stacking */
.custom-cube-icon {
    background: none;
    border: none;
    transition: transform 0.2s ease-out; /* Smooth resizing */
    transform-origin: bottom center; /* Scale from bottom */
}

.cube-stack {
    display: flex;
    flex-direction: column-reverse; /* Build from bottom up */
    align-items: center;
    width: 12px; /* Adjusted width */
}

.cube {
    width: 10px; /* Smaller base size */
    height: 10px;
    margin-bottom: 1px;
    border-radius: 1px;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

/* Zoom dependent scaling handled via map classes */
.map-zoom-low .custom-cube-icon {
    transform: scale(0.4);
}

.map-zoom-mid .custom-cube-icon {
    transform: scale(0.7);
}

.map-zoom-high .custom-cube-icon {
    transform: scale(1);
}


.cube-green {
    background: #4ade80;
    /* bright green (Light Green for overregional) */
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
}

.cube-darkgreen {
    background: #15803d;
    /* dark green (Local Free) */
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.cube-yellow {
    background: #facc15;
    /* yellow */
    background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
}

.cube-red {
    background: #f87171;
    /* red */
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
}

/* Legend */
.map-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.bg-green {
    background: #4ade80;
    background: linear-gradient(135deg, #86efac 0%, #4ade80 100%);
}

.bg-darkgreen {
    background: #15803d;
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
}

.bg-yellow {
    background: #facc15;
    background: linear-gradient(135deg, #fef08a 0%, #eab308 100%);
}

.bg-red {
    background: #f87171;
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
}

/* Map Tooltip */
.map-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    color: rgba(59, 130, 246, 0.8);
    font-weight: 600;
    text-shadow: 0 0 2px white;
    font-size: 0.8rem;
}

/* Passwort-Modal */
.password-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
    z-index: 2000;
    border: 1px solid #e2e8f0;
}

.password-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: -1;
}

.password-modal h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.password-modal input {
    margin-bottom: 1rem;
}

.password-modal button[type="button"] {
    width: 100%;
    margin-top: 0.5rem;
}

/* Verschwommene Darstellung nur für Karte und Liste */
.blurred-map {
    filter: blur(8px);
    opacity: 0.5;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.blurred-map:hover {
    opacity: 0.7;
}

.blurred-map::after {
    content: '🔒 Klicken für Zugriff';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    color: var(--primary-color);
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Navigation bleibt immer klar sichtbar */
.glass-nav,
.glass-nav *,
.nav-content,
.nav-links,
.nav-links * {
    filter: none !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: auto !important;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    #map {
        height: 400px;
    }
}