/**
 * Leitstelle – Styles
 * @author Leon Pfaffe
 */

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #0ea5e9;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; min-height: 100vh; }
a { color: var(--accent); }
.error { color: #f87171; margin: 0.5rem 0; }
.success { color: var(--success); margin: 0.5rem 0; }

/* Auth */
.auth-page { max-width: 360px; margin: 2rem auto; padding: 1.5rem; }
.auth-page h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.auth-form label { display: block; margin-bottom: 0.75rem; }
.auth-form input { width: 100%; padding: 0.5rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; }
.auth-form button { width: 100%; padding: 0.6rem; background: var(--accent); border: 0; color: #fff; font-weight: 600; border-radius: 6px; cursor: pointer; margin-top: 0.5rem; }
.auth-form button:hover { filter: brightness(1.1); }

/* Nav */
.nav { background: var(--surface); padding: 0.6rem 1rem; display: flex; gap: 1rem; align-items: center; border-bottom: 1px solid var(--border); }
.nav a { text-decoration: none; }
.nav .user { margin-left: auto; color: var(--muted); font-size: 0.9rem; }

/* Dashboard */
.dashboard { padding: 1rem; max-width: 1200px; margin: 0 auto; }
.dashboard h1 { font-size: 1.4rem; margin-bottom: 1rem; }

/* Status-Grid */
.status-section { margin-bottom: 1.5rem; }
.status-section h2 { font-size: 1rem; color: var(--muted); margin-bottom: 0.5rem; }
.status-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.status-btn { padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.85rem; white-space: nowrap; transition: transform .1s, box-shadow .1s; }
.status-btn:hover { transform: scale(1.02); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* Kollegen-Status (Tabelle: Name, Funkname, Status mit Farbe) */
.colleagues { background: var(--surface); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--border); }
.colleagues h2 { font-size: 1rem; margin-bottom: 0.75rem; }
.colleagues-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.colleagues-table th, .colleagues-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.colleagues-table th { color: var(--muted); font-weight: 600; }
.colleagues-table .col-name { font-weight: 600; }
.colleagues-table .col-ruf { color: var(--muted); }
.colleagues-table .col-status { border-radius: 4px; padding: 0.35rem 0.6rem !important; }

/* Funkkanäle */
.channels-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.channels-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.channels-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.channels-mine .label, .send-on .label { color: var(--muted); font-size: 0.9rem; }
.channels-mine ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.channels-mine li { margin-bottom: 0.35rem; }
.channel-item { display: inline-flex; align-items: center; gap: 0.5rem; }
.channel-item .name { font-weight: 600; }
.channel-item .speaker-info { font-size: 0.8rem; color: var(--warn); }
.channel-item .btn-voice { margin-left: 0.5rem; padding: 0.25rem 0.5rem; font-size: 0.8rem; border-radius: 4px; cursor: pointer; border: 1px solid var(--accent); background: rgba(14, 165, 233, 0.2); color: var(--accent); }
.channel-item .btn-voice:hover { background: rgba(14, 165, 233, 0.35); }
.channel-item .btn-send, .channel-item .btn-leave { margin-left: 0.5rem; padding: 0.2rem 0.5rem; font-size: 0.8rem; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.channel-item .btn-send:hover, .channel-item .btn-leave:hover { border-color: var(--accent); }
.channel-item .btn-send[data-id].active { background: var(--accent); color: #fff; border-color: var(--accent); }
.channels-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; }
.channels-actions label { margin: 0; }
.channels-actions select, .channels-actions input[type="text"] { padding: 0.4rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; margin-left: 0.25rem; }
.send-on { margin: 0.5rem 0 0; }
.release-btn { margin-left: 0.5rem; padding: 0.25rem 0.6rem; background: var(--warn); border: 0; color: #fff; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }

/* Funk-Übersicht */
.funk-overview-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.funk-overview-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.funk-overview-table-wrap { overflow-x: auto; margin-bottom: 0.5rem; }
.funk-overview-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.funk-overview-table th, .funk-overview-table td { padding: 0.4rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); }
.funk-overview-table th { color: var(--muted); font-weight: 600; }
.funk-overview-table .speaker-name { color: var(--warn); }
.funk-overview-table .no-speaker { color: var(--muted); font-style: italic; }
.funk-overview-you { font-size: 0.9rem; color: var(--muted); margin: 0; }
.release-btn-small { padding: 0.2rem 0.5rem; font-size: 0.8rem; }

/* Live-Voice PTT */
.voice-ptt-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.voice-ptt-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.mic-select-wrap { margin-bottom: 0.5rem; }
.mic-select-wrap label { font-size: 0.9rem; color: var(--muted); }
.mic-select-wrap select { margin-left: 0.35rem; padding: 0.35rem 0.5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; min-width: 200px; }
.ptt-meter-wrap { margin-bottom: 0.5rem; }
.ptt-meter-caption { font-size: 0.75rem; color: var(--muted); display: block; margin-bottom: 0.2rem; }
.ptt-meter { height: 28px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; position: relative; overflow: hidden; }
.ptt-meter-needle { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, var(--accent), var(--danger)); border-radius: 5px; transition: width 0.05s ease-out; }
.ptt-meter.sending .ptt-meter-needle { transition: width 0.05s ease-out; }
.ptt-meter-label { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); opacity: 0; transition: opacity 0.2s; }
.ptt-meter.sending .ptt-meter-label { opacity: 1; color: var(--danger); }
.ptt-btn { display: block; width: 100%; max-width: 320px; margin: 0.5rem 0; padding: 1.2rem 1.5rem; font-size: 1.1rem; font-weight: 600; background: var(--surface); border: 3px solid var(--border); border-radius: 12px; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.ptt-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(14, 165, 233, 0.15); }
.ptt-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ptt-btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; }
.ptt-status { font-size: 0.85rem; color: var(--muted); margin-left: 0.5rem; }

/* Funken */
.funken-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.funken-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.funken-templates { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.funken-templates .label { color: var(--muted); font-size: 0.85rem; margin-right: 0.25rem; }
.template-btn { padding: 0.25rem 0.5rem; font-size: 0.8rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 4px; cursor: pointer; }
.template-btn:hover { border-color: var(--accent); }
.funken-input { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.funken-input input { flex: 1; padding: 0.5rem; background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 6px; }
.funken-input button { padding: 0.5rem 1rem; background: var(--accent); border: 0; color: #fff; border-radius: 6px; cursor: pointer; }
.funken-log { max-height: 220px; overflow-y: auto; font-family: monospace; font-size: 0.85rem; }
.funken-msg { padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.funken-msg .channel-tag { font-size: 0.75rem; color: var(--muted); margin-right: 0.5rem; }
.funken-msg .who { color: var(--accent); font-weight: 600; }
.funken-msg .time { color: var(--muted); font-size: 0.75rem; }

/* Mein Status */
.my-status { background: var(--surface); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; border-left: 4px solid var(--accent); }
.my-status .current { font-size: 0.9rem; color: var(--muted); }
.my-status .current strong { color: var(--text); }

/* Profil */
.profil-form { max-width: 480px; }
.profil-form label { display: block; margin-bottom: 0.5rem; }
.profil-form input, .profil-form textarea { width: 100%; padding: 0.5rem; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 6px; }
.profil-form textarea { min-height: 80px; resize: vertical; }
.profil-form .hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.profil-form button { padding: 0.5rem 1rem; background: var(--accent); border: 0; color: #fff; border-radius: 6px; cursor: pointer; margin-top: 0.5rem; }
