* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0; 
}

.container {
  width: 92%; 
  max-width: 500px;
  text-align: center; 
}

.header h1 { font-size: 28px; margin-bottom: 5px; color: #00e5ff; }
.header p { color: #b2bec3; font-size: 14px; margin-bottom: 20px; }

.controls { display: flex; gap: 15px; justify-content: center; }

button {
  background: #00e5ff; color: #000;
  padding: 15px 20px; border-radius: 25px;
  border: none; font-size: 16px; font-weight: bold;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
  flex: 1;
  min-height: 50px; 
}

button:active { transform: scale(0.95); }

button:disabled {
  background: #636e72; color: #b2bec3;
  cursor: not-allowed; box-shadow: none;
  transform: none;
}

.stop-btn {
  background: #ff7675; color: white;
  box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3);
}

.card {
  margin-top: 20px; padding: 25px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* --- FIXED STATUS ROW & BADGE --- */
.status-row { 
  display: flex; 
  flex-wrap: wrap; /* Jagah kam hone par next line me bhej dega */
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 25px; 
  gap: 15px;
}

.status-row p {
  display: flex;
  align-items: center;
  gap: 8px; /* Text aur Badge ke beech space */
  font-size: 15px;
  margin: 0;
}

.badge { 
  background: #636e72; 
  padding: 6px 12px; 
  border-radius: 12px; 
  font-size: 12px; 
  text-transform: uppercase; 
  font-weight: bold;
  white-space: nowrap; /* FIX: Text ko tootne se rokega */
}

.badge.active { background: #00b894; }
/* --------------------------------- */

.meter-section { margin-top: 15px; }
.db-value { font-size: 36px; font-weight: bold; color: #00e5ff; }

.meter-bg {
  width: 100%; height: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px; margin-top: 10px; overflow: hidden;
}

.meter-fill {
  height: 100%; width: 0%;
  background: #00e5ff;
  transition: width 0.1s ease-out, background-color 0.2s;
  border-radius: 10px;
}

canvas {
  width: 100%; height: 120px; margin-top: 25px;
  background: rgba(0, 0, 0, 0.2); border-radius: 10px;
}

.result-card { border: 2px solid #00e5ff; animation: fadeIn 0.5s ease-in-out; }
.result-card h2 { margin-bottom: 20px; color: #fdcb6e; font-size: 20px; }
.report-item {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px;
}
.report-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.highlight-text { color: #00e5ff; font-size: 18px; }

.reference-chart { margin-top: 30px; text-align: left; }
.reference-chart h3 { font-size: 16px; color: #b2bec3; margin-bottom: 15px; text-align: center; }
.chart-flex { display: flex; flex-direction: column; gap: 10px; }
.c-box {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 15px; border-radius: 10px; font-size: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 5px solid transparent;
}
.c-box.safe { border-left-color: #00b894; }
.c-box.moderate { border-left-color: #fdcb6e; }
.c-box.high { border-left-color: #ff7675; }
.c-box.hazard { border-left-color: #d63031; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   MOBILE RESPONSIVE QUERIES
   ========================================= */
@media screen and (max-width: 600px) {
  .header h1 { font-size: 24px; }
  .card { padding: 20px; }
  
  /* Mobile par dono options ko upar-neeche stak kar denge taaki saaf dikhe */
  .status-row { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 12px;
  }
  
  .db-value { font-size: 30px; }
  button { font-size: 15px; padding: 12px 15px; }
  .report-item { flex-direction: column; align-items: flex-start; gap: 5px; }
  .highlight-text { font-size: 16px; }
}