@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-color: #000000;
  --card-bg: #111113;
  --card-border: #232326;
  --text-main: #ffffff;
  --text-muted: #8e8e93;
  --tesla-red: #e82127;
  --climate-blue: #308ce8;
  --climate-blue-glow: rgba(48, 140, 232, 0.3);
  --active-green: #34c759;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  padding: 24px 20px 40px 20px;
  position: relative;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  fill: var(--text-main);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.status-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-badge.active {
  background: rgba(48, 140, 232, 0.15);
  color: var(--climate-blue);
  border: 1px solid rgba(48, 140, 232, 0.3);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-badge.active .status-dot {
  box-shadow: 0 0 8px currentColor;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Vehicle Status Visual Card */
.hero-card {
  background: radial-gradient(circle at top, rgba(48, 140, 232, 0.08) 0%, rgba(17, 17, 19, 0.8) 70%);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.vehicle-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.vehicle-subtext {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Fan & Airflow Animation Area */
.blower-graphic {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.fan-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--climate-blue-glow) 0%, transparent 70%);
  opacity: 0.3;
  transition: opacity 0.5s ease;
}

.hero-card.running .fan-glow {
  opacity: 1;
  animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
}

.fan-icon {
  width: 72px;
  height: 72px;
  color: var(--text-muted);
  transition: color 0.5s ease, transform 0.5s ease;
  z-index: 2;
}

.hero-card.running .fan-icon {
  color: var(--climate-blue);
  animation: spin 1.2s linear infinite;
  filter: drop-shadow(0 0 12px var(--climate-blue));
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
  color: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.modal-card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #308ce8;
}

.modal-card p {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 16px;
}

.modal-card label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-top: 12px;
  margin-bottom: 4px;
}

.modal-card textarea {
  width: 100%;
  height: 64px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  padding: 8px;
  font-size: 0.8rem;
  font-family: monospace;
  resize: vertical;
  box-sizing: border-box;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-primary { background: #308ce8; color: #fff; }
.btn-secondary { background: #333; color: #ccc; }

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.timer-display {
  text-align: center;
}

.timer-time {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.timer-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick Action Button */
.action-button {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #308ce8 0%, #1e66b8 100%);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(48, 140, 232, 0.3);
  transition: all 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.action-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(48, 140, 232, 0.2);
}

.action-button.stop {
  background: linear-gradient(135deg, #e82127 0%, #a81318 100%);
  box-shadow: 0 4px 20px rgba(232, 33, 39, 0.3);
}

/* Settings Cards Group */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.settings-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 24px;
}

.setting-row {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.setting-title {
  font-size: 15px;
  font-weight: 500;
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Custom iOS Style Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #333336;
  transition: .3s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--climate-blue);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Chip Selector */
.chip-group {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 12px;
  background: #1c1c1e;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip.active {
  background: rgba(48, 140, 232, 0.15);
  color: var(--climate-blue);
  border-color: var(--climate-blue);
}

/* Footer / Instructions */
.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-top: auto;
}
