/* ===== CSS VARIABLES - THEME SYSTEM ===== */
:root {
    /* Command Theme (DEFAULT) - Reader-friendly dark */
    --bg: #0f1419;
    --panel-bg: #1e252d;
    --panel-border: #5a9fb0;
    --text: #e8ecef;
    --text-muted: #9ba8b3;
    --accent: #00d9ff;
    --accent-hover: #33e0ff;
    --success: #7dd87f;
    --warning: #f4a261;
    --error: #e76f6f;
    --scrollbar-track: #0d0518;
    --scrollbar-thumb: #5a9fb0;
    --input-bg: #16191e;
    --modal-bg: #1e252d;
    --overlay-bg: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] {
    /* Light Theme - Daylight mode */
    --bg: #f5f7fa;
    --panel-bg: #ffffff;
    --panel-border: #3a7a8a;
    --text: #1a1f26;
    --text-muted: #64748b;
    --accent: #0088aa;
    --accent-hover: #00a0cc;
    --success: #2e7d32;
    --warning: #d84315;
    --error: #c62828;
    --scrollbar-track: #e2e8f0;
    --scrollbar-thumb: #3a7a8a;
    --input-bg: #f0f2f5;
    --modal-bg: #ffffff;
    --overlay-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="high-contrast"] {
    /* High Contrast - Pure black/white, WCAG AAA */
    --bg: #000000;
    --panel-bg: #000000;
    --panel-border: #ffffff;
    --text: #ffffff;
    --text-muted: #cccccc;
    --accent: #00ffff;
    --accent-hover: #66ffff;
    --success: #00ff00;
    --warning: #ffaa00;
    --error: #ff3333;
    --scrollbar-track: #000000;
    --scrollbar-thumb: #ffffff;
    --input-bg: #000000;
    --modal-bg: #000000;
    --overlay-bg: rgba(0, 0, 0, 0.95);
}

[data-theme="amber-terminal"] {
    /* Amber Terminal - Classic terminal aesthetic */
    --bg: #0d0a00;
    --panel-bg: #1a1400;
    --panel-border: #ffb000;
    --text: #ffb000;
    --text-muted: #cc8800;
    --accent: #ffd042;
    --accent-hover: #ffe066;
    --success: #ffb000;
    --warning: #ff8800;
    --error: #ff4400;
    --scrollbar-track: #0d0a00;
    --scrollbar-thumb: #ffb000;
    --input-bg: #0d0a00;
    --modal-bg: #1a1400;
    --overlay-bg: rgba(13, 10, 0, 0.9);
}

[data-theme="red-black"] {
    /* Red & Black - Red accent, near-white body */
    --bg: #000000;
    --panel-bg: #0f0000;
    --panel-border: #ff0000;
    --text: #f0f0f0;
    --text-muted: #b0b0b0;
    --accent: #ff0000;
    --accent-hover: #ff3333;
    --success: #ff0000;
    --warning: #ff6600;
    --error: #ff0000;
    --scrollbar-track: #000000;
    --scrollbar-thumb: #ff0000;
    --input-bg: #000000;
    --modal-bg: #0f0000;
    --overlay-bg: rgba(0, 0, 0, 0.95);
}

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* Monospace for data readouts only */
.monospace,
.coord-readout,
.time-readout,
.callsign,
#time-readout,
.aircraft-callsign {
    font-family: 'Courier New', 'Consolas', monospace;
}

#root {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    padding: 4px;
    gap: 4px;
}

/* ===== HEADER ===== */
.header {
    background: var(--panel-bg);
    color: var(--text);
    padding: 8px 16px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.header-title {
    color: var(--accent);
    font-weight: bold;
    letter-spacing: 0.5px;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

.status-dot.offline {
    background: var(--error);
    box-shadow: 0 0 8px var(--error);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switcher-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: bold;
}

.theme-switcher select {
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    min-height: 36px;
}

.theme-switcher select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.2);
}

/* ===== MAIN GRID ===== */
.main-grid {
    display: grid;
    grid-template-columns: 260px 1fr 360px;
    gap: 4px;
    overflow: hidden;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.center-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== PANELS ===== */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.panel-flex {
    flex: 1;
}

.panel-map {
    flex: 1;
}

.panel-detail {
    height: 220px;
    flex-shrink: 0;
}

.panel-chat {
    display: flex;
    flex-direction: column;
}

.panel-photos {
    height: 130px;
    flex-shrink: 0;
}

.panel-title {
    color: var(--accent);
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--panel-border);
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-nav {
    display: flex;
    gap: 6px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.panel-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.empty-state {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
    text-align: center;
}

.empty-state-photos {
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
    text-align: center;
    width: 100%;
}

/* ===== MAP ===== */
#map {
    width: 100%;
    height: 100%;
    background: #000;
}

.leaflet-container {
    background: #000;
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    background: var(--panel-bg);
    color: var(--text);
    border: 1px solid var(--panel-border);
    font-family: inherit;
    font-size: 14px;
}

.leaflet-popup-tip {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
}

.leaflet-popup-content {
    margin: 12px;
}

.popup-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}

.popup-label {
    color: var(--accent);
    min-width: 70px;
    font-weight: 600;
}

/* Mode Indicator */
.mode-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mode-badge {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mode-badge.live {
    color: var(--success);
    border-color: var(--success);
}

.mode-badge.rewind {
    color: var(--accent);
    border-color: var(--accent);
}

/* Rewind Controls */
.rewind-controls {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    z-index: 1000;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.rewind-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.rewind-controls select {
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 6px 8px;
    font-family: inherit;
    font-size: 13px;
    border-radius: 4px;
}

.rewind-controls select:focus {
    outline: none;
    border-color: var(--accent);
}

.rewind-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
}

.rewind-controls input[type="range"]::-webkit-slider-track {
    background: var(--panel-border);
    height: 6px;
    border-radius: 3px;
}

.rewind-controls input[type="range"]::-moz-range-track {
    background: var(--panel-border);
    height: 6px;
    border-radius: 3px;
}

.rewind-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    background: var(--accent);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-top: -5px;
    cursor: pointer;
}

.rewind-controls input[type="range"]::-moz-range-thumb {
    background: var(--accent);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.rewind-controls input[type="range"]:focus::-webkit-slider-thumb {
    background: var(--accent-hover);
    box-shadow: 0 0 8px var(--accent);
}

.rewind-controls input[type="range"]:focus::-moz-range-thumb {
    background: var(--accent-hover);
    box-shadow: 0 0 8px var(--accent);
}

#time-readout {
    color: var(--accent);
    font-weight: bold;
}

.rewind-controls label {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ===== SIGHTING TYPES ===== */
.type-button {
    font-size: 14px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--panel-border);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
}

.type-button:hover {
    background: var(--input-bg);
}

.type-button.active {
    background: var(--input-bg);
    border-left: 3px solid var(--accent);
}

.type-icon {
    margin-right: 8px;
    font-size: 16px;
}

.type-count {
    color: var(--success);
    font-weight: bold;
    font-size: 15px;
}

/* Aircraft Legend */
.aircraft-legend {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--panel-border);
    font-size: 13px;
}

.legend-title {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    color: var(--text);
}

.legend-icon {
    font-size: 14px;
}

/* ===== FLIGHTS ===== */
.stat-large {
    font-size: 48px;
    font-weight: bold;
    color: var(--accent);
    text-align: center;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ===== REPORTS LIST ===== */
.report-row {
    font-size: 14px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--panel-border);
    cursor: pointer;
    transition: background 0.2s;
    min-height: 44px;
}

.report-row:hover {
    background: var(--input-bg);
}

.report-row.focused {
    background: var(--input-bg);
    border-left: 3px solid var(--accent);
}

.report-title {
    font-weight: bold;
    color: var(--accent);
    margin-bottom: 4px;
}

.report-location {
    color: var(--text-muted);
    font-size: 13px;
}

.report-time {
    color: var(--success);
    font-size: 12px;
}

/* ===== DETAIL PANEL ===== */
.detail-grid {
    display: grid;
    gap: 8px;
    font-size: 14px;
}

.detail-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 14px;
}

.detail-label {
    color: var(--accent);
    min-width: 90px;
    flex-shrink: 0;
    font-weight: 600;
}

.detail-value {
    color: var(--text);
    word-break: break-word;
}

.type-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    background: var(--input-bg);
    color: var(--accent);
    font-weight: bold;
    display: inline-block;
    border: 1px solid var(--accent);
}

.status-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    background: var(--input-bg);
    color: var(--success);
    font-weight: bold;
    display: inline-block;
    border: 1px solid var(--success);
}

.aircraft-match {
    margin-top: 8px;
    padding: 10px;
    background: var(--input-bg);
    border-left: 3px solid var(--accent);
    font-size: 14px;
    border-radius: 4px;
}

.aircraft-match-label {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 4px;
}

.aircraft-callsign {
    color: var(--success);
    font-weight: bold;
}

/* Confirmation Button */
.confirm-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-confirm {
    background: var(--panel-bg);
    border: 2px solid var(--success);
    color: var(--success);
    padding: 8px 16px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-confirm:hover {
    background: var(--success);
    color: var(--bg);
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.confirm-count {
    font-size: 14px;
    color: var(--success);
}

.detail-photo {
    margin-top: 10px;
    cursor: pointer;
}

.detail-photo img {
    max-width: 100%;
    max-height: 160px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

/* ===== CHAT ===== */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 10px;
    padding-right: 6px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.chat-message {
    font-size: 14px;
    padding: 10px;
    background: var(--input-bg);
    margin-bottom: 6px;
    border-left: 3px solid var(--accent);
    border-radius: 4px;
}

.chat-message-name {
    color: var(--accent);
    font-weight: bold;
    margin-bottom: 4px;
}

.chat-message-text {
    color: var(--text);
}

.chat-message-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

.chat-input-container {
    display: flex;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--panel-border);
}

.chat-input-container input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    border-radius: 4px;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.2);
}

.btn-chat {
    background: var(--accent);
    border: none;
    color: var(--bg);
    padding: 10px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s;
    min-height: 44px;
}

.btn-chat:hover {
    background: var(--accent-hover);
}

.chat-rate-limit {
    color: var(--error);
    font-size: 14px;
    padding: 8px;
    background: var(--input-bg);
    border-left: 3px solid var(--error);
    margin-top: 6px;
    border-radius: 4px;
}

/* ===== PHOTO STRIP ===== */
.photo-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0;
}

.photo-strip::-webkit-scrollbar {
    height: 6px;
}

.photo-strip::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.photo-strip::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.photo-thumb {
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-thumb:hover {
    transform: scale(1.05);
}

.photo-thumb img {
    height: 90px;
    width: 135px;
    object-fit: cover;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
}

.photo-thumb-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--accent);
    border: none;
    color: var(--bg);
    padding: 10px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s;
    min-height: 44px;
}

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

.btn-secondary {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    color: var(--accent);
    padding: 10px 18px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-secondary:hover {
    background: var(--input-bg);
    border-color: var(--accent);
}

.btn-small {
    background: var(--accent);
    border: none;
    color: var(--bg);
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    min-height: 36px;
}

.btn-nav {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    color: var(--accent);
    padding: 6px 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    min-height: 36px;
}

.btn-nav:hover {
    background: var(--input-bg);
    border-color: var(--accent);
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-notification {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 6px 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
    min-height: 32px;
}

.btn-notification:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 9998;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--modal-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    z-index: 9999;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
}

.modal-header {
    background: var(--input-bg);
    color: var(--accent);
    padding: 16px 20px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent-hover);
}

.modal-content {
    padding: 20px;
    overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--accent);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 10px;
    font-family: inherit;
    font-size: 14px;
    border-radius: 4px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.2);
}

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

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 40px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.lightbox-close:hover {
    color: var(--accent-hover);
}

.lightbox-content img {
    max-width: 100%;
    max-height: calc(90vh - 120px);
    border: 2px solid var(--panel-border);
    border-radius: 4px;
}

.lightbox-info {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 16px;
    margin-top: 16px;
    font-size: 14px;
    border-radius: 4px;
}

.lightbox-info-row {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.lightbox-info-label {
    color: var(--accent);
    min-width: 120px;
    font-weight: 600;
}

.lightbox-info-value {
    color: var(--text);
}

/* ===== HAMBURGER MENU ===== */
.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 24px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Help button */
.btn-help {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    border: none;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-help:hover {
    background: var(--accent-hover);
}

/* ===== MOBILE MENU ===== */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--panel-bg);
    border-right: 1px solid var(--panel-border);
    z-index: 2001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--panel-border);
    color: var(--accent);
    font-weight: bold;
    font-size: 16px;
    letter-spacing: 1px;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 6px;
}

.mobile-menu-item {
    background: var(--input-bg);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 18px;
    text-align: left;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    min-height: 56px;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: var(--panel-bg);
    border-color: var(--accent);
}

/* ===== MY LOCATION BUTTON ===== */
.my-location-btn {
    position: absolute;
    bottom: 170px;
    right: 12px;
    width: 48px;
    height: 48px;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 50%;
    color: var(--accent);
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.my-location-btn:hover {
    background: var(--accent);
    color: var(--bg);
    transform: scale(1.05);
}

.my-location-btn:active {
    transform: scale(0.95);
}

.my-location-btn.locating {
    animation: pulse-location 1s infinite;
}

@keyframes pulse-location {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(0, 217, 255, 0);
    }
}

/* User location marker on map - draggable */
.user-location-marker {
    width: 24px;
    height: 24px;
    background: var(--success);
    border: 4px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(125, 216, 127, 0.7);
    cursor: move;
    animation: pulse-marker 2s infinite;
}

@keyframes pulse-marker {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.85;
    }
}

/* Location coordinate readout */
.location-readout {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text);
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: none;
}

.location-readout.active {
    display: block;
}

/* ===== TUTORIAL OVERLAY ===== */
.tutorial-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tutorial-overlay.active {
    display: flex;
}

.tutorial-card {
    background: var(--modal-bg);
    border: 2px solid var(--panel-border);
    border-radius: 10px;
    max-width: 550px;
    width: 100%;
    padding: 28px;
    position: relative;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.tutorial-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.tutorial-content {
    color: var(--text);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 24px;
    min-height: 140px;
}

.tutorial-content h3 {
    color: var(--accent);
    font-size: 20px;
    margin-bottom: 14px;
}

.tutorial-progress {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
}

.tutorial-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: background 0.2s;
}

.tutorial-progress-dot.active {
    background: var(--accent);
}

.tutorial-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tutorial-nav {
    display: flex;
    gap: 10px;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Tablet breakpoint: 768px - 1024px */
@media screen and (max-width: 1024px) and (min-width: 768px) {
    .main-grid {
        grid-template-columns: 220px 1fr 300px;
    }

    .header-title {
        font-size: 13px;
    }

    .header-status {
        gap: 12px;
    }

    .status-indicator {
        font-size: 12px;
    }
}

/* Mobile breakpoint: < 768px */
@media screen and (max-width: 767px) {
    body {
        overflow: auto;
        height: auto;
        font-size: 14px;
    }

    #root {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        padding: 3px;
        gap: 3px;
    }

    /* Show hamburger menu and help button on mobile */
    .hamburger-btn {
        display: flex;
    }

    .btn-help {
        display: block;
    }

    /* Header - compact on mobile */
    .header {
        flex-direction: row;
        gap: 8px;
        padding: 10px;
        align-items: center;
    }

    .header-left {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    .header-title {
        font-size: 11px;
        flex: 1;
    }

    .header-status {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 11px;
    }

    .status-indicator {
        font-size: 11px;
    }

    /* Theme switcher - show in mobile menu instead */
    .theme-switcher {
        display: none;
    }

    /* Main grid - stack vertically on mobile */
    .main-grid {
        display: flex;
        flex-direction: column;
        gap: 3px;
        overflow: visible;
    }

    /* Map panel - give it a fixed height on mobile */
    .panel-map {
        height: 420px !important;
        min-height: 420px;
        order: 1;
    }

    #map {
        height: 100% !important;
    }

    /* Mode indicator - adjust for mobile */
    .mode-indicator {
        top: 10px;
        left: 10px;
        right: auto;
    }

    /* Rewind controls - stack better on mobile */
    .rewind-controls {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
        gap: 8px;
    }

    .rewind-row {
        flex-direction: column;
        gap: 8px;
    }

    .rewind-row label {
        width: 100%;
    }

    #time-slider {
        width: 100%;
    }

    #time-readout {
        text-align: left;
        min-width: auto;
    }

    /* Detail panel */
    .panel-detail {
        height: auto !important;
        min-height: 140px;
        order: 2;
    }

    /* Left column panels */
    .left-column {
        order: 3;
        gap: 3px;
    }

    /* Sighting types - make more compact */
    .panel:has(#sighting-types) {
        max-height: 220px;
    }

    /* Flights panel - compact */
    .panel:has(#flights-panel) {
        max-height: 160px;
    }

    /* Reports list */
    .panel:has(#reports-list) {
        max-height: 320px;
    }

    /* Right column - chat */
    .panel-chat {
        order: 4;
        height: 320px;
        min-height: 320px;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
    }

    /* Photo strip */
    .panel-photos {
        order: 5;
        height: 140px !important;
    }

    /* Touch targets - minimum 44px */
    button,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-nav,
    .btn-chat,
    .btn-notification,
    .type-button,
    .report-row {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .btn-small {
        min-height: 40px;
        padding: 10px 14px;
    }

    /* Report button */
    #report-btn {
        width: 100%;
        margin-top: 8px;
    }

    /* Chat input - stack on very small screens */
    .chat-input-container {
        flex-direction: column;
        gap: 8px;
    }

    #chat-name,
    #chat-message {
        width: 100%;
        min-height: 48px;
        padding: 12px;
        font-size: 14px;
    }

    #chat-send-btn {
        width: 100%;
    }

    /* Modal - full screen on mobile */
    .modal {
        width: 95%;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content {
        padding: 16px;
    }

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

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 12px;
        min-height: 48px;
    }

    .form-group textarea {
        min-height: 110px;
    }

    /* Panel content - adjust padding */
    .panel-content {
        padding: 6px;
    }

    /* Legend - more compact on mobile */
    .aircraft-legend {
        font-size: 12px;
    }

    .legend-item {
        padding: 4px 0;
    }

    /* Photo strip - scrollable */
    .photo-strip {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Notification button in header */
    .btn-notification {
        min-height: 36px;
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Panel navigation buttons */
    .panel-nav .btn-nav {
        min-height: 36px;
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Ensure no horizontal scroll */
    * {
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    /* Location readout on mobile */
    .location-readout {
        bottom: 200px;
        font-size: 11px;
    }
}

/* Very small mobile: < 400px */
@media screen and (max-width: 399px) {
    .header-title {
        font-size: 10px;
    }

    .header-status {
        font-size: 10px;
    }

    .panel-map {
        height: 380px !important;
        min-height: 380px;
    }

    button,
    .btn {
        font-size: 13px;
    }
}
