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

body {
  background: #0d0d0d;
  background-image: radial-gradient(ellipse at top, #1a1025 0%, #0d0d0d 70%);
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.container {
  width: 100%;
  max-width: 420px;
}

/* ── HEADER ── */
.site-header {
  text-align: center;
  margin-bottom: 28px;
}

.site-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: #9d8ec4;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: #a78bfa;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── SENSOR GRID ── */
.sensor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

/* ── SENSOR CARD ── */
.sensor-card {
  background: #16101f;
  border-radius: 16px;
  padding: 18px 16px 14px;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: box-shadow 0.3s ease;
}

.sensor-card.humidity   { border-color: #7c3aed44; }
.sensor-card.temperature { border-color: #ec489944; }

.card-top-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.humidity   .card-top-line { background: linear-gradient(90deg, transparent, #7c3aed, transparent); }
.temperature .card-top-line { background: linear-gradient(90deg, transparent, #ec4899, transparent); }

.card-icon {
  font-size: 20px;
  margin-bottom: 6px;
}

.card-label {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.humidity   .card-label { color: #a394d8; }
.temperature .card-label { color: #c97aa0; }

.card-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
}
.humidity   .card-value { color: #a78bfa; }
.temperature .card-value { color: #f472b6; }

.card-unit {
  font-size: 16px;
  font-weight: 400;
  opacity: 0.6;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  height: 4px;
  background: #1a1025;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.humidity   .progress-fill { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.temperature .progress-fill { background: linear-gradient(90deg, #ec4899, #f472b6); }

.last-update {
  font-size: 10px;
  color: #9080b8;
  font-weight: 500;
}

/* ── INFO ROW ── */
.info-row {
  display: flex;
  align-items: center;
  background: #16101f;
  border: 1px solid #7c3aed33;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  gap: 0;
}

.info-item {
  flex: 1;
  text-align: center;
}

.info-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #a394d8;
  margin-bottom: 6px;
}

.info-val {
  font-size: 26px;
  font-weight: 700;
  color: #c4b5fd;
  line-height: 1;
}

.info-unit {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.7;
}

.info-time-val {
  font-size: 15px;
  font-weight: 600;
  color: #c4b5fd;
  letter-spacing: 0.5px;
}

.info-sep {
  width: 1px;
  height: 40px;
  background: #7c3aed33;
  flex-shrink: 0;
  margin: 0 14px;
}

/* ── TARGET BOX ── */
.target-box {
  background: #16101f;
  border: 1px solid #7c3aed33;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
}

.target-title {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #a394d8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.target-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #7c3aed22;
}

.target-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.target-input {
  flex: 1;
  background: #0d0d0d;
  border: 1px solid #7c3aed55;
  border-radius: 10px;
  color: #a78bfa;
  font-size: 22px;
  font-weight: 700;
  padding: 10px 14px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.target-input::-webkit-outer-spin-button,
.target-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.target-input:focus { border-color: #a78bfa; }

.send-btn {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s, transform 0.1s;
}
.send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.send-btn:not(:disabled):hover  { opacity: 0.85; }
.send-btn:not(:disabled):active { transform: scale(0.96); }

.range-hint {
  font-size: 10px;
  color: #8878b0;
  text-align: center;
  margin-top: 8px;
}

/* ── STATUS BAR ── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(124, 58, 237, 0.05);
  border: 1px solid #7c3aed22;
  border-radius: 10px;
  font-size: 10px;
  color: #9d8ec4;
  transition: border-color 0.4s, color 0.4s;
}

.status-conn { letter-spacing: 0.5px; }

/* ── ANIMATIONS ── */

/* Pulse - canlı nokta */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.8); }
}
.live-dot { animation: pulse 1.8s ease-in-out infinite; }

/* Glow flash - kart değer değişince */
@keyframes glowHumidity {
  0%   { box-shadow: none; }
  40%  { box-shadow: 0 0 24px #7c3aed66, inset 0 0 12px #7c3aed22; }
  100% { box-shadow: none; }
}
@keyframes glowTemperature {
  0%   { box-shadow: none; }
  40%  { box-shadow: 0 0 24px #ec489966, inset 0 0 12px #ec489922; }
  100% { box-shadow: none; }
}
.sensor-card.humidity.flash    { animation: glowHumidity    0.6s ease-out forwards; }
.sensor-card.temperature.flash { animation: glowTemperature 0.6s ease-out forwards; }

/* Buton başarı */
@keyframes btnSuccess {
  0%   { background: linear-gradient(135deg, #7c3aed, #a855f7); }
  30%  { background: linear-gradient(135deg, #059669, #34d399); }
  100% { background: linear-gradient(135deg, #7c3aed, #a855f7); }
}
.send-btn.success { animation: btnSuccess 1.5s ease forwards; }

/* Bağlantı kopuk */
.status-bar.disconnected {
  border-color: #ef444444;
  color: #ef4444;
}
