/* CSS Custom Design System */
:root {
  --bg-color: #0b0f19;
  --bg-grad-start: #0e1628;
  --bg-grad-end: #050811;
  
  --phone-frame: #1b2336;
  --phone-bezel: #090c15;
  --phone-bg: #0d1222;
  
  --card-bg: rgba(25, 33, 56, 0.4);
  --card-border: rgba(255, 255, 255, 0.06);
  --card-border-active: rgba(0, 242, 254, 0.3);
  
  --text-main: #f0f4f8;
  --text-muted: #8a9fc4;
  --text-inverse: #0b0f19;
  
  --accent-safe: #00f2fe;
  --accent-safe-glow: rgba(0, 242, 254, 0.4);
  --accent-warn: #ff3366;
  --accent-warn-glow: rgba(255, 51, 102, 0.4);
  
  --font-display: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-display);
  background: radial-gradient(circle at center, var(--bg-grad-start), var(--bg-grad-end));
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
}

/* Base Layout Container */
.container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  align-items: center;
}

@media (max-width: 992px) {
  .container {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 30px;
  }
  body {
    padding: 10px;
  }
}

/* ==========================================================================
   PHONE MOCKUP FRAME
   ========================================================================== */
.phone-wrapper {
  perspective: 1000px;
}

.phone-device {
  width: 390px;
  height: 800px;
  background-color: var(--phone-frame);
  border-radius: 48px;
  padding: 12px;
  box-shadow: 
    0px 25px 50px -12px rgba(0, 0, 0, 0.7),
    0px 0px 40px rgba(0, 242, 254, 0.1),
    inset 0 2px 2px rgba(255,255,255,0.2),
    inset 0 -2px 2px rgba(0,0,0,0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  transition: transform 0.5s ease;
}

.phone-device:hover {
  transform: translateY(-5px) rotateY(2deg);
}

/* Notch and speaker */
.phone-notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 30px;
  background: var(--phone-bezel);
  border-radius: 20px;
  z-index: 100;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.phone-notch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  width: 40px;
  height: 4px;
  background: #222;
  border-radius: 2px;
}

.phone-notch::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #111;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.2);
}

/* Phone Status Bar */
.phone-status-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 44px;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 99;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  pointer-events: none;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-icons .icon {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
}

.status-battery {
  font-size: 11px;
}

/* App Screen Container inside Phone */
.app-container {
  width: 100%;
  height: 100%;
  background: var(--phone-bg);
  border-radius: 38px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 44px; /* Space for status bar */
  padding-bottom: 24px; /* Bottom home indicator line padding */
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.app-container::after {
  /* Home indicator bar */
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  pointer-events: none;
}

/* App Screens visibility */
.app-screen {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: 16px 20px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

.app-screen.active {
  display: flex;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.app-main.scrollable {
  overflow-y: auto;
  padding-bottom: 85px; /* Leave enough padding for bottom navigation bar */
}

.app-main.scrollable::-webkit-scrollbar {
  width: 4px;
}
.app-main.scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* App Header styling */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.app-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-safe);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-safe);
  animation: pulse-glow 2s infinite;
}

.gps-status-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.gps-status-badge.active {
  color: var(--accent-safe);
  background: rgba(0, 242, 254, 0.05);
  border-color: rgba(0, 242, 254, 0.2);
}

.gps-status-badge.active .gps-dot {
  background: var(--accent-safe);
  box-shadow: 0 0 6px var(--accent-safe);
}

.gps-status-badge.speeding {
  color: var(--accent-warn);
  background: rgba(255, 51, 102, 0.05);
  border-color: rgba(255, 51, 102, 0.2);
}

.gps-status-badge.speeding .gps-dot {
  background: var(--accent-warn);
  box-shadow: 0 0 6px var(--accent-warn);
  animation: flash-red 0.5s infinite alternate;
}

.gps-dot {
  width: 5px;
  height: 5px;
  background: #555;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================================================
   SPEEDOMETER (CIRCULAR DIAL)
   ========================================================================== */
.speedometer-container {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 15px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.speed-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.speed-ring circle {
  fill: none;
  stroke-width: 10px;
}

.speed-ring .ring-bg {
  stroke: rgba(255, 255, 255, 0.03);
}

.speed-ring .ring-progress {
  stroke: var(--accent-safe);
  stroke-linecap: round;
  stroke-dasharray: 534; /* 2 * PI * 85 */
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 0.1s ease, stroke 0.3s ease;
  filter: drop-shadow(0 0 8px var(--accent-safe-glow));
}

.speedometer-container.warning .ring-progress {
  stroke: var(--accent-warn);
  filter: drop-shadow(0 0 12px var(--accent-warn-glow));
}

.speed-readout {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.speed-number {
  font-size: 70px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
  letter-spacing: -2px;
  transition: text-shadow 0.3s ease;
}

.speed-unit {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 1px;
}

/* Warning Glow Overlay */
.warning-alert-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 51, 102, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.speedometer-container.warning .warning-alert-indicator {
  opacity: 1;
  animation: pulse-danger-glow 1.5s infinite;
}

/* ==========================================================================
   SPEED LIMIT INDICATOR PANEL
   ========================================================================== */
.speed-limit-display {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  position: relative;
  transition: border-color 0.3s ease;
}

.speed-limit-display:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.limit-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.limit-value-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.limit-adj-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s ease;
}

.limit-adj-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.limit-adj-btn:active {
  transform: scale(0.95);
}

.limit-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-safe);
  min-width: 60px;
  display: inline-block;
}

.limit-unit {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   POWER BUTTON
   ========================================================================== */
.power-toggle-section {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-power {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.power-icon-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.power-icon-ring svg {
  width: 14px;
  height: 14px;
  fill: var(--text-muted);
  transition: fill 0.3s ease;
}

.btn-power:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}

/* Active State for Power Button */
.btn-power.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.3);
  color: var(--accent-safe);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.btn-power.active .power-icon-ring {
  background: var(--accent-safe);
}

.btn-power.active .power-icon-ring svg {
  fill: var(--text-inverse);
}

/* Active Speeding State for Power Button */
.btn-power.speeding {
  background: rgba(255, 51, 102, 0.08);
  border-color: rgba(255, 51, 102, 0.3);
  color: var(--accent-warn);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
  animation: warning-pulse-border 1.5s infinite;
}

.btn-power.speeding .power-icon-ring {
  background: var(--accent-warn);
}

.btn-power.speeding .power-icon-ring svg {
  fill: var(--text-inverse);
}

/* ==========================================================================
   APP SETTINGS SCREEN
   ========================================================================== */
.settings-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.settings-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  border-left: 3px solid var(--accent-safe);
  padding-left: 8px;
}

.settings-slider-group {
  margin: 10px 0;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.slider-labels strong {
  font-size: 18px;
  color: var(--accent-safe);
  font-weight: 700;
}

/* Radio buttons list */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-container {
  display: flex;
  align-items: flex-start;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
}

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkmark {
  position: absolute;
  top: 2px;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all 0.2s ease;
}

.radio-container:hover input ~ .checkmark {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-safe);
}

.radio-container input:checked ~ .checkmark {
  background-color: var(--accent-safe);
  border-color: var(--accent-safe);
  box-shadow: 0 0 8px var(--accent-safe-glow);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked ~ .checkmark:after {
  display: block;
}

.radio-container .checkmark:after {
  top: 5px;
  left: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-inverse);
}

.radio-label-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radio-label-text strong {
  color: var(--text-main);
  font-weight: 600;
}

.radio-label-text span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Voice alerts options list */
.voice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.voice-item.active {
  background: rgba(0, 242, 254, 0.03);
  border-color: var(--card-border-active);
  box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.05);
}

.voice-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.voice-info strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.voice-item.active .voice-info strong {
  color: var(--accent-safe);
}

.voice-info span {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-preview-audio {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  transition: all 0.2s ease;
  margin-left: 10px;
}

.btn-preview-audio:hover {
  background: var(--accent-safe);
  border-color: var(--accent-safe);
  color: var(--text-inverse);
  transform: scale(1.1);
}

/* ==========================================================================
   APP FLOATING VOICE ALERT TOAST
   ========================================================================== */
.toast-alert {
  position: absolute;
  top: 60px;
  left: 20px;
  right: 20px;
  background: rgba(255, 51, 102, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.3);
  z-index: 100;
  backdrop-filter: blur(12px);
  animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-alert.hidden {
  display: none;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-icon {
  font-size: 20px;
  animation: shake 0.5s infinite alternate;
}

.toast-content {
  display: flex;
  flex-direction: column;
}

.toast-speaker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
}

.toast-message {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

@keyframes shake {
  0% { transform: rotate(-10deg); }
  100% { transform: rotate(10deg); }
}

/* ==========================================================================
   PHONE BOTTOM NAVIGATION BAR
   ========================================================================== */
.phone-nav-bar {
  height: 60px;
  background: rgba(13, 18, 34, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  z-index: 90;
  backdrop-filter: blur(20px);
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  width: 70px;
  font-family: var(--font-display);
  transition: color 0.2s ease;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  fill: var(--text-muted);
  transition: fill 0.2s ease, transform 0.2s ease;
}

.nav-item span {
  font-size: 10px;
  font-weight: 600;
}

.nav-item:hover {
  color: var(--text-main);
}
.nav-item:hover .icon {
  fill: var(--text-main);
}

.nav-item.active {
  color: var(--accent-safe);
}

.nav-item.active .icon {
  fill: var(--accent-safe);
  transform: translateY(-2px);
}

/* ==========================================================================
   RIGHT SIDE SIMULATION CONTROL PANEL
   ========================================================================== */
.simulation-panel {
  background: rgba(13, 21, 41, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 32px;
  padding: 30px;
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  max-height: 800px;
  overflow-y: auto;
}

.simulation-panel::-webkit-scrollbar {
  width: 6px;
}
.simulation-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.sim-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.sim-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.sim-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 20px;
  padding: 20px;
}

.sim-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.sim-speed-slider-area {
  margin-bottom: 16px;
}

.sim-slider-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sim-speed-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.sim-speed-labels strong {
  font-size: 22px;
  font-weight: 800;
  transition: all 0.2s ease;
}

.sim-speed-labels strong.speed-glow {
  color: var(--accent-safe);
  text-shadow: 0 0 10px var(--accent-safe-glow);
}

.sim-speed-labels strong.speeding-glow {
  color: var(--accent-warn);
  text-shadow: 0 0 15px var(--accent-warn-glow);
}

/* Preset Buttons */
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-preset:active {
  transform: translateY(1px);
}

/* Autopilot Controls */
.autopilot-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.btn-autopilot {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.2);
  color: var(--accent-safe);
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-autopilot:hover {
  background: var(--accent-safe);
  color: var(--text-inverse);
  box-shadow: 0 0 15px var(--accent-safe-glow);
}

.btn-autopilot.active {
  background: var(--accent-warn);
  border-color: var(--accent-warn);
  color: var(--text-inverse);
  box-shadow: 0 0 15px var(--accent-warn-glow);
}

.autopilot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.autopilot-status .status-dot {
  width: 8px;
  height: 8px;
  background: #555;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.autopilot-status.active {
  color: var(--accent-safe);
}

.autopilot-status.active .status-dot {
  background: var(--accent-safe);
  box-shadow: 0 0 8px var(--accent-safe);
  animation: flash-green 1s infinite alternate;
}

/* Real-time System Log Console */
.log-container {
  height: 150px;
  background: #060913;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #c4d1ec;
  line-height: 1.4;
  scroll-behavior: smooth;
}

.log-line {
  word-break: break-all;
}

.log-line.system {
  color: #7a8fa6;
}

.log-line.warn {
  color: #ffb703;
}

.log-line.danger {
  color: #ff3366;
  font-weight: bold;
}

.log-line.success {
  color: #00f2fe;
}

.btn-clear-log {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 11px;
  cursor: pointer;
  margin-top: 8px;
  align-self: flex-start;
  transition: color 0.2s ease;
}

.btn-clear-log:hover {
  color: var(--text-main);
  text-decoration: underline;
}

/* ==========================================================================
   SLIDERS STYLING
   ========================================================================== */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  outline: none;
  transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-safe);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-safe-glow);
  transition: transform 0.1s ease, background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#sim-speed-slider::-webkit-slider-thumb {
  background: var(--accent-safe);
}

#sim-speed-slider.speeding::-webkit-slider-thumb {
  background: var(--accent-warn);
  box-shadow: 0 0 15px var(--accent-warn-glow);
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */
@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 5px var(--accent-safe); }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 15px var(--accent-safe); }
  100% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 5px var(--accent-safe); }
}

@keyframes pulse-danger-glow {
  0% { opacity: 0.4; }
  50% { opacity: 0.9; }
  100% { opacity: 0.4; }
}

@keyframes warning-pulse-border {
  0% { box-shadow: 0 0 10px rgba(255, 51, 102, 0.2); }
  50% { box-shadow: 0 0 25px rgba(255, 51, 102, 0.5); }
  100% { box-shadow: 0 0 10px rgba(255, 51, 102, 0.2); }
}

@keyframes flash-red {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

@keyframes flash-green {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

/* ==========================================================================
   NATIVE ANDROID APP WEBVIEW LAYOUT MODES
   ========================================================================== */
html.platform-android,
body.platform-android {
  padding: 0 !important;
  margin: 0 !important;
  background: var(--phone-bg) !important;
  min-height: 100vh !important;
  height: 100vh !important;
  display: block !important;
  overflow: hidden !important;
}

body.platform-android .container {
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.platform-android .phone-wrapper {
  perspective: none !important;
  width: 100% !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.platform-android .phone-device {
  width: 100% !important;
  height: 100vh !important;
  border-radius: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
  background: none !important;
}

body.platform-android .phone-device:hover {
  transform: none !important;
}

body.platform-android .phone-notch,
body.platform-android .phone-status-bar,
body.platform-android .simulation-panel {
  display: none !important;
}

body.platform-android .app-container {
  border-radius: 0 !important;
  padding-top: 24px !important; /* Small status padding */
  padding-bottom: 24px !important;
  border: none !important;
  height: 100vh !important;
  background: var(--phone-bg) !important;
}

body.platform-android .app-container::after {
  display: none !important; /* Hide custom home bar since Android handles it */
}

body.platform-android .app-screen {
  padding: 12px 16px !important;
}

body.platform-android .phone-nav-bar {
  bottom: 0 !important;
  border-radius: 0 !important;
}

/* ==========================================================================
   OIL PRICE TAB AND TABLE STYLES
   ========================================================================== */
.oil-table-container {
  margin-top: 10px;
  overflow-x: auto;
}

.oil-table th, 
.oil-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.oil-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.oil-table tr.price-up td.diff-cell {
  color: var(--accent-warn) !important;
  font-weight: bold;
}

.oil-table tr.price-down td.diff-cell {
  color: var(--accent-safe) !important;
  font-weight: bold;
}

.oil-table tr.price-up td.save-cell {
  color: var(--accent-safe) !important;
  font-weight: bold;
}

.oil-table tr.price-down td.save-cell {
  color: var(--text-muted) !important;
}

.oil-table tr td.save-cell.highlight-save {
  background: rgba(0, 242, 254, 0.08);
  border-radius: 8px;
  color: var(--accent-safe) !important;
  font-weight: 800;
  box-shadow: inset 0 0 5px rgba(0, 242, 254, 0.1);
}

.oil-table tr td.save-cell.highlight-wait {
  background: rgba(255, 159, 67, 0.08);
  border-radius: 8px;
  color: #ff9f43 !important;
  font-weight: 800;
}

.preset-buttons .calc-preset-btn.active {
  background: var(--accent-safe);
  color: var(--text-inverse);
  box-shadow: 0 0 10px var(--accent-safe-glow);
  border-color: var(--accent-safe);
}

/* ==========================================================================
   LICENSE LOCK SCREEN OVERLAY
   ========================================================================== */
.license-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.96);
  z-index: 10000; /* Float above everything including the nav bar */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  backdrop-filter: blur(20px);
  animation: fadeIn 0.4s ease;
}

.license-lock-overlay.hidden {
  display: none !important;
}

.lock-card {
  background: var(--card-bg);
  border: 1px solid var(--accent-warn-glow);
  border-radius: 28px;
  padding: 30px 24px;
  text-align: center;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 51, 102, 0.1);
  backdrop-filter: blur(10px);
}

.lock-icon {
  font-size: 54px;
  margin-bottom: 16px;
  animation: pulse-danger-glow 2s infinite;
  display: inline-block;
}

.lock-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.lock-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.box-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  text-align: left;
}

.device-id-box, .license-input-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
