/* Lageübersicht - Situation Overview Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --border-color: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Triage Colors */
    --triage-green: #22c55e;
    --triage-yellow: #eab308;
    --triage-red: #ef4444;
    --triage-black: #374151;
    --triage-affected: #8b5cf6;
    --triage-missing: #f97316;

    /* Status Colors */
    --status-active: #22c55e;
    --status-reserve: #3b82f6;
    --status-external: #a855f7;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* Container */
.situation-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.situation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tactical-time {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.auto-refresh-indicator {
    color: var(--status-active);
    font-size: 14px;
    animation: pulse 2s infinite;
}

.auto-refresh-indicator.refreshing {
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Main Content */
.situation-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Map Section */
.map-section {
    flex: 1;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

/* Wind Overlay */
.wind-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.wind-arrow {
    font-size: 28px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.wind-speed {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

/* Sidebar */
.situation-sidebar {
    width: 380px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

/* Sidebar Cards */
.sidebar-card {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-card h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-card h3 i {
    color: var(--primary-color);
}

/* Forces Grid */
.forces-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.force-item {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
    border-left: 3px solid var(--border-color);
}

.force-item.active {
    border-left-color: var(--status-active);
}

.force-item.reserve {
    border-left-color: var(--status-reserve);
}

.force-item.external {
    border-left-color: var(--status-external);
}

.force-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.force-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
}

/* Triage Grid */
.triage-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.triage-item {
    border-radius: 6px;
    padding: 10px 5px;
    text-align: center;
}

.triage-item.t3 {
    background: var(--triage-green);
    color: white;
}

.triage-item.t2 {
    background: var(--triage-yellow);
    color: #1a1a1a;
}

.triage-item.t1 {
    background: var(--triage-red);
    color: white;
}

.triage-item.deceased {
    background: var(--triage-black);
    color: white;
}

.triage-item.affected {
    background: var(--triage-affected);
    color: white;
}

.triage-item.missing {
    background: var(--triage-missing);
    color: white;
}

.triage-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
}

.triage-label {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Sections Card */
.sections-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sections-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.sections-container::-webkit-scrollbar {
    width: 6px;
}

.sections-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.sections-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sections-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Section Item */
.section-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.section-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.section-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.section-leader {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.section-leader i {
    margin-right: 4px;
}

.section-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.section-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-secondary);
}

.section-stat i {
    font-size: 11px;
    opacity: 0.7;
}

.section-stat.personnel i {
    color: var(--status-active);
}

.section-stat.vehicles i {
    color: var(--primary-color);
}

/* Section Triage Mini */
.section-triage {
    display: flex;
    gap: 4px;
    margin-top: 8px;
}

.section-triage-badge {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.section-triage-badge.t1 {
    background: var(--triage-red);
    color: white;
}

.section-triage-badge.t2 {
    background: var(--triage-yellow);
    color: #1a1a1a;
}

.section-triage-badge.t3 {
    background: var(--triage-green);
    color: white;
}

/* No Sections Message */
.no-sections {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.no-sections i {
    font-size: 32px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Loading Placeholder */
.loading-placeholder {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    max-width: 350px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success { background: #10b981; color: white; }
.toast-error { background: #ef4444; color: white; }
.toast-warning { background: #f59e0b; color: white; }
.toast-info { background: var(--primary-color); color: white; }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Unit Markers (same as map-view) */
.unit-marker {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.unit-marker-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.unit-marker-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Feature Labels */
.feature-label-tooltip {
    background: rgba(15, 23, 42, 0.85) !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.feature-label-tooltip::before {
    display: none !important;
}

/* Section tooltip */
.section-tooltip {
    background: rgba(30, 41, 59, 0.95) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    border-radius: 4px !important;
    color: #f1f5f9 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 6px 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.section-tooltip::before {
    display: none !important;
}

/* Area Labels (permanente Flächenbezeichnungen) */
.area-label-scalable {
    background: transparent !important;
    border: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none !important;
}

.area-label-scalable .area-label-text {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid;
    border-radius: 4px;
    color: #1e293b;
    font-weight: 600;
    padding: 0.25em 0.6em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    text-shadow: none;
    transform: translate(-50%, -50%);
}

/* Auto-Scroll Indicator */
.auto-scroll-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--bg-tertiary);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.auto-scroll-indicator i {
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Responsive: Larger screens get more space for sidebar */
@media (min-width: 1920px) {
    .situation-sidebar {
        width: 450px;
    }

    .forces-grid {
        gap: 10px;
    }

    .force-value {
        font-size: 26px;
    }

    .triage-value {
        font-size: 24px;
    }

    .section-item {
        padding: 15px;
    }

    .section-name {
        font-size: 17px;
    }
}

/* Very large screens (4K displays) */
@media (min-width: 2560px) {
    .situation-sidebar {
        width: 550px;
    }

    .situation-header {
        padding: 16px 30px;
    }

    .header-left h1 {
        font-size: 26px;
    }

    .tactical-time {
        font-size: 20px;
    }

    .force-value {
        font-size: 32px;
    }

    .triage-value {
        font-size: 28px;
    }
}
