/* Global Styles & Variables */
:root {
    --bg-dark: #121212;
    --bg-sidebar: #1e1e1e;
    --bg-card: #2a2a2a;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --primary: #d32f2f; /* Feuerwehr Rot */
    --primary-hover: #b71c1c;
    --secondary: #424242;
    --border: #333;
    --accent: #1976d2;
    
    /* Status Colors */
    --status-1: #4caf50; /* Grün */
    --status-2: #8bc34a; /* Hellgrün */
    --status-3: #ffeb3b; /* Gelb */
    --status-4: #ff9800; /* Orange */
    --status-5: #f44336; /* Rot */
    --status-6: #9e9e9e; /* Grau */
    
    /* Priority Colors */
    --priority-high: #f44336;
    --priority-medium: #ff9800;
    --priority-low: #4caf50;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li a {
    display: block;
    padding: 15px 25px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav li a:hover, .sidebar-nav li a.active {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-left: 4px solid var(--primary);
}

.sidebar-footer {
    padding: 15px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

/* Content Sections */
.content-section {
    animation: fadeIn 0.3s ease-in-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

/* Tables */
.table-container {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

tr:hover {
    background-color: rgba(255,255,255,0.05);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-right: 5px;
}

/* Form Controls */
.filter-bar, .action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="text"], select, textarea {
    background-color: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px;
    border-radius: 4px;
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Status Badges & Selects */
.status-select {
    padding: 5px;
    border-radius: 4px;
    font-weight: bold;
    color: #000;
}

.status-1 { background-color: var(--status-1); }
.status-2 { background-color: var(--status-2); }
.status-3 { background-color: var(--status-3); }
.status-4 { background-color: var(--status-4); }
.status-5 { background-color: var(--status-5); }
.status-6 { background-color: var(--status-6); }

.priority-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.priority-hoch { background-color: var(--priority-high); color: white; }
.priority-mittel { background-color: var(--priority-medium); color: white; }
.priority-niedrig { background-color: var(--priority-low); color: white; }

/* Modals */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background-color: var(--bg-card);
    color: var(--text-main);
    padding: 15px 25px;
    border-radius: 4px;
    border-left: 5px solid var(--primary);
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar-header h2, .sidebar-nav li a span, .sidebar-footer p {
        display: none;
    }
    .sidebar-nav li a {
        text-align: center;
        padding: 15px 0;
    }
}

/* Map Styles */
.map-container {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

#offline-map {
    flex-grow: 1;
    background-color: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: rgba(0,0,0,0.7);
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 4px solid var(--primary);
    z-index: 10;
}

.map-overlay h3 {
    font-size: 1rem;
    margin-bottom: 5px;
}

.map-overlay p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.region-map-svg {
    width: 100%;
    height: 100%;
    max-height: 600px;
}

.map-marker circle {
    cursor: pointer;
    transition: r 0.2s;
}

.map-marker:hover circle {
    r: 8;
}

/* Notruf Styles */
.notruf-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.notruf-form-card, .notruf-info-card {
    background-color: var(--bg-card);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.notruf-form-card h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-red {
    color: #ff0000;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.btn-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.w-fragen {
    list-style: none;
    margin-top: 20px;
}

.w-fragen li {
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}



/* Auto-Einsatz Switch Styles */
.auto-einsatz-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}
