/* =====================================================================
   ESP32 SMART CAR — dashboard styling, matching the approved layout:
   header + gear grid + lighting row + steering/pedals row.
   ===================================================================== */

:root {
  --bg:      #0B0F14;
  --panel:   #131A22;
  --card:    #1B242E;
  --line:    #29333E;
  --text:    #E7ECF2;
  --text-dim:#7C8AA0;
  --cyan:    #17C9E0;
  --amber:   #FFC24B;
  --red:     #E5433F;
  --green:   #3DDC97;
  --font-title: 'Rajdhani', sans-serif;
  --font-ui: 'Cairo', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.console {
  max-width: 500px;
  margin: 0 auto;
  padding: 28px 18px calc(24px + env(safe-area-inset-bottom));
}

/* ---------------- HEADER ---------------- */
.app-header { text-align: center; margin-bottom: 22px; }

.app-title {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 0.04em;
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(23,201,224,0.65), 0 0 30px rgba(23,201,224,0.35);
  margin: 0 0 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  color: var(--text-dim);
}
.status-pill b { color: var(--cyan); font-weight: 700; }
.status-pill b.conn-online { color: var(--green); }
.status-pill b.conn-offline { color: var(--red); }
.dot-sep { opacity: 0.5; }

/* ---------------- MAIN PANEL ---------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

/* ---- Gear grid ---- */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.gear-btn {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  background: var(--card);
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 0;
  cursor: pointer;
  transition: all .15s;
}
.gear-btn:active { transform: scale(0.95); }
.gear-btn.active {
  background: var(--cyan);
  color: #04262a;
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(23,201,224,0.55);
}

/* ---- Section labels ---- */
.section-label {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* ---- Lighting row ---- */
.light-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}
.light-btn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 14px 4px;
  cursor: pointer;
  transition: all .15s;
}
.light-btn:active { transform: scale(0.95); }
.light-btn.active {
  background: var(--amber);
  color: #201400;
  border-color: var(--amber);
  box-shadow: 0 0 14px rgba(255,194,75,0.55);
}
#btnHazard.active {
  background: var(--red);
  color: #250a0a;
  border-color: var(--red);
  box-shadow: 0 0 14px rgba(229,67,63,0.55);
}

/* ---- Steering + pedals row ---- */
.lower-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.steer-col, .pedal-col { display: flex; flex-direction: column; align-items: center; }

.steer-circles { display: flex; gap: 14px; }
.circle-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  transition: all .12s;
}
.circle-btn:active, .circle-btn.active {
  background: var(--cyan);
  color: #04262a;
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(23,201,224,0.55);
}

.gas-btn {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text-dim);
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  padding: 16px 0;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all .12s;
}
.gas-btn.active {
  background: var(--green);
  color: #04231a;
  border-color: var(--green);
  box-shadow: 0 0 14px rgba(61,220,151,0.55);
}

.brake-btn {
  width: 100%;
  background: linear-gradient(180deg, #E5433F, #B92E2A);
  border: 1px solid #B92E2A;
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 16px;
  padding: 16px 0;
  cursor: pointer;
  transition: all .12s;
}
.brake-btn.active {
  box-shadow: 0 0 18px rgba(229,67,63,0.75);
  transform: scale(0.97);
}
