/* ==========================================================================
   F1 Pit-Wall Team Radio Telemetry Console
   ========================================================================== */

.f1-radio-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  font-family: var(--font-mono);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  pointer-events: auto;
}

.f1-radio-wrapper.is-active {
  z-index: 99995;
}

.f1-radio-wrapper * {
  box-sizing: border-box;
}

/* Floating Pit Radio Launcher */
.f1-radio-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: block;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.f1-radio-trigger:hover {
  transform: translateY(-2px);
}

.f1-radio-trigger:active {
  transform: translateY(1px) scale(0.98);
}

.f1-trigger-bezel {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #181d24 0%, #0d1014 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 8px 16px 8px 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.f1-trigger-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.f1-trigger-led.is-connected,
.f1-trigger-led.is-live {
  background: var(--green);
}

.f1-trigger-led.is-receiving {
  background: var(--red);
}

.f1-trigger-led.is-transmitting {
  background: #00e5ff;
}

.f1-trigger-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.f1-trigger-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.f1-trigger-icon {
  font-size: 14px;
  line-height: 1;
}

.f1-trigger-title {
  font-family: var(--font-hero);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.f1-trigger-sub {
  font-size: 9px;
  color: var(--slate);
  letter-spacing: 0.05em;
}

.f1-trigger-ptt-hint {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffffff;
  background: #e10600;
  padding: 3px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

/* ==========================================================================
   Expanded Telemetry Console
   ========================================================================== */

.f1-radio-console {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  max-height: min(450px, 68vh);
  z-index: 9995;
}

.f1-radio-console[hidden] {
  display: none !important;
}

.f1-console-shell {
  background: #0d1015;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85);
}

.f1-console-inner {
  background: linear-gradient(180deg, #11151c 0%, #080a0d 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(446px, calc(68vh - 4px));
  overflow-y: auto;
}

/* Console Header */
.f1-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.f1-head-channel {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.f1-head-badge {
  font-family: var(--font-hero);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.f1-head-freq {
  font-size: 9px;
  color: var(--slate);
  letter-spacing: 0.04em;
}

.f1-head-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 3px;
}

.f1-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.f1-head-status.is-connected .f1-status-dot,
.f1-head-status.is-live .f1-status-dot {
  background: var(--green);
}

.f1-head-status.is-receiving .f1-status-dot {
  background: var(--red);
}

.f1-head-status.is-transmitting .f1-status-dot {
  background: #00e5ff;
}

.f1-status-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--bone);
  text-transform: uppercase;
}

.f1-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.f1-head-btn {
  all: unset;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  color: var(--slate);
  font-size: 13px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.f1-head-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.f1-head-close {
  font-size: 18px;
  line-height: 1;
}

/* Settings Drawer */
.f1-console-settings {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.f1-console-settings[hidden] {
  display: none !important;
}

.f1-settings-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f1-settings-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: var(--slate);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.f1-settings-tag {
  color: var(--green);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.f1-settings-row {
  display: flex;
  gap: 6px;
}

.f1-settings-input {
  flex: 1;
  background: #080a0d;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #ffffff;
}

.f1-settings-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.f1-settings-save {
  all: unset;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 3px;
  transition: background-color 0.15s ease;
}

.f1-settings-save:hover {
  background: #e10600;
}

.f1-settings-note {
  margin: 0;
  font-size: 8px;
  line-height: 1.4;
  color: var(--slate);
}

/* VU Meter Equalizer */
.f1-vu-meter {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
  gap: 3px;
}

.f1-vu-bar {
  flex: 1;
  height: 12%;
  min-height: 2px;
  background: var(--green);
  border-radius: 1px;
  transition: height 0.08s ease;
}

.f1-vu-bar:nth-child(n+10) {
  background: var(--amber);
}

.f1-vu-bar:nth-child(n+13) {
  background: var(--red);
}

/* Transcript Container */
.f1-transcript-container {
  background: #080a0d;
  border: 1px solid var(--line);
  border-radius: 4px;
  height: 110px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
}

.f1-transcript-feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.f1-log-line {
  font-size: 10px;
  line-height: 1.4;
  color: var(--bone);
  word-break: break-word;
}

.f1-log-time {
  color: var(--slate);
  font-size: 8.5px;
  margin-right: 4px;
}

.f1-log-sender {
  font-weight: 700;
  color: var(--amber);
}

.f1-log-line.is-ai .f1-log-sender {
  color: #ff473d;
}

.f1-log-line.is-sys .f1-log-sender {
  color: #00e5ff;
}

.f1-log-msg {
  color: var(--bone);
}

/* Presets */
.f1-radio-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.f1-preset-btn {
  all: unset;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--slate);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.f1-preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Tactical Controls */
.f1-radio-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.f1-ptt-btn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #e10600 0%, #b80500 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  padding: 7px 12px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.f1-ptt-btn:hover {
  filter: brightness(1.1);
}

.f1-ptt-btn:active {
  transform: scale(0.98);
}

.f1-ptt-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.f1-ptt-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.f1-ptt-label strong {
  font-family: var(--font-hero);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.f1-ptt-label small {
  font-size: 7.5px;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.06em;
}

/* Transmit Input Form */
.f1-tx-form {
  display: flex;
  gap: 5px;
}

.f1-tx-input {
  flex: 1;
  background: #080a0d;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #ffffff;
}

.f1-tx-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
}

.f1-tx-submit {
  all: unset;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-family: var(--font-hero);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 10px;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.f1-tx-submit:hover {
  background: #e10600;
  border-color: #e10600;
}

@media (max-width: 768px) {
  .f1-radio-wrapper {
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
    z-index: 48;
  }
  .f1-radio-wrapper.is-active {
    z-index: 99995;
  }
  .f1-trigger-bezel {
    padding: 6px 10px;
    gap: 6px;
  }
  .f1-trigger-sub {
    display: none;
  }
  .f1-trigger-ptt-hint {
    display: none;
  }
  .f1-trigger-title {
    font-size: 10px;
  }
  .f1-radio-console {
    width: calc(100vw - 20px);
    max-width: 100vw;
    max-height: min(400px, 58vh);
    bottom: calc(100% + 8px);
    right: 0;
  }
  .f1-console-inner {
    max-height: min(396px, calc(58vh - 4px));
    overflow-y: auto;
    padding: 10px;
    gap: 6px;
  }
  .f1-transcript-container {
    height: 95px;
    max-height: 105px;
  }
}
