﻿:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6; /* Beautiful Blue */
    --primary-hover: #2563eb;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.header-title h1 {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #3b82f6, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.info-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(34, 197, 94, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Layout Styling */
.content-wrapper {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* Map Styling */
#map {
    flex-grow: 1;
    background-color: #000; /* Dark background behind map image */
    cursor: crosshair;
}

/* Verhindert, dass das Bild beim Reinzoomen unscharf/verschwommen wird (erhÃƒÂ¤lt die SchÃƒÂ¤rfe) */
.leaflet-image-layer {
    image-rendering: -moz-crisp-edges;
    image-rendering: -o-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Legend Sidebar Styling */
.legend-sidebar {
    width: 300px;
    background: rgba(15, 23, 42, 0.85);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1000;
    transition: width 0.3s ease;
}

.legend-sidebar.collapsed {
    width: 0;
    border-left: none;
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(5px);
    z-index: 2;
    transition: opacity 0.3s ease;
}

.legend-sidebar.collapsed .legend-header {
    opacity: 0;
}

.legend-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.legend-sidebar.collapsed .legend-title {
    opacity: 0;
    width: 0;
    display: none;
}

/* Floating Toggle Button */
.btn-toggle-floating {
    position: absolute;
    right: 300px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--glass-border);
    border-right: none;
    color: #fff;
    padding: 16px 8px;
    border-radius: 8px 0 0 8px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.legend-sidebar.collapsed + .btn-toggle-floating {
    right: 0;
    opacity: 0.5;
    padding: 12px 6px;
}

.legend-sidebar.collapsed + .btn-toggle-floating:hover {
    opacity: 1;
    padding: 16px 12px;
}

.btn-toggle-floating svg {
    transition: transform 0.3s ease;
    /* When legend is OPEN, button points right (to close it) */
}

.legend-sidebar.collapsed + .btn-toggle-floating svg {
    /* When legend is COLLAPSED, button points left (to open it) */
    transform: rotate(180deg);
}

.legend-list {
    list-style: none;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.legend-sidebar.collapsed .legend-list {
    display: none;
    opacity: 0;
}

/* Category Modal List Styling */
.category-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-list-item .category-name {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
}

.btn-delete-category {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.btn-delete-category:hover {
    background: var(--primary-color);
    color: #fff;
}

.legend-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-2px);
}

.legend-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
    margin-top: 3px;
}

.legend-text-content {
    flex-grow: 1;
    overflow: hidden;
}

.legend-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legend-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Glassmorphism Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.glass-panel {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    box-shadow: var(--glass-shadow);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .glass-panel {
    transform: translateY(-20px);
}

.glass-panel h2 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-group select option {
    background-color: #1e293b;
    color: #fff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(59, 130, 246, 0.1);
    color: #93c5fd; /* Light blue text */
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.btn-secondary:hover {
    background-color: rgba(59, 130, 246, 0.2);
    color: #fff;
    border-color: var(--primary-hover);
}

/* Leaflet Popup Customization (Dark Theme) */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-color) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: 12px !important;
}

.leaflet-popup-content {
    font-family: 'Inter', sans-serif;
    margin: 16px 20px !important;
    min-width: 200px;
}

.popup-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.popup-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #94a3b8 !important;
    padding: 8px 8px 0 0 !important;
}

/* TOC Sidebar specific styles */
.toc-sidebar { overflow: hidden; flex: 0 0 360px;
    width: 360px;
    background: rgba(15, 23, 42, 0.85);
    border-right: 1px solid var(--glass-border);
    border-left: none; /* override legend-sidebar */
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    height: 100%;
}
.toc-sidebar.collapsed {
    width: 0;
    flex: 0 0 0px;
    overflow: hidden;
    border-right: none;
}
.toc-sidebar.collapsed .legend-header,
.toc-sidebar.collapsed .legend-list {
    display: none;
    opacity: 0;
}

/* TOC Toggle Button */
.btn-toggle-toc {
    position: absolute;
    left: 360px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--glass-border);
    border-left: none;
    color: #fff;
    padding: 16px 8px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: left 0.3s ease, opacity 0.2s, padding 0.2s;
    z-index: 1000;
}
.btn-toggle-toc:hover {
    background: var(--hover-color);
}
.toc-sidebar.collapsed ~ .btn-toggle-toc {
    left: 0;
    opacity: 0.5;
    padding: 12px 6px;
}
.toc-sidebar.collapsed ~ .btn-toggle-toc:hover {
    opacity: 1;
    padding: 16px 12px;
}
.btn-toggle-toc svg {
    transition: transform 0.3s ease;
}
.toc-sidebar.collapsed ~ .btn-toggle-toc svg {
    transform: rotate(180deg);
}

/* Active TOC Item */
.toc-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    font-weight: bold;
}
.toc-item.active .legend-color-dot {
    box-shadow: 0 0 8px var(--primary-color);
}


/* Custom Select Dropdown */
.custom-select {
    position: relative;
    width: 100%;
    font-size: 0.85rem;
}
.custom-select .select-selected {
    background: rgba(15, 23, 42, 0.6);
    color: white;
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.custom-select .select-selected:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--primary-color);
}
.custom-select .select-selected::after {
    content: '';
    border: solid white;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-bottom: 2px;
}
.custom-select .select-selected.select-arrow-active::after {
    transform: rotate(-135deg);
    margin-bottom: -2px;
}
.custom-select .select-items {
    position: absolute;
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    margin-top: 5px;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.custom-select .select-items div {
    color: white;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, color 0.2s ease;
}
.custom-select .select-items div:hover, .custom-select .select-items div.same-as-selected {
    background-color: var(--primary-color);
    color: white;
}
.select-hide {
    display: none;
}


/* Draggable Leaders Window */
.draggable-window {
    position: fixed;
    top: 150px;
    left: 100px;
    width: 600px;
    max-width: 90vw;
    min-width: 350px;
    min-height: 200px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: hidden;
    color: white;
}
.draggable-window.hidden {
    display: none;
}
.draggable-header {
    background: rgba(30, 41, 59, 0.9);
    padding: 10px 15px;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    user-select: none;
}
.draggable-header:active {
    cursor: grabbing;
}
.draggable-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}
.leaders-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.leaders-table tr:hover {
    background: rgba(255,255,255,0.05);
}
/* Custom Input Fields */
.custom-input {
    background: rgba(15, 23, 42, 0.6);
    color: white;
    padding: 0.6rem 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: background 0.3s ease, border-color 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.custom-input:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--primary-color);
}
.custom-input::placeholder {
    color: rgba(255,255,255,0.5);
}


