/**
 * Supercar Cockpit Speedometer Stylesheet
 * speed-test.us WordPress Theme
 */

.supercar-cockpit-widget {
  max-width: 1020px;
  margin: 0 auto 36px;
  background: #030712;
  border: 2px solid #1e293b;
  border-radius: 28px;
  box-shadow: 0 0 60px rgba(2, 132, 199, 0.18), 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  position: relative;
}

/* 1. Top Metallic Telemetry Bar */
.cockpit-top-bar {
  background: linear-gradient(90deg, #0b0f19 0%, #111827 50%, #0b0f19 100%);
  border-bottom: 1px solid rgba(30, 41, 59, 0.8);
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.server-node-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 12px;
  padding: 6px 14px;
}

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

.node-label {
  color: #94a3b8;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-family: var(--font-mono, monospace);
}

.server-select-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  font-family: var(--font-mono, monospace);
  outline: none;
  cursor: pointer;
}

.server-select-input option {
  background: #0f172a;
  color: #ffffff;
}

.client-telemetry-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.info-tag {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 6px 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-tag strong {
  color: #ffffff;
}

/* 2. F1 Shift Light Bar (9 LEDs) */
.f1-shift-bar-wrap {
  padding: 16px 20px 8px;
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.6) 0%, transparent 100%);
}

.f1-shift-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #020617;
  padding: 8px 18px;
  border-radius: 16px;
  border: 1px solid #1e293b;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.rpm-label {
  font-size: 9px;
  font-weight: 900;
  color: #64748b;
  letter-spacing: 1px;
  font-family: var(--font-mono, monospace);
  margin-right: 4px;
}

.led {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background: #0f172a;
  border: 1px solid #1e293b;
  transition: all 0.08s ease;
}

.led.led-green.active {
  background: #34d399;
  border-color: #6ee7b7;
  box-shadow: 0 0 12px #34d399;
}

.led.led-amber.active {
  background: #fbbf24;
  border-color: #fde68a;
  box-shadow: 0 0 12px #fbbf24;
}

.led.led-red.active {
  background: #ef4444;
  border-color: #fca5a5;
  box-shadow: 0 0 14px #ef4444;
  animation: pulse-red 0.5s infinite alternate;
}

.redline-badge {
  font-size: 10px;
  font-weight: 900;
  color: #ef4444;
  font-family: var(--font-mono, monospace);
  margin-left: 6px;
  display: none;
}

.redline-badge.active {
  display: inline-block;
  animation: pulse-red 0.3s infinite alternate;
}

@keyframes pulse-red {
  0% { opacity: 0.6; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* 3. Triple Cluster Grid */
.cockpit-cluster-grid {
  padding: 24px 28px 32px;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 28px;
  align-items: center;
}

@media (max-width: 960px) {
  .cockpit-cluster-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.telemetry-pod {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pod-card {
  background: #0b0f19;
  border: 1px solid rgba(30, 41, 59, 0.9);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.pod-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pod-title {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.pod-sub {
  font-size: 10px;
  font-family: var(--font-mono, monospace);
  color: #64748b;
}

.pod-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pod-val {
  font-size: 36px;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  color: #ffffff;
  line-height: 1;
}

.pod-unit {
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  font-family: var(--font-mono, monospace);
}

.pod-progress-bar {
  width: 100%;
  height: 5px;
  background: #1e293b;
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.pod-progress-bar .bar-fill {
  height: 100%;
  background: #38bdf8;
  transition: width 0.3s ease;
}

.pod-note {
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  margin-top: 6px;
}

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

.text-sky { color: #38bdf8 !important; }
.text-emerald { color: #34d399 !important; }

/* 4. Center Main Speedometer Dial */
.main-dial-pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dial-wrapper {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  .dial-wrapper {
    width: 270px;
    height: 270px;
  }
}

.metallic-bezel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #334155 100%);
  border: 4px solid #334155;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), inset 0 2px 4px rgba(255, 255, 255, 0.1);
}

.carbon-face {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #040813;
  border: 1px solid #1e293b;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dial-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-210deg);
}

.dial-scale-numbers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.scale-num {
  position: absolute;
}

.num-0   { bottom: 42px; left: 48px; }
.num-25  { top: 110px; left: 24px; }
.num-50  { top: 48px; left: 62px; }
.num-100 { top: 22px; left: 50%; transform: translateX(-50%); }
.num-200 { top: 48px; right: 62px; }
.num-300 { top: 110px; right: 24px; color: #fbbf24; }
.num-500 { bottom: 42px; right: 48px; color: #ef4444; }

/* Sweeping Needle */
.needle-hub-wrap {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.08s ease-out;
  z-index: 10;
}

.needle-rod {
  position: relative;
  width: 3px;
  height: 130px;
  transform: translateY(-65px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.needle-tip {
  width: 4px;
  height: 60px;
  background: linear-gradient(180deg, #ef4444 0%, #38bdf8 100%);
  border-radius: 4px;
  box-shadow: 0 0 14px #38bdf8, 0 0 20px #ef4444;
}

/* Center LCD Telemetry Hub */
.lcd-hub {
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background: linear-gradient(180deg, #0b0f19 0%, #030712 100%);
  border: 2px solid #334155;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 12;
  padding: 8px;
}

.gear-tag {
  background: #020617;
  border: 1px solid #1e293b;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  margin-bottom: 2px;
}

.speed-number {
  font-size: 46px;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.speed-unit {
  font-size: 11px;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-mono, monospace);
}

.stage-tag {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-top: 4px;
}

.dial-status-footer {
  margin-top: 18px;
  text-align: center;
  width: 100%;
  max-width: 320px;
}

.status-msg {
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
}

.live-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 6px;
  margin-top: 8px;
  overflow: hidden;
}

.live-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #34d399 100%);
  transition: width 0.1s linear;
}

/* 5. Real-Time Oscilloscope */
.oscilloscope-container {
  padding: 0 28px 16px;
}

.osc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
  margin-bottom: 6px;
}

.osc-live-badge {
  color: #38bdf8;
  font-weight: 800;
}

.osc-graph-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 8px 14px;
  height: 70px;
}

.osc-svg {
  width: 100%;
  height: 100%;
}

/* 6. Cockpit Footer Controls */
.cockpit-footer-controls {
  background: rgba(11, 15, 25, 0.95);
  border-top: 1px solid rgba(30, 41, 59, 0.8);
  padding: 20px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rating-badge-container {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
}

.button-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .button-group {
    width: 100%;
  }
}

.btn-cockpit-start {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #b91c1c 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 16px 42px;
  border: 1px solid rgba(254, 202, 202, 0.3);
  border-radius: 18px;
  cursor: pointer;
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-family: var(--font-sans, sans-serif);
}

@media (max-width: 640px) {
  .btn-cockpit-start {
    width: 100%;
    padding: 16px 20px;
  }
}

.btn-cockpit-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(239, 68, 68, 0.6);
}

.btn-cockpit-start:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-cockpit-share {
  background: #1e293b;
  border: 1px solid #334155;
  color: #f8fafc;
  padding: 16px 22px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cockpit-share:hover {
  background: #334155;
}

/* 7. Recent History Grid */
.recent-history-section {
  margin-top: 24px;
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 20px;
  padding: 20px;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
}

.btn-clear-history {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 11px;
  cursor: pointer;
}

.btn-clear-history:hover {
  color: #ef4444;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.recent-card {
  background: #040813;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recent-card-speed {
  font-size: 16px;
  font-weight: 900;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
}

.recent-card-meta {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono, monospace);
}

/* ==========================================================================
   Mobile Optimization for Speedometer Cockpit (320px - 640px)
   ========================================================================== */
@media (max-width: 640px) {
  .cockpit-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  .server-node-selector {
    width: 100%;
    justify-content: space-between;
  }

  .server-select-input {
    max-width: 180px;
  }

  .client-telemetry-info {
    justify-content: space-between;
    width: 100%;
  }

  .f1-shift-bar-wrap {
    padding: 12px 10px 6px;
  }

  .f1-shift-bar {
    padding: 6px 10px;
    gap: 4px;
  }

  .rpm-label {
    display: none;
  }

  .led {
    width: 11px;
    height: 9px;
  }

  .dial-wrapper {
    width: min(270px, 80vw);
    height: min(270px, 80vw);
  }

  .cockpit-cluster-grid {
    padding: 16px 12px;
    gap: 16px;
  }

  .oscilloscope-container {
    padding: 0 14px 14px;
  }

  .cockpit-footer-controls {
    padding: 16px 14px;
    flex-direction: column;
    gap: 12px;
  }

  .rating-badge-container {
    width: 100%;
    text-align: center;
  }
}
