* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
}

.header {
    background: #2d2d2d;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* hamburger button (hidden on desktop) */
.hamburger {
    display: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    width: 40px;
    height: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px;
    margin-right: 8px;
    color: #fff;
}
.hamburger span { display: block; height: 4px; background: #fff; margin: 3px 0; border-radius: 2px; width: 22px; }

.title {
    font-size: 24px;
    font-weight: bold;
    color: #ff6b6b;
}

.status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4ecdc4;
    animation: pulse 2s infinite;
}

.status-indicator.offline {
    background: #ff6b6b;
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

    .info-panel {
        background: #2d2d2d;
        padding: 20px;
        margin: 0;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
    align-items: start;
}

.stat-card {
    background: #353535;
    padding: 8px 10px;
    border-radius: 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #ff6b6b;
    margin: 0;
    line-height: 1;
}

/* zero state (calm green) for cases when count == 0 */
.stat-number.zero {
    color: #7fbf7f;
}

.stat-label {
    color: #cccccc;
    font-size: 12px;
    margin-top: 0;
}

/* Two-column layout: map (flex:1) on the left, info panel fixed on the right */
.main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    padding: 20px;
}

.info-panel {
    flex: 0 0 360px;
    max-width: 380px;
    padding-top: 8px;
}

#map {
    flex: 1 1 auto;
    min-height: 70vh;
    height: calc(100vh - 160px);
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1;
}

/* Responsive: stack vertically on small screens
   Map should appear above the info panel on mobile, so reverse column order. */
@media (max-width: 900px) {
    .main { flex-direction: column-reverse; padding: 12px; }
    .info-panel { flex: none; width: 100%; max-width: none; margin-top: 12px; margin-bottom: 0; }
    #map { height: 60vh; min-height: 50vh; width: 100%; order: -1; }
}

.drone-list {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px; /* visual breathing room for scrollbar */
}

.drone-item {
    background: #343434;
    margin: 6px 0;
    padding: 8px 10px;
    border-radius: 6px;
    border-left: 3px solid #ff6b6b;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.drone-item.zero {
    border-left-color: #7fbf7f;
}

/* main text block stretches */
.drone-item > .drone-location {
    font-weight: 600;
    color: #4ecdc4;
    margin: 0;
    line-height: 1.1;
    flex: 1 1 auto;
    font-size: 13px;
}

/* count and time grouped on the right */
.drone-count {
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 700;
    min-width: 52px;
    text-align: right;
}

.drone-count.zero {
    color: #7fbf7f;
}

.drone-time {
    color: #999;
    font-size: 11px;
    margin-left: 8px;
    white-space: nowrap;
}

/* On small screens, stack content for readability */
@media (max-width: 520px) {
    .drone-item { flex-direction: column; align-items: stretch; gap:6px; }
    .drone-count { text-align: left; min-width: initial; }
    .drone-time { margin-left:0; }
}

.last-update {
    text-align: center;
    color: #999;
    margin-top: 10px;
}

.warning-banner {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    margin: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(255,107,107,0.3);
}

/* Mobile adjustments: smaller header and banner heights, show hamburger */
@media (max-width: 520px) {
    .header { padding: 8px 12px; }
    .title { font-size: 16px; }
    /* hide the small logo image in the title on mobile to save space */
    .title img { display: none !important; }
    .warning-banner { padding: 8px 10px; margin: 10px; font-size: 13px; }
    .hamburger { display: flex; order: -1; margin-right: 12px; margin-left: 6px; }
    /* hide info-panel by default on mobile; toggle will add .open */
    .info-panel { display: none !important; }
    .info-panel.open { display: block !important; position: fixed; top: 75px; right: 8px; left: 8px; z-index: 1002; max-height: calc(100vh - 70px); overflow: auto; border-radius: 8px; }
    /* ensure map sits below header and info panel toggles */
    .main { padding: 8px; }

    /* Compact status area on mobile: put indicator and text in one row, smaller fonts */
    .status { gap: 8px; align-items: center; }
    .status > div { display: flex; align-items: center; gap: 8px; }
    #statusText { font-size: 13px; font-weight: 600; }
    #lastUpdateTime { font-size: 12px; color: #cfcfcf; }
    .status-indicator { width: 10px; height: 10px; }
}

/* Ensure hamburger/button is hidden on larger screens (desktop) */
@media (min-width: 521px) {
    #btnToggleInfo { display: none !important; }
}
