/* UAV Dashboard CSS - Enhanced Interactive Layout */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-root) 0%, var(--bg-root-2) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* Hide main page scrollbars completely */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

html::-webkit-scrollbar {
    width: 0px; /* Remove scrollbar space */
    background: transparent; /* Optional: just make scrollbar invisible */
}

body::-webkit-scrollbar {
    width: 0px; /* Remove scrollbar space */
    background: transparent; /* Optional: just make scrollbar invisible */
}

/* Navy & Gold Design Tokens */
:root {
    /* Main Background Colors */
    --bg-root: #0B1F3A;          /* header/navy sangat gelap */
    --bg-root-2: #102A4A;        /* untuk gradient ke bawah */
    --surface: #0F2747;          /* kartu/bidang utama */
    --surface-2: #142E55;        /* surface elevated/toolbar */
    
    /* Text Colors */
    --text-primary: #E6EDF6;     /* teks utama di dark */
    --text-muted: #9FB4D0;       /* teks sekunder */
    
    /* Border & Accent Colors */
    --border-gold: #E6C70E;      /* aksen emas (border/ring) */
    --accent-gold: #E6C70E;      /* tombol primer & highlight */
    --accent-blue: #1E3A8A;      /* aksen biru sekunder */
    --divider: #213A5B;          /* garis halus */
    
    /* State Colors */
    --state-success: #16A34A;    /* chip "Online/Connected" */
    --state-info: #0EA5E9;       /* chip info/ESP32 */
    --state-warn: #F59E0B;       /* peringatan */
    --state-danger: #EF4444;     /* emergency */
    
    /* Chart Colors */
    --chart-red: #F43F5E;        /* Voltage (V) */
    --chart-blue: #60A5FA;       /* Current (A) */
    --chart-dashed: #E6C70E;     /* Threshold (17.5V) */
    --gridline: #2A4369;         /* garis grid chart tipis */
    
    /* Legacy Support (backward compatibility) */
    --primary-bg: var(--bg-root);
    --secondary-bg: var(--bg-root-2);
    --card-bg: var(--surface);
    --card-hover: var(--surface-2);
    --accent-color: var(--accent-gold);
    --accent-hover: #D1B00A;
    --text-secondary: var(--text-muted);
    --border-color: var(--border-gold);
    --success-color: var(--state-success);
    --warning-color: var(--state-warn);
    --danger-color: var(--state-danger);
    --info-color: var(--state-info);
    
    /* Shadows & Effects */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.35);
    --glow: 0 0 10px rgba(230, 199, 14, 0.2);
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-Index Hierarchy - Prevent overlapping issues */
    --z-loading: 10000;
    --z-modal: 9000;
    --z-notification: 8000;
    --z-tooltip: 7000;
    --z-navbar: 5000;
    --z-map-controls: 900;
    --z-map-elements: 800;
    --z-cards: 100;
    --z-base: 1;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(45deg, var(--bg-root), var(--bg-root-2));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-loading);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.loading-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.loading-spinner {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
}

.spinner-plane {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: var(--accent-gold);
    animation: planeFly 3s ease-in-out infinite;
}

.spinner-orbit {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loading-progress {
    width: 300px;
    height: 4px;
    background: var(--divider);
    border-radius: 2px;
    margin: 20px auto 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--state-info));
    border-radius: 2px;
    width: 0%;
    animation: progressLoad 3s ease-out forwards;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--bg-root) 0%, var(--bg-root-2) 100%);
    padding: 15px 30px;
    border-bottom: 2px solid var(--border-gold);
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: var(--z-navbar);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.logo-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(230, 199, 14, 0.3));
    transition: all var(--transition-medium);
}

.logo-image:hover {
    filter: drop-shadow(0 4px 8px rgba(230, 199, 14, 0.5));
    transform: scale(1.05);
}

/* Fallback styling jika logo tidak ditemukan */
.logo-image[alt]:after {
    content: attr(alt);
    color: var(--accent-gold);
    font-size: 12px;
    text-align: center;
    display: block;
}

.logo-text h1 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 25px;
}

.connection-indicators {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px; /* Increased gap */
    padding: 10px 15px; /* Increased padding */
    background: rgba(20, 46, 85, 0.7);
    border-radius: 15px;
    border: 1px solid rgba(230, 199, 14, 0.3);
    transition: all var(--transition-medium);
    position: relative;
    min-height: 42px; /* Added minimum height to prevent text clipping */
    word-wrap: break-word; /* Prevent text overflow */
    overflow: visible; /* Allow content to be visible */
}

.status-item:hover {
    background: rgba(20, 46, 85, 0.9);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--state-success);
    position: relative;
}

.status-dot.online {
    background: var(--state-success);
    box-shadow: 0 0 10px var(--state-success);
}

.status-dot.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

.indicator-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--state-success);
    margin-left: 8px;
    animation: blink 1s ease-in-out infinite;
}

.signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.signal-bars .bar {
    width: 3px;
    background: var(--border-gold);
    border-radius: 1px;
    transition: background var(--transition-medium);
}

.bar1 { height: 25%; }
.bar2 { height: 50%; }
.bar3 { height: 75%; }
.bar4 { height: 100%; }

.signal-bars .bar.active {
    background: var(--accent-gold);
    animation: signalPulse 2s ease-in-out infinite;
}

.system-time {
    font-family: 'Courier New', monospace;
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 14px;
}

/* Logout Button */
.logout-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.8) 0%, rgba(220, 38, 38, 0.8) 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 42px;
}

.logout-button:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 1) 0%, rgba(220, 38, 38, 1) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.logout-button:active {
    transform: translateY(0);
}

.logout-button i {
    font-size: 16px;
}

@media (max-width: 768px) {
    .logout-button span {
        display: none;
    }
    
    .logout-button {
        padding: 10px 14px;
    }
}

/* =============================================================================
   LOGOUT CONFIRMATION MODAL
   ============================================================================= */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 31, 58, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* Modal Container */
.modal-container {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(20px);
    opacity: 0;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-overlay.closing .modal-container {
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Modal Content */
.modal-content {
    background: var(--surface);
    border: 2px solid var(--border-gold);
    border-radius: 20px;
    padding: 40px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5),
                0 0 60px rgba(230, 199, 14, 0.15);
    position: relative;
}

/* Modal Icon */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.15) 100%);
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.modal-icon i {
    font-size: 36px;
    color: #ef4444;
}

/* Modal Title */
.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

/* Modal Message */
.modal-message {
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.6;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.modal-btn i {
    font-size: 16px;
}

/* Secondary Button (Cancel) */
.btn-secondary {
    background: var(--bg-root);
    border: 2px solid var(--border-gold);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 199, 14, 0.2);
}

/* Danger Button (Confirm Logout) */
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: 2px solid rgba(239, 68, 68, 0.5);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.modal-btn:active {
    transform: translateY(0);
}

.modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading State */
.modal-btn.loading {
    position: relative;
    color: transparent;
}

.modal-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .modal-content {
        padding: 32px 24px;
    }
    
    .modal-title {
        font-size: 20px;
    }
    
    .modal-message {
        font-size: 14px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-btn {
        min-width: 100%;
    }
}

/* Main Dashboard Layout - FIXED */
.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.2fr) minmax(320px, 380px);
    grid-gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 140px);
    margin: 0 auto;
    max-width: 1800px; /* Added max-width constraint */
    animation: slideInUp 0.8s ease;
}

/* Card Base Styles */
.flight-path-card,
.power-graph-card,
.about-card,
.system-status-card,
.activity-log-card {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(230, 199, 14, 0.3);
    transition: all var(--transition-medium);
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: none;
    z-index: var(--z-cards);
}

/* Fixed dimension utility: menjaga ukuran card tidak berubah meskipun konten panjang */
.fixed-card {
    overflow: hidden !important;
    position: relative;
}

/* Pastikan grid tidak melar saat teks panjang */
.dashboard .fixed-card,
.dashboard .data-card,
.dashboard .status-item,
.dashboard .activity-log-card {
    contain: layout paint style; /* bantu mencegah reflow besar */
}

/* Truncation untuk label/value di data-card */
.data-card .data-label,
.data-card .data-value {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* Pembatasan tinggi data-card diperbesar untuk optimasi vertical space */
.data-card {
    min-height: 90px;
    max-height: 110px;
}

/* Jika ada elemen teks dinamis panjang (misal id tertentu) pakai class .truncate dinamis dari JS */
.truncate {
    white-space: nowrap;
    overflow: hidden !important;
    text-overflow: ellipsis;
    display: block;
}

/* System status value panjang - Updated */
.status-item .status-value {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Activity log potong baris tanpa menambah tinggi container */
.activity-log {
    line-height: 1.2;
}
.activity-log .log-message {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
}

/* Map legend text panjang */
.map-legend .legend-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    display: inline-block;
}

.flight-path-card:hover,
.power-graph-card:hover,
.about-card:hover,
.system-status-card:hover,
.activity-log-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(230, 199, 14, 0.15);
    border-color: rgba(230, 199, 14, 0.6);
    background: var(--surface-2);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid rgba(230, 199, 14, 0.2);
}

.card-header h3,
.card-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-controls {
    display: flex;
    gap: 5px;
}

.control-btn,
.control-btn-small {
    background: transparent;
    border: 1px solid rgba(230, 199, 14, 0.4);
    color: var(--text-muted);
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.control-btn:hover,
.control-btn-small:hover {
    background: var(--accent-gold);
    color: var(--bg-root);
    border-color: var(--accent-gold);
    transform: scale(1.1);
}

/* Left Panel - Flight Map - FIXED */
.left-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0; /* Prevent grid column expansion */
    min-height: 600px; /* Added minimum height */
}

.flight-path-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: clamp(520px, 78vh, 1100px);
    height: auto;
    transition: all 0.3s ease;
}

.flight-path-card.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: var(--bg-primary);
    margin: 0;
    border-radius: 0;
}

.flight-path-card.fullscreen .map-container {
    margin: 0;
    border-radius: 0;
    height: 100%;
}

/* Hide all other panels when map is fullscreen to prevent overlap */
/* Using adjacent sibling selector to target panels after left-panel */
.left-panel:has(.flight-path-card.fullscreen) ~ .center-panel,
.left-panel:has(.flight-path-card.fullscreen) ~ .right-panel {
    display: none !important;
}

/* Fallback: If :has() not supported, use body class (will be added via JS) */
body.map-fullscreen .center-panel,
body.map-fullscreen .right-panel {
    display: none !important;
}

.map-container {
    position: relative;
    flex: 1 1 100%;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px;
    border: 2px solid rgba(230, 199, 14, 0.4);
    z-index: var(--z-cards);
    min-height: clamp(420px, 72vh, 1000px); /* Ensure the map stretches on tall viewports */
    width: 100%;
    box-sizing: border-box;
}

.flight-map {
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    position: relative;
    box-sizing: border-box;
    min-height: inherit;
}

/* Map Controls - Z-index below navbar to prevent overlap */
.map-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: var(--z-map-controls);
}

.map-btn {
    width: 36px;
    height: 36px;
    background: rgba(15, 39, 71, 0.95);
    border: 1px solid rgba(230, 199, 14, 0.4);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.map-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--bg-root);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(230, 199, 14, 0.3);
}

/* Ground Position Lock Button States */
.map-btn#lock-ground-position {
    position: relative;
}

.map-btn#lock-ground-position.locked {
    background: rgba(230, 199, 14, 0.2);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.map-btn#lock-ground-position.locked:hover {
    background: rgba(220, 53, 69, 0.9);
    border-color: #dc3545;
    color: #ffffff;
}

.map-btn#lock-ground-position.locked::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 50%;
    animation: pulse-lock 2s ease-in-out infinite;
}

@keyframes pulse-lock {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.map-status {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: var(--z-map-controls);
}

.gps-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(15, 39, 71, 0.95);
    border-radius: 20px;
    border: 1px solid rgba(230, 199, 14, 0.4);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    font-size: 12px;
}

.map-legend {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(15, 39, 71, 0.95);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(230, 199, 14, 0.4);
    backdrop-filter: blur(10px);
    z-index: var(--z-map-controls);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 12px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-icon {
    color: var(--accent-gold);
    font-size: 14px;
}

.legend-icon.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

.legend-line {
    width: 20px;
    height: 2px;
    background: var(--accent-gold);
    border-radius: 1px;
}

.legend-line.animated {
    animation: lineGlow 2s ease-in-out infinite;
}

.legend-marker.home {
    width: 12px;
    height: 12px;
    background: var(--state-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--state-success);
}

/* Map Layer Switcher Panel */
.map-layer-panel {
    position: absolute;
    top: 60px;
    right: 15px;
    width: 280px;
    background: rgba(15, 39, 71, 0.98);
    border: 1px solid rgba(230, 199, 14, 0.5);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    z-index: var(--z-map-controls);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.map-layer-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.layer-panel-header {
    padding: 15px;
    border-bottom: 1px solid rgba(230, 199, 14, 0.2);
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.3), rgba(15, 39, 71, 0.3));
}

.layer-panel-header h4 {
    margin: 0;
    color: var(--accent-gold);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-panel-header i {
    font-size: 16px;
}

.layer-options {
    padding: 10px;
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(20, 46, 85, 0.4);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layer-option:last-child {
    margin-bottom: 0;
}

.layer-option:hover {
    background: rgba(30, 58, 138, 0.5);
    border-color: rgba(230, 199, 14, 0.3);
    transform: translateX(3px);
}

.layer-option.active {
    background: rgba(30, 58, 138, 0.7);
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(230, 199, 14, 0.2);
}

.layer-preview {
    width: 40px;
    height: 40px;
    background: rgba(11, 31, 58, 0.8);
    border: 1px solid rgba(230, 199, 14, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-preview i {
    font-size: 18px;
    color: var(--accent-gold);
}

.layer-option.active .layer-preview {
    background: rgba(230, 199, 14, 0.2);
    border-color: var(--accent-gold);
}

.layer-info {
    flex: 1;
}

.layer-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 2px;
}

.layer-desc {
    font-size: 11px;
    color: var(--text-muted);
}

.layer-check {
    color: var(--accent-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.layer-option.active .layer-check {
    opacity: 1;
}

.layer-panel-footer {
    padding: 10px 15px;
    border-top: 1px solid rgba(230, 199, 14, 0.2);
    background: rgba(11, 31, 58, 0.5);
    border-radius: 0 0 12px 12px;
}

.layer-panel-footer small {
    color: var(--text-muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.layer-panel-footer i {
    color: var(--accent-gold);
}

/* Center Panel - Power Graph & Data - FIXED */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    width: 100%;
    max-width: none;
    min-width: 0; /* Prevent grid column expansion */
    min-height: 600px; /* Added minimum height */
}

.power-graph-card {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 500px; /* Increased for better timestamp visibility */
    max-height: 650px; /* Increased max height */
}

.graph-container {
    flex: 1;
    position: relative;
    padding: 30px 30px 50px 30px; /* Increased bottom padding for timestamp labels */
    background: rgba(42, 42, 42, 0.3);
    margin: 0 20px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden; /* Changed from visible - prevent chart from affecting grid layout */
    min-height: 350px; /* Increased minimum height for better timestamp display */
    max-height: 550px; /* Increased maximum height */
    width: 100%;
    box-sizing: border-box;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-muted);
    z-index: 10;
}

.loading-spinner-small {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--accent-gold);
}

.power-chart {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

/* Canvas-specific styles to prevent layout issues - ENHANCED */
.graph-container canvas,
.graph-container #powerChart {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px;
    background: transparent;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    margin: 0;
}

/* Chart.js responsive container fix */
.chartjs-size-monitor {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

/* Chart container wrapper for proper padding */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 10px; /* Inner padding for chart labels */
    box-sizing: border-box;
}

/* Electrical Monitoring Theme */
.electrical-theme {
    background: var(--surface);
    border: 2px solid var(--state-warn);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.electrical-theme .card-header h3 {
    color: var(--state-warn);
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Statistics Row - FIXED */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* More flexible */
    gap: 15px;
    margin: 0 20px 20px;
    padding: 0;
    width: auto; /* Ensure proper width */
}

.stat-card {
    background: rgba(20, 46, 85, 0.8);
    border: 1px solid rgba(230, 199, 14, 0.3);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 199, 14, 0.2);
    border-color: var(--accent-gold);
}

.stat-card i {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.stat-card.voltage i { color: var(--chart-red); }
.stat-card.current i { color: var(--chart-blue); }
.stat-card.power i { color: var(--state-warn); }
.stat-card.status i { color: var(--state-success); }

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Chart Controls Enhanced */
.card-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.control-btn {
    background: rgba(20, 46, 85, 0.8);
    border: 1px solid rgba(230, 199, 14, 0.4);
    color: var(--accent-gold);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.control-btn:hover {
    background: rgba(230, 199, 14, 0.2);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 199, 14, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

/* Alert System */
.alert-system {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: 300px;
    z-index: 1000;
}

.alert {
    background: rgba(20, 46, 85, 0.95);
    border-left: 4px solid;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.alert.warning {
    border-color: var(--state-warn);
    color: #fbbf24;
}

.alert.danger {
    border-color: var(--state-danger);
    color: #fca5a5;
}

.alert i {
    font-size: 16px;
}

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

/* Responsive Design for Stats - ENHANCED */
@media (max-width: 1400px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (max-width: 1200px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 8px 15px;
    }
    
    .logo {
        height: 28px;
    }
    
    .header-title {
        font-size: 20px;
        margin: 0 8px;
    }
    
    .header-info {
        font-size: 11px;
        gap: 8px;
    }
    
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
        padding: 12px;
        min-height: auto;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        height: auto;
        min-height: auto;
        max-width: 100%;
    }
    
    .stats-row {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 10px;
        margin: 0 0 15px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .control-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
        padding: 15px;
    }
    
    .control-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .right-panel {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .system-status-card,
    .activity-log-card {
        height: auto;
        min-height: 250px;
    }
    
    .flight-path-card {
        height: 50vh;
        min-height: 300px;
    }
    
    .power-graph-card {
        min-height: 400px; /* Increased for mobile timestamp visibility */
        max-height: 500px;
    }
    
    .graph-container {
        padding: 20px 15px 35px 15px; /* Adjusted padding for mobile */
        min-height: 320px; /* Ensure sufficient height for timestamps */
    }
    
    .card h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .status-item {
        padding: 8px 12px;
        min-height: 40px; /* Maintain minimum height on mobile */
        gap: 8px;
    }
    
    .status-label {
        font-size: 12px;
        min-width: 70px; /* Smaller min-width for mobile */
    }
    
    .status-value {
        font-size: 13px;
        min-width: 80px; /* Smaller min-width for mobile */
        max-width: 100px; /* Prevent overflow on small screens */
    }
    
    .activity-item {
        padding: 8px 12px;
    }
    
    .activity-time {
        font-size: 10px;
    }
    
    .activity-message {
        font-size: 12px;
    }
    
    .footer {
        padding: 12px 15px;
    }
    
    .footer-content {
        font-size: 10px;
        gap: 12px;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .stats-row {
        margin: 0 15px 15px;
        gap: 8px;
    }
    
    .graph-container {
        padding: 25px 20px 40px 20px; /* Reduced padding for mobile but keep bottom space for timestamps */
        min-height: 280px; /* Smaller min-height for mobile */
        max-height: 400px; /* Smaller max-height for mobile */
    }
    
    .power-graph-card {
        min-height: 350px; /* Smaller min-height for mobile */
        max-height: 450px; /* Smaller max-height for mobile */
    }
}

/* Telemetry Data */
.telemetry-data {
    flex: 0.8;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-medium);
    border: 2px solid rgba(230, 199, 14, 0.3);
    overflow: hidden;
    width: 100%;
    max-width: none;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--surface-2);
    border-bottom: 2px solid rgba(230, 199, 14, 0.2);
}

.data-header h4 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.refresh-indicator {
    color: var(--state-success);
    animation: pulse 1.5s ease-in-out infinite;
}

.refresh-text {
    color: var(--text-muted);
}

.data-row {
    display: flex;
    gap: 18px;
    padding: 20px 20px;
    width: 100%;
}

.data-card {
    flex: 1;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 20px 15px;
    border: 1px solid rgba(230, 199, 14, 0.3);
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
    min-height: 90px;
}

.data-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transition: transform var(--transition-medium);
}

.data-card.hoverable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-light);
    border-color: var(--accent-gold);
    background: var(--surface);
}

.data-card.hoverable:hover::before {
    transform: scaleX(1);
}

.data-card.critical::before {
    background: var(--state-danger);
}

.data-card.warning::before {
    background: var(--state-warn);
}

.data-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.data-icon {
    font-size: 22px;
    color: var(--accent-gold);
    width: 26px;
    text-align: center;
}

.data-content {
    flex: 1;
}

.data-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.data-value {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
}

.data-value.animate-number {
    transition: all 0.3s ease;
}

.data-value.animate-number.updating {
    animation: numberPulse 0.5s ease;
}

/* Speed-specific styling */
.data-value.speed-low {
    color: var(--text-muted);
}

.data-value.speed-medium {
    color: var(--accent-gold);
}

.data-value.speed-high {
    color: var(--error-color);
    animation: speedPulse 2s infinite;
}

/* Speed fallback mode warning (Haversine calculation) */
.data-value.speed-fallback {
    color: var(--state-warning) !important;
    opacity: 0.8;
    border-left: 2px solid var(--state-warning);
    padding-left: 8px;
    animation: warningPulse 3s ease-in-out infinite;
}

@keyframes warningPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1.0; }
}

/* Speed trend indicators */
.data-trend.trend-up {
    color: var(--state-success);
}

.data-trend.trend-down {
    color: var(--state-warning);
}

.data-trend.trend-stable {
    color: var(--text-muted);
}

.data-trend {
    font-size: 15px;
    color: var(--success-color);
    margin-top: 4px;
}

.data-trend i.fa-arrow-up {
    color: var(--state-success);
}

.data-trend i.fa-arrow-down {
    color: var(--state-danger);
}

.data-trend i.fa-minus {
    color: var(--text-muted);
}

/* Right Panel - FIXED */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1 1 auto;
    height: auto;
    min-width: 0; /* Prevent grid column expansion */
    min-height: 620px;
}

.about-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: none;
}

.about-content {
    padding: 28px 32px 32px 32px; /* Add more bottom padding */
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.team-btn {
    background: linear-gradient(135deg, var(--accent-gold), #D1B00A);
    color: var(--bg-root);
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-medium);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 250px;
    height: 52px;
}

.team-btn.hoverable:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(230, 199, 14, 0.4);
}

.or-divider {
    position: relative;
    margin: 20px 0;
    text-align: center;
    width: 100%;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
    animation: none !important;
    box-shadow: none !important;
}

.or-divider span {
    background: var(--surface);
    color: var(--state-danger);
    padding: 0 15px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 
        0 0 8px rgba(239, 68, 68, 0.6),
        0 0 16px rgba(239, 68, 68, 0.4),
        0 0 24px rgba(239, 68, 68, 0.2);
    animation: emergencyTextGlow 2s ease-in-out infinite;
}

.emergency-section {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: -20px; /* Move emergency button more up */
    margin-bottom: 15px; /* Add more space from bottom border */
}

.emergency-button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.emergency-cutoff {
    background: radial-gradient(circle, var(--state-danger), #cc2244);
    color: white;
    border: 3px solid #ff5577;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    transition: all var(--transition-medium);
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    pointer-events: auto !important;
    z-index: 1000;
}

.emergency-cutoff::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--state-danger), #ff5577, var(--state-danger));
    z-index: -1;
    animation: rotateBorder 3s linear infinite;
}

.emergency-cutoff:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.5);
}

.emergency-cutoff.pulsing-red {
    animation: emergencyPulse 2s ease-in-out infinite;
}

.emergency-icon {
    font-size: 20px;
}

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

.cut-text {
    font-size: 10px;
    opacity: 0.9;
}

.emergency-status {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

/* Activity Log Styling */
.activity-log {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.1);
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 12px;
    position: relative;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.08);
}

.log-entry.log-system {
    border-left-color: var(--primary-gold);
}

.log-entry.log-success {
    border-left-color: #00ff88;
}

.log-entry.log-warning {
    border-left-color: #ffb347;
}

.log-entry.log-error {
    border-left-color: #ff4757;
}

.log-entry.log-emergency {
    border-left-color: #ff3838;
    background: rgba(255, 56, 56, 0.1);
}

.log-entry.log-relay {
    border-left-color: #7b68ee;
}

.log-entry.log-telemetry {
    border-left-color: #40e0d0;
}

.log-entry.log-map {
    border-left-color: #32cd32;
}

.log-entry.log-chart {
    border-left-color: #ffd700;
}

.log-entry.log-connection {
    border-left-color: #87ceeb;
}

.log-entry.log-info {
    border-left-color: #87ceeb;
}

.log-time {
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    font-size: 11px;
    flex-shrink: 0;
    min-width: 65px;
}

.log-type-icon {
    color: var(--primary-gold);
    font-size: 12px;
    flex-shrink: 0;
    width: 14px;
    text-align: center;
}

.log-entry.log-system .log-type-icon {
    color: var(--primary-gold);
}

.log-entry.log-success .log-type-icon {
    color: #00ff88;
}

.log-entry.log-warning .log-type-icon {
    color: #ffb347;
}

.log-entry.log-error .log-type-icon {
    color: #ff4757;
}

.log-entry.log-emergency .log-type-icon {
    color: #ff3838;
}

.log-entry.log-relay .log-type-icon {
    color: #7b68ee;
}

.log-entry.log-telemetry .log-type-icon {
    color: #40e0d0;
}

.log-entry.log-map .log-type-icon {
    color: #32cd32;
}

.log-entry.log-chart .log-type-icon {
    color: #ffd700;
}

.log-entry.log-connection .log-type-icon {
    color: #87ceeb;
}

.log-message {
    color: var(--text-primary);
    flex-grow: 1;
    font-size: 12px;
    line-height: 1.3;
}

.log-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-gold);
    flex-shrink: 0;
    animation: logPulse 2s ease-in-out infinite;
}

.log-indicator-system {
    background: var(--primary-gold);
}

.log-indicator-success {
    background: #00ff88;
}

.log-indicator-warning {
    background: #ffb347;
}

.log-indicator-error {
    background: #ff4757;
}

.log-indicator-emergency {
    background: #ff3838;
    animation: emergencyPulse 1s ease-in-out infinite;
}

.log-indicator-relay {
    background: #7b68ee;
}

.log-indicator-telemetry {
    background: #40e0d0;
}

.log-indicator-map {
    background: #32cd32;
}

.log-indicator-chart {
    background: #ffd700;
}

.log-indicator-connection {
    background: #87ceeb;
}

@keyframes logPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

@keyframes emergencyPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.4);
        box-shadow: 0 0 8px #ff3838;
    }
}

.log-controls {
    display: flex;
    gap: 4px;
}

.control-btn-small {
    background: rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.3);
    color: var(--primary-gold);
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.control-btn-small:hover {
    background: rgba(218, 165, 32, 0.2);
    border-color: var(--primary-gold);
    color: var(--text-primary);
}

.control-btn-small:active {
    transform: translateY(1px);
}

/* Activity Log Card Specific Styling */
.activity-log-card {
    background: linear-gradient(135deg, 
        rgba(16, 29, 44, 0.95) 0%, 
        rgba(25, 45, 66, 0.95) 100%);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.activity-log-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(218, 165, 32, 0.1);
}

.activity-log-card h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.activity-log-card h4 i {
    color: var(--primary-gold);
}

/* Scrollbar Styling for Activity Log */
.activity-log::-webkit-scrollbar {
    width: 4px;
}

.activity-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.activity-log::-webkit-scrollbar-thumb {
    background: rgba(218, 165, 32, 0.3);
    border-radius: 4px;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: rgba(218, 165, 32, 0.5);
}

/* Emergency Modal - Interactive Confirmation */
.emergency-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.emergency-modal.show {
    display: flex;
    opacity: 1;
    justify-content: center;
    align-items: center;
    animation: emergencyModalFade 0.5s ease;
}

.emergency-modal-content {
    background: linear-gradient(135deg, var(--bg-root) 0%, var(--bg-root-2) 100%);
    border: 3px solid var(--state-danger);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 20px 60px rgba(239, 68, 68, 0.4),
        0 0 100px rgba(239, 68, 68, 0.2);
    animation: emergencyModalSlide 0.5s ease;
    position: relative;
}

.emergency-modal-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(239, 68, 68, 0.3);
}

.emergency-warning-icon {
    font-size: 48px;
    color: var(--state-danger);
    margin-bottom: 15px;
    animation: emergencyWarningPulse 2s ease-in-out infinite;
}

.emergency-modal-header h2 {
    color: var(--state-danger);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    animation: emergencyTextGlow 3s ease-in-out infinite;
}

.emergency-modal-body {
    margin-bottom: 30px;
}

.emergency-warning-text {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.emergency-warning-text p {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.emergency-warning-text strong {
    color: var(--state-danger);
    font-weight: 700;
}

.emergency-warning-text ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.emergency-warning-text li {
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 8px;
    padding-left: 10px;
    position: relative;
}

.emergency-final-warning {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--state-danger);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-top: 20px !important;
}

.emergency-final-warning strong {
    font-size: 18px;
    animation: emergencyTextBlink 1s ease-in-out infinite;
}

.emergency-countdown {
    text-align: center;
    padding: 20px;
    background: rgba(15, 39, 71, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(230, 199, 14, 0.3);
}

.countdown-circle {
    width: 80px;
    height: 80px;
    border: 4px solid var(--state-danger);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    position: relative;
    animation: countdownPulse 1s ease-in-out infinite;
}

.countdown-circle::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 50%;
    animation: countdownRing 2s linear infinite;
}

#countdown-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--state-danger);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.emergency-countdown p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

#countdown-text {
    color: var(--accent-gold);
    font-weight: 600;
}

.emergency-modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.emergency-btn-cancel,
.emergency-btn-confirm {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.emergency-btn-cancel {
    background: rgba(42, 67, 105, 0.8);
    color: var(--text-primary);
    border: 2px solid rgba(42, 67, 105, 0.5);
}

.emergency-btn-cancel:hover {
    background: rgba(42, 67, 105, 1);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(42, 67, 105, 0.4);
}

.emergency-btn-confirm {
    background: var(--state-danger);
    color: white;
    border: 2px solid var(--state-danger);
    position: relative;
    overflow: hidden;
}

.emergency-btn-confirm:disabled {
    background: rgba(239, 68, 68, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    border-color: rgba(239, 68, 68, 0.3);
}

.emergency-btn-confirm:not(:disabled):hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.5);
    animation: emergencyConfirmPulse 0.3s ease;
}

.emergency-btn-confirm:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.emergency-btn-confirm:not(:disabled):hover::before {
    left: 100%;
}

/* System Status - ENHANCED */
.system-status-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: clamp(300px, 52vh, 620px);
    max-height: none;
    overflow: hidden;
}

.system-status-card .card-header {
    flex: 0 0 auto;
}

.status-items {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.status-items::-webkit-scrollbar {
    width: 6px;
}

.status-items::-webkit-scrollbar-track {
    background: rgba(15, 39, 71, 0.35);
    border-radius: 3px;
}

.status-items::-webkit-scrollbar-thumb {
    background: rgba(218, 165, 32, 0.35);
    border-radius: 3px;
}

.status-items::-webkit-scrollbar-thumb:hover {
    background: rgba(218, 165, 32, 0.55);
}

.status-item.animated-status {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 16px 18px;
    border: 1px solid rgba(230, 199, 14, 0.2);
    border-radius: 8px;
    background: rgba(20, 46, 85, 0.3);
    position: relative;
    transition: all var(--transition-medium);
    min-height: 56px;
}

.status-item.animated-status:hover {
    background: rgba(230, 199, 14, 0.1);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 199, 14, 0.15);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.status-icon {
    color: var(--accent-gold);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.status-label {
    color: var(--text-muted);
    font-size: 13px; /* Slightly smaller font */
    font-weight: 500;
    min-width: 90px; /* Increased minimum width */
    flex-shrink: 0;
    line-height: 1.4; /* Better line height */
    display: flex;
    align-items: center;
}

.status-value {
    color: var(--text-primary);
    font-size: 13px; /* Consistent with label */
    font-weight: 600;
    text-align: right;
    min-width: 100px; /* Increased minimum width for better text display */
    max-width: 120px; /* Added max width to prevent overflow */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    line-height: 1.4; /* Better line height */
    word-wrap: break-word; /* Handle long text */
    overflow-wrap: break-word;
    flex-shrink: 0;
}

.status-value.offline {
    color: var(--state-danger);
}

.status-value.online {
    color: var(--state-success);
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-gold);
    opacity: 0;
    flex-shrink: 0;
}

.status-pulse.active {
    animation: pulse 1.5s ease-in-out infinite;
    opacity: 1;
}

.signal-indicator {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 16px;
}

.signal-bar {
    width: 3px;
    background: rgba(230, 199, 14, 0.3);
    border-radius: 1px;
    transition: background var(--transition-medium);
}

.signal-bar:nth-child(1) { height: 4px; }
.signal-bar:nth-child(2) { height: 6px; }
.signal-bar:nth-child(3) { height: 8px; }
.signal-bar:nth-child(4) { height: 12px; }

.signal-bar.active {
    background: var(--accent-gold);
    box-shadow: 0 0 4px rgba(230, 199, 14, 0.4);
}

.packet-counter {
    width: 8px;
    height: 8px;
    background: var(--state-info);
    border-radius: 50%;
    opacity: 0;
    animation: packetPulse 2s ease-in-out infinite;
    margin-left: 8px;
    flex-shrink: 0;
    display: inline-block;
}

@keyframes packetPulse {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.7);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.3);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8);
        box-shadow: 0 0 0 0 rgba(49, 130, 206, 0);
    }
}
.signal-bar:nth-child(4) { height: 10px; }

.signal-bar.active {
    background: var(--state-success);
    box-shadow: 0 0 4px var(--state-success);
}

/* Activity Log - FIXED */
.activity-log-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: clamp(240px, 52vh, 520px);
}

.activity-log-card .card-header {
    flex: 0 0 auto;
}

.activity-log {
    flex: 1 1 auto;
    max-height: clamp(160px, 34vh, 320px);
    min-height: 0;
    overflow-y: auto;
    padding: 0 28px 24px;
    font-family: 'Courier New', monospace;
}

.activity-log::-webkit-scrollbar {
    width: 4px;
}

.activity-log::-webkit-scrollbar-track {
    background: var(--bg-root-2);
    border-radius: 2px;
}

.activity-log::-webkit-scrollbar-thumb {
    background: var(--border-gold);
    border-radius: 2px;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 11px;
    line-height: 1.4;
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
    animation: slideInRight 0.3s ease;
}

.log-entry:hover {
    background: rgba(230, 199, 14, 0.1);
}

.log-time {
    color: var(--accent-gold);
    font-weight: 600;
    min-width: 60px;
    flex-shrink: 0;
}

.log-message {
    color: var(--text-muted);
    flex: 1;
}

.log-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-gold);
    animation: pulse 2s ease-in-out infinite;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-notification);
    pointer-events: none;
}

.notification {
    background: var(--surface);
    border: 2px solid rgba(230, 199, 14, 0.3);
    border-left: 4px solid var(--accent-gold);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-heavy);
    max-width: 350px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    transition: all var(--transition-medium);
}

.notification:hover {
    transform: translateX(-5px);
}

.notification.success {
    border-left-color: var(--state-success);
}

.notification.warning {
    border-left-color: var(--state-warn);
}

.notification.error {
    border-left-color: var(--state-danger);
}

.notification .close-btn {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 10px;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--surface);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
    z-index: var(--z-tooltip);
    opacity: 0;
    transform: translateY(5px);
    transition: all var(--transition-fast);
    border: 1px solid rgba(230, 199, 14, 0.3);
    box-shadow: var(--shadow-light);
}

.tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
    backdrop-filter: blur(5px);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-heavy);
    border: 2px solid rgba(230, 199, 14, 0.4);
    max-width: 500px;
    width: 90%;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid rgba(230, 199, 14, 0.2);
}

.modal-header h3 {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    transition: color var(--transition-fast);
}

.close-btn:hover {
    color: var(--state-danger);
}

.modal-body {
    padding: 20px;
}

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

.setting-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-root-2);
    border: 1px solid rgba(230, 199, 14, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(230, 199, 14, 0.2);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--bg-root) 0%, var(--bg-root-2) 100%);
    padding: 18px 30px;
    border-top: 2px solid var(--border-gold);
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    font-size: 13px;
    color: var(--text-muted);
    gap: 20px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 24px;
}

.footer-section:first-child {
    justify-content: flex-start;
    text-align: left;
}

.footer-section:last-child {
    justify-content: flex-end;
    text-align: right;
    gap: 12px;
}

.footer-section span {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

#client-count {
    color: var(--accent-gold);
    font-weight: 600;
}

.settings-btn {
    background: transparent;
    border: 1px solid rgba(230, 199, 14, 0.4);
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.settings-btn:hover {
    background: var(--accent-gold);
    color: var(--bg-root);
    border-color: var(--accent-gold);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(230, 199, 14, 0.3);
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes planeFly {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-30%, -60%) rotate(15deg); }
    50% { transform: translate(-50%, -40%) rotate(0deg); }
    75% { transform: translate(-70%, -60%) rotate(-15deg); }
}

@keyframes progressLoad {
    0% { width: 0%; }
    25% { width: 30%; }
    50% { width: 60%; }
    75% { width: 85%; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

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

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(20px); }
    100% { opacity: 1; transform: translateX(0); }
}

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

@keyframes lineGlow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-color); }
    50% { box-shadow: 0 0 15px var(--accent-color); }
}

@keyframes emergencyPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 51, 102, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(255, 51, 102, 0.6);
        transform: scale(1.02);
    }
}

@keyframes rotateBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); color: var(--accent-color); }
}

@keyframes speedPulse {
    0%, 100% { 
        transform: scale(1); 
        text-shadow: 0 0 5px rgba(229, 62, 62, 0.3);
    }
    50% { 
        transform: scale(1.02); 
        text-shadow: 
            0 0 8px rgba(229, 62, 62, 0.6),
            0 0 16px rgba(229, 62, 62, 0.4);
    }
}

@keyframes modalSlideIn {
    0% { opacity: 0; transform: translateY(-30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes emergencyTextGlow {
    0%, 100% { 
        text-shadow: 
            0 0 8px rgba(229, 62, 62, 0.6),
            0 0 16px rgba(229, 62, 62, 0.4),
            0 0 24px rgba(229, 62, 62, 0.2);
    }
    50% { 
        text-shadow: 
            0 0 12px rgba(229, 62, 62, 0.8),
            0 0 24px rgba(229, 62, 62, 0.6),
            0 0 36px rgba(229, 62, 62, 0.4);
    }
}

/* Emergency Modal Animations */
@keyframes emergencyModalFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes emergencyModalSlide {
    0% { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.8);
        filter: blur(10px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes emergencyWarningPulse {
    0%, 100% { 
        transform: scale(1);
        color: var(--state-danger);
        filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
    }
    50% { 
        transform: scale(1.1);
        color: #ff6b6b;
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8));
    }
}

@keyframes emergencyTextBlink {
    0%, 50% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

@keyframes countdownPulse {
    0%, 100% { 
        transform: scale(1);
        border-color: var(--state-danger);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.05);
        border-color: #ff4444;
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

@keyframes countdownRing {
    0% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    100% { 
        transform: rotate(360deg) scale(1.1);
        opacity: 0;
    }
}

@keyframes emergencyConfirmPulse {
    0% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-4px) scale(1.05); }
    100% { transform: translateY(-2px) scale(1); }
}

/* Responsive Design */
@media (min-width: 2400px) {
    .dashboard {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.5fr) minmax(340px, 420px);
        padding: 25px;
        grid-gap: 25px;
    }
}

/* Emergency Modal Responsive */
@media (max-width: 768px) {
    .emergency-modal-content {
        width: 95%;
        padding: 20px;
        margin: 20px;
    }
    
    .emergency-modal-header h2 {
        font-size: 20px;
    }
    
    .emergency-warning-icon {
        font-size: 36px;
    }
    
    .emergency-warning-text {
        padding: 15px;
    }
    
    .emergency-warning-text p {
        font-size: 14px;
    }
    
    .emergency-warning-text li {
        font-size: 13px;
    }
    
    .countdown-circle {
        width: 60px;
        height: 60px;
    }
    
    #countdown-number {
        font-size: 24px;
    }
    
    .emergency-countdown p {
        font-size: 14px;
    }
    
    .emergency-modal-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .emergency-btn-cancel,
    .emergency-btn-confirm {
        min-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .emergency-modal-content {
        width: 98%;
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
    }
    
    .emergency-modal-header h2 {
        font-size: 18px;
        line-height: 1.3;
    }
    
    .emergency-final-warning strong {
        font-size: 16px;
    }
    
    .countdown-circle {
        width: 50px;
        height: 50px;
    }
    
    #countdown-number {
        font-size: 20px;
    }
}

@media (min-width: 1920px) and (max-width: 2399px) {
    .dashboard {
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.3fr) minmax(340px, 420px);
    }
    
    .footer-content {
        padding: 0 40px;
        font-size: 14px;
    }
    
    .footer-section {
        min-height: 28px;
    }
    
    .settings-btn {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

@media (max-width: 1500px) {
    .dashboard {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(320px, 370px);
        grid-gap: 18px;
        padding: 18px;
    }
}

@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(300px, 360px);
        grid-gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 1200px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        min-height: auto;
        gap: 15px;
        padding: 15px;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        height: auto;
        min-height: auto;
    }
    
    .right-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 15px;
        height: auto;
    }
    
    .flight-path-card {
        height: 60vh;
        min-height: 400px;
    }
    
    .power-graph-card {
        min-height: 350px;
    }
    
    .footer {
        padding: 16px 25px;
    }
    
    .footer-content {
        font-size: 12px;
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .dashboard {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }
    
    .left-panel,
    .center-panel,
    .right-panel {
        height: auto;
    }
    
    .flight-path-card {
        height: 50vh;
    }
    
    .center-panel {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .telemetry-data .data-row {
        flex-direction: column;
    }
    
    .right-panel {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .connection-indicators {
        justify-content: center;
    }
    
    .footer {
        padding: 14px 20px;
    }
    
    .footer-content {
        font-size: 11px;
        gap: 14px;
    }
    
    .footer-section span {
        font-size: 11px;
    }
    
    .settings-btn {
        min-width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .dashboard {
        padding: 10px;
        grid-gap: 15px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .logo-text h1 {
        font-size: 16px;
    }
    
    .subtitle {
        font-size: 10px;
    }
    
    .flight-path-card,
    .power-graph-card,
    .about-card,
    .system-status-card,
    .activity-log-card {
        margin: 0;
    }
    
    .card-header,
    .about-content,
    .status-items,
    .activity-log {
        padding: 15px;
    }
    
    .emergency-cutoff {
        width: 100px;
        height: 100px;
        font-size: 10px;
    }
    
    .data-row {
        padding: 10px 15px;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .footer {
        padding: 16px 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .footer-section {
        justify-content: center !important;
        text-align: center !important;
    }
    
    .footer-section:last-child {
        flex-direction: column;
        gap: 8px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-bg: #000000;
        --secondary-bg: #111111;
        --card-bg: #222222;
        --text-primary: #ffffff;
        --border-color: #666666;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Warning/Alert Section - Like Screenshot */
.warning-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.1));
    border: 2px solid var(--warning-color);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
}

.warning-section::before {
    content: '⚠';
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(29, 78, 216, 0.9));
    color: var(--warning-color);
    padding: 8px 12px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

.warning-title {
    color: var(--warning-color);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.warning-content {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.warning-timestamp {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 8px;
    opacity: 0.8;
}

/* Screenshot-like Data Values */
.telemetry-value {
    color: var(--accent-color);
    font-size: 18px;
    font-weight: 700;
    text-shadow: none;
}

.telemetry-unit {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

/* Enhanced Golden Glow Effects */
.data-card:hover .telemetry-value {
    text-shadow: none;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Blue & Gold Navigation Buttons */
.nav-button, .map-control-btn {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.7), rgba(44, 82, 130, 0.8));
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
}

.nav-button:hover, .map-control-btn:hover {
    background: linear-gradient(135deg, rgba(74, 85, 104, 0.8), rgba(113, 128, 150, 0.85));
    box-shadow: 0 0 10px rgba(214, 158, 46, 0.2);
}

/* UAV Map Marker Styling - Enhanced Visibility */
.uav-marker {
    position: relative !important;
    z-index: 1000 !important;
    display: block !important;
    visibility: visible !important;
}

.uav-icon-container {
    position: relative !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, #d69e2e 0%, #b7791f 70%, #975a16 100%);
    border: 3px solid #ffffff;
    box-shadow: 
        0 0 15px rgba(214, 158, 46, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: uavFloat 3s ease-in-out infinite;
    z-index: 1000 !important;
    visibility: visible !important;
}

.uav-icon-container:hover {
    transform: scale(1.1);
    box-shadow: 
        0 0 25px rgba(214, 158, 46, 0.8),
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.uav-icon {
    font-size: 18px !important;
    color: #1a365d !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    z-index: 1001 !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* UAV pulse animation */
.uav-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid rgba(214, 158, 46, 0.6);
    border-radius: 50%;
    animation: uavPulse 2s ease-in-out infinite;
    z-index: 999; /* Lower than icon */
}

.uav-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 1px solid rgba(214, 158, 46, 0.3);
    border-radius: 50%;
    animation: uavPulse 2s ease-in-out infinite 0.5s;
}

/* Force visibility for Leaflet marker */
.leaflet-marker-icon.uav-marker {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
}

/* Ensure Font Awesome icons are loaded */
.fas.fa-plane {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    display: inline-block !important;
}

/* Animation keyframes */
@keyframes uavFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

@keyframes uavPulse {
    0% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.5;
    }
    100% { 
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
}

/* Chart Fallback Display */
.chart-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 24px;
    border: 2px solid var(--accent-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.fallback-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 200px;
}

.fallback-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.fallback-label {
    color: #e2e8f0;
    font-weight: 600;
    font-size: 14px;
}

.fallback-value {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 16px;
    font-family: 'Inter', monospace;
}

/* Home Marker Styling */
.home-marker {
    position: relative;
    z-index: var(--z-map-elements);
}

.home-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    border: 2px solid #ffffff;
    box-shadow: 
        0 0 10px rgba(56, 161, 105, 0.5),
        0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.home-icon-container:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 15px rgba(56, 161, 105, 0.7),
        0 4px 15px rgba(0, 0, 0, 0.4);
}

.home-icon-container i {
    font-size: 14px;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Map Marker Animations */
@keyframes uavFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

@keyframes uavPulse {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* Flight Path Line Enhancement */
.leaflet-interactive {
    stroke: #d69e2e !important;
    stroke-width: 3 !important;
    stroke-opacity: 0.8 !important;
    fill: none !important;
    filter: drop-shadow(0 0 3px rgba(214, 158, 46, 0.4));
}

/* Leaflet Map Overrides for Better Visibility */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.leaflet-marker-icon {
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

/* Enhanced Map Controls */
.leaflet-control-zoom a {
    background-color: rgba(26, 54, 93, 0.9) !important;
    color: #d69e2e !important;
    border: 1px solid #d69e2e !important;
}

.leaflet-control-zoom a:hover {
    background-color: rgba(44, 82, 130, 0.95) !important;
    color: #fcd34d !important;
}

/* Map Attribution Styling */
.leaflet-control-attribution {
    background-color: rgba(26, 54, 93, 0.8) !important;
    color: #cbd5e0 !important;
    font-size: 10px !important;
}

/* GPS Status Colors */
.gps-status.good {
    color: #38a169 !important;
}

.gps-status.poor {
    color: #d69e2e !important;
}

.gps-status.no-signal {
    color: #e53e3e !important;
}

/* =============================================================================
   CONTROL PANEL MODALS & INTERACTIONS
   ============================================================================= */

/* Updated Color Palette Variables */
:root {
    /* Updated Navy Colors */
    --navy-900: #0f2743;
    --navy-800: #123152;
    --card-bg: #0f2b46;
    
    /* Updated Accent Colors */
    --accent-yellow: #f3c623;
    --accent-amber: #f6a100;
    --danger-red: #ff3b5b;
    --success-green: #22c55e;
    --info-blue: #4aa3ff;
    
    /* Updated Text Colors */
    --text-primary: #e6eef7;
    --text-secondary: #9fb3c8;
    --focus-outline: #4aa3ff;
}

/* Emergency Status Label */
.emergency-status-label {
    margin-top: 8px;
    text-align: center;
    padding: 4px 8px;
    background: var(--danger-red);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    animation: emergencyStatusPulse 2s ease-in-out infinite;
}

@keyframes emergencyStatusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Modal Overlay */
.control-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 200ms ease;
}

.control-modal-overlay.show {
    opacity: 1;
}

/* Modal Container */
.control-modal {
    background: var(--card-bg);
    border: 1px solid var(--navy-800);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.98);
    transition: transform 200ms ease;
}

.control-modal-overlay.show .control-modal {
    transform: scale(1);
}

/* Modal Content */
.control-modal-content {
    padding: 32px;
    text-align: center;
}

.process-content {
    padding: 40px 32px;
}

/* Modal Icon */
.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 32px;
}

.emergency-icon-ring {
    background: linear-gradient(135deg, var(--danger-red), #ff6b8a);
    color: var(--text-primary);
    animation: emergencyIconPulse 2s ease-in-out infinite;
}

@keyframes emergencyIconPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 91, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 59, 91, 0);
    }
}

/* Modal Typography */
.control-modal h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.modal-warning {
    background: rgba(246, 161, 0, 0.1);
    border: 1px solid var(--accent-amber);
    border-radius: 8px;
    padding: 12px;
    margin: 16px 0;
}

.modal-warning small {
    color: var(--accent-amber);
    font-size: 13px;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

/* Button Styles */
.btn-ghost {
    background: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ghost:hover {
    transform: translateY(-2px);
    border-color: var(--text-primary);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(159, 179, 200, 0.2);
}

.btn-ghost:focus {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-red), #ff6b8a);
    border: none;
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #e63550, #ff5b7a);
    box-shadow: 0 6px 20px rgba(255, 59, 91, 0.3);
}

.btn-danger:focus {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-amber));
    border: none;
    color: var(--navy-900);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 198, 35, 0.3);
}

/* Process Content Styles */
.process-ring {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    position: relative;
}

.process-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.process-ring-bg {
    fill: none;
    stroke: var(--navy-800);
    stroke-width: 8;
}

.process-ring-progress {
    fill: none;
    stroke: url(#processGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 377;
    stroke-dashoffset: 377;
    animation: progressSpin 1200ms linear infinite;
}

@keyframes progressSpin {
    0% { 
        stroke-dashoffset: 377;
        transform: rotate(0deg);
    }
    50% {
        stroke-dashoffset: 188;
    }
    100% { 
        stroke-dashoffset: 377;
        transform: rotate(360deg);
    }
}

.process-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: var(--accent-yellow);
}

.process-text h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.process-text p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.signal-animation {
    margin: 24px 0;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.signal-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-amber) 20%, 
        var(--danger-red) 50%, 
        var(--accent-amber) 80%, 
        transparent 100%);
    animation: signalMove 900ms ease-in-out infinite;
}

@keyframes signalMove {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Success Animation Styles */
.success-content {
    text-align: center;
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--success-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-primary);
    animation: successBurst 700ms ease-out forwards;
}

@keyframes successBurst {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-yellow);
    border-radius: 50%;
    animation: particleFall 1000ms ease-out forwards;
}

@keyframes particleFall {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(100px) scale(0);
    }
}

.success-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Error Animation Styles */
.error-content {
    text-align: center;
}

.error-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: var(--danger-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-primary);
    animation: errorPulse 700ms ease-out;
}

@keyframes errorPulse {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* =============================================================================
   TEAM INFO PANEL
   ============================================================================= */

.team-info-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
}

.team-panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: auto;
}

.team-info-panel.show .team-panel-overlay {
    opacity: 1;
}

.team-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: var(--card-bg);
    border-left: 1px solid var(--navy-800);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 220ms ease;
    pointer-events: auto;
}

.team-info-panel.show .team-panel-content {
    transform: translateX(0);
}

/* Team Panel Header */
.team-panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--navy-800);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team-panel-header h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.panel-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-close-btn:hover {
    background: rgba(159, 179, 200, 0.1);
    color: var(--text-primary);
}

.panel-close-btn:focus {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}

/* Team Panel Body */
.team-panel-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.team-identity h4 {
    color: var(--accent-yellow);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.team-tagline {
    color: var(--text-secondary);
    font-style: italic;
    margin: 0 0 24px 0;
}

.team-focus,
.team-activities,
.team-contact {
    margin-bottom: 24px;
}

.team-focus h5,
.team-activities h5,
.team-contact h5 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.team-focus p,
.team-contact p {
    color: var(--text-secondary);
    margin: 0;
}

.team-activities ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-activities li {
    color: var(--text-secondary);
    padding: 4px 0 4px 20px;
    position: relative;
}

.team-activities li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-yellow);
    font-weight: 600;
}

/* Team Panel Footer */
.team-panel-footer {
    padding: 24px;
    border-top: 1px solid var(--navy-800);
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--navy-800);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transform: translateX(120%);
    transition: all 300ms ease;
    cursor: pointer;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--danger-red);
}

.toast.info {
    border-left: 4px solid var(--info-blue);
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-green);
}

.toast.error .toast-icon {
    color: var(--danger-red);
}

.toast.info .toast-icon {
    color: var(--info-blue);
}

.toast-content {
    flex: 1;
}

.toast-message {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 150ms ease;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .control-modal {
        max-width: 95%;
        margin: 0 10px;
    }
    
    .control-modal-content {
        padding: 24px;
    }
    
    .team-panel-content {
        width: 100%;
    }
    
    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
    
    .modal-actions,
    .success-actions {
        flex-direction: column;
    }
}

/* Focus Trap for Accessibility - Managed via JavaScript */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .control-modal-overlay,
    .control-modal,
    .team-panel-content,
    .team-panel-overlay,
    .toast,
    .emergency-icon-ring,
    .process-ring-progress,
    .signal-line,
    .success-icon,
    .particle {
        animation: none !important;
        transition: none !important;
    }
}
