:root {
    --bg-dark: #0b0f19;
    --bg-panel: #131a2a;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.led { width: 12px; height: 12px; border-radius: 50%; }
.led.off { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.led.on { background: var(--success); box-shadow: 0 0 10px var(--success); }

/* Botões */
button {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent-cyan); color: #000; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 15px rgba(6, 182, 212, 0.4); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.05); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0; /* Para o scroll funcionar internamente */
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

h2 { font-size: 1.4rem; color: #fff; }
h3 { font-size: 1.1rem; color: var(--text-muted); margin-top: 10px; }

/* Controles */
.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.control-card {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.control-card label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

input, select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    outline: none;
}

.buttons-row {
    display: flex;
    gap: 10px;
}

/* Telemetria */
.telemetry {
    display: flex;
    gap: 15px;
}

.telemetry-box {
    flex: 1;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), transparent);
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.telemetry-box span { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; }
.telemetry-box strong { font-family: 'Fira Code', monospace; font-size: 1.8rem; margin-top: 5px; }

.text-cyan { color: var(--accent-cyan); text-shadow: 0 0 10px rgba(6, 182, 212, 0.4); }
.text-pink { color: var(--accent-pink); text-shadow: 0 0 10px rgba(236, 72, 153, 0.4); }

/* Log Console */
.serial-monitor {
    flex: 1;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    overflow-y: auto;
    max-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log { color: #fff; }
.log.rx { color: var(--success); }
.log.tx { color: var(--accent-cyan); }
.log.system { color: var(--text-muted); font-style: italic; }

/* Mapa */
.map-header { display: flex; justify-content: space-between; align-items: center; }
.canvas-wrapper {
    flex: 1;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.1); /* Brilho de radar */
}

canvas {
    max-width: 100%;
    max-height: 100%;
}

.helper-text { font-size: 0.85rem; color: var(--text-muted); text-align: center; }

/* Controles Manuais */
.manual-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}
.manual-controls div { display: flex; gap: 5px; }
.manual-controls button { width: 50px; height: 50px; justify-content: center; font-size: 1.2rem; background: rgba(255,255,255,0.1); }
.manual-controls button:active { background: var(--accent-cyan); color: #000; }
