/* ===== SpeedCam Assistant — Style Sheet ===== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
}

/* ===== LAYOUT ===== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 12px 16px;
  transition: all 0.3s ease;
}

/* ===== TOP BAR (GPS + LIMIT) ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  transition: all 0.3s ease;
}

/* GPS indicator */
.gps-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #888;
  transition: all 0.3s ease;
}

.gps-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.gps-dot.active {
  background: #00c853;
  box-shadow: 0 0 8px #00c853;
}

.gps-dot.error {
  background: #ff1744;
  box-shadow: 0 0 8px #ff1744;
}

/* Speed limit block */
.limit-block {
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.limit-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.limit-btn:active {
  background: #333;
  transform: scale(0.92);
}

.limit-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffab00;
  min-width: 48px;
  text-align: center;
}

.limit-unit {
  font-size: 0.7rem;
  color: #888;
}

/* ===== SPEED DISPLAY ===== */
.speed-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.speed-value {
  font-size: 7rem;
  font-weight: 300;
  letter-spacing: -2px;
  line-height: 1;
  background: linear-gradient(135deg, #00c853 0%, #ffffff 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

@media (min-width: 420px) {
  .speed-value {
    font-size: 8rem;
  }
}

.speed-unit {
  font-size: 1.2rem;
  color: #666;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.3s ease;
}

/* ===== TIMER / PROGRESS BAR ===== */
.timer-section {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 4px 0;
  transition: all 0.3s ease;
}

.timer-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #1a1a1a;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-bar-track.visible {
  opacity: 1;
}

.timer-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #ffab00, #ff6d00, #ff1744);
  transition: width 0.3s ease;
}

.timer-label {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timer-label.visible {
  opacity: 1;
}

/* ===== SIREN ALERT ===== */
.siren-alert {
  text-align: center;
  padding: 8px 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #ff1744;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.siren-alert.active {
  opacity: 1;
  animation: siren-blink 0.5s ease-in-out infinite alternate;
}

@keyframes siren-blink {
  0% {
    opacity: 0.3;
    text-shadow: 0 0 4px #ff1744;
  }
  100% {
    opacity: 1;
    text-shadow: 0 0 20px #ff1744, 0 0 40px #ff174466;
  }
}

/* ===== CAMERA WARNING ===== */
.camera-warning {
  text-align: center;
  padding: 6px 12px;
  margin: 4px auto;
  border-radius: 20px;
  background: rgba(255, 171, 0, 0.15);
  border: 1px solid rgba(255, 171, 0, 0.3);
  color: #ffab00;
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 90%;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.camera-warning.visible {
  opacity: 1;
  transform: translateY(0);
}

.camera-warning .distance {
  font-size: 0.75rem;
  color: #aaa;
  font-weight: 400;
}

/* ===== START/STOP BUTTON ===== */
.start-stop-section {
  text-align: center;
  padding: 12px 0;
  transition: all 0.3s ease;
}

.btn-startstop {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.btn-startstop.stopped {
  background: #00c853;
  box-shadow: 0 4px 20px rgba(0,200,83,0.3);
}

.btn-startstop.stopped:active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(0,200,83,0.2);
}

.btn-startstop.running {
  background: #ff1744;
  box-shadow: 0 4px 20px rgba(255,23,68,0.3);
  animation: stop-pulse 2s ease-in-out infinite;
}

.btn-startstop.running:active {
  transform: scale(0.92);
}

@keyframes stop-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255,23,68,0.3); }
  50% { box-shadow: 0 4px 30px rgba(255,23,68,0.5); }
}

/* ===== CAMERA BUTTONS ===== */
.camera-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 4px;
  transition: all 0.3s ease;
}

.btn-camera {
  flex: 1;
  max-width: 160px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #ccc;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-camera:active {
  background: rgba(255,255,255,0.12);
  transform: scale(0.96);
}

.btn-camera.add {
  color: #69f0ae;
  border-color: rgba(105,240,174,0.2);
}

.btn-camera.remove {
  color: #ff8a80;
  border-color: rgba(255,138,128,0.2);
}

/* ===== STATUS TEXT ===== */
.status-text {
  text-align: center;
  font-size: 0.7rem;
  color: #555;
  padding: 2px 0;
  transition: color 0.3s ease;
}

.status-text.active {
  color: #00c853;
}

.status-text.error {
  color: #ff1744;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 360px) {
  .app-container {
    padding: 8px 10px;
  }
  .speed-value {
    font-size: 5.5rem;
  }
  .btn-startstop {
    width: 68px;
    height: 68px;
    font-size: 0.75rem;
  }
}
