/* ClearSync /app demo styles — separate from landing theme.css */

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #08080f;
  color: #e8e4d9;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1,h2,h3,h4 { font-family: 'Syne', sans-serif; font-weight: 700; }

/* ===== NAV ===== */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid rgba(245,166,35,0.1);
  backdrop-filter: blur(14px);
  background: rgba(8,8,15,0.85);
  gap: 1rem;
  flex-wrap: wrap;
}
.app-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}
.app-nav-logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #e8e4d9;
  letter-spacing: 0.04em;
}
.app-nav-badge {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(245,166,35,0.7);
  border: 1px solid rgba(245,166,35,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.app-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.35);
  color: #F5A623;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.app-nav-cta:hover {
  background: rgba(245,166,35,0.2);
  border-color: rgba(245,166,35,0.6);
}

/* ===== MAIN LAYOUT ===== */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ===== ENERGY STRIP ===== */
.energy-strip {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: rgba(245,166,35,0.04);
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.energy-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.energy-label {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.35);
}
.energy-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #F5A623;
}
.energy-divider {
  width: 1px;
  height: 28px;
  background: rgba(245,166,35,0.12);
}

/* ===== TABS ===== */
.app-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(245,166,35,0.08);
  padding-bottom: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(232,228,217,0.35);
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.tab-btn:hover { color: rgba(232,228,217,0.7); }
.tab-btn.active {
  color: #F5A623;
  border-bottom-color: #F5A623;
}
.tab-content { display: none; }
.tab-content.active { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ===== ASSET ILLUSTRATION CARD ===== */
.illus-card {
  background: rgba(12,12,24,0.9);
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.illus-card-title {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.35);
}
.illus-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.illus-wrap svg { width: 100%; max-width: 340px; }

/* SVG glass panel transitions */
.glass-panel {
  transition: opacity 0.6s ease;
}

/* ===== CONTROLS CARD ===== */
.controls-card {
  background: rgba(12,12,24,0.9);
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}
.controls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.controls-title {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.35);
}

/* ===== AUTO TOGGLE ===== */
.auto-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.auto-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(232,228,217,0.6);
  font-family: 'Syne', sans-serif;
}
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: rgba(232,228,217,0.4);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}
.toggle-switch input:checked + .toggle-track {
  background: rgba(245,166,35,0.25);
  border-color: rgba(245,166,35,0.55);
}
.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
  background: #F5A623;
}

/* ===== UV/LUX READOUT ===== */
.env-readout {
  display: flex;
  gap: 1rem;
  padding: 0.65rem 0.9rem;
  background: rgba(245,166,35,0.04);
  border: 1px solid rgba(245,166,35,0.08);
  border-radius: 8px;
}
.env-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}
.env-item-label {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.3);
}
.env-item-value {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(245,166,35,0.85);
}
.env-readout.hidden { display: none; }

/* ===== PANEL SLIDERS ===== */
.panel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.panel-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.panel-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-name {
  font-size: 0.78rem;
  color: rgba(232,228,217,0.6);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
}
.panel-pct {
  font-size: 0.72rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  color: rgba(245,166,35,0.7);
}
.panel-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(245,166,35,0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.panel-slider:disabled { opacity: 0.4; cursor: not-allowed; }
.panel-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F5A623;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(245,166,35,0.5);
}
.panel-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #F5A623;
  cursor: pointer;
  border: none;
}

/* ===== PRESETS ===== */
.presets-section {
  border-top: 1px solid rgba(245,166,35,0.07);
  padding-top: 0.85rem;
}
.presets-title {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.25);
  margin-bottom: 0.6rem;
}
.presets-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.preset-btn {
  padding: 0.4rem 0.75rem;
  background: rgba(245,166,35,0.05);
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: 6px;
  color: rgba(232,228,217,0.55);
  font-size: 0.72rem;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.preset-btn:hover {
  background: rgba(245,166,35,0.14);
  border-color: rgba(245,166,35,0.4);
  color: #F5A623;
}
.preset-btn.active {
  background: rgba(245,166,35,0.18);
  border-color: rgba(245,166,35,0.55);
  color: #F5A623;
}
/* Night-Stop preset — police-visibility accent */
.preset-btn[data-preset="night-stop"] {
  border-color: rgba(245,100,35,0.25);
  color: rgba(245,140,35,0.7);
}
.preset-btn[data-preset="night-stop"]:hover,
.preset-btn[data-preset="night-stop"].active {
  background: rgba(245,100,35,0.15);
  border-color: rgba(245,100,35,0.55);
  color: #F5A623;
}

/* ===== ROI CALCULATOR CARD ===== */
/* Spans full width below the illus+controls row */
.tab-content.active { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.calc-card {
  grid-column: 1 / -1;
  background: rgba(12,12,24,0.9);
  border: 1px solid rgba(245,166,35,0.14);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.calc-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.35);
}
.calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.calc-inputs { display: flex; flex-direction: column; gap: 0.75rem; }
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.calc-field label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.4);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
}
.calc-field select,
.calc-field input[type="number"] {
  background: rgba(245,166,35,0.05);
  border: 1px solid rgba(245,166,35,0.15);
  border-radius: 7px;
  color: #e8e4d9;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.calc-field select:focus,
.calc-field input[type="number"]:focus {
  border-color: rgba(245,166,35,0.45);
}
.calc-field select option { background: #141422; }
.calc-outputs {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  justify-content: center;
}
.calc-result {
  background: rgba(245,166,35,0.04);
  border: 1px solid rgba(245,166,35,0.1);
  border-radius: 9px;
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transition: border-color 0.3s;
}
.calc-result.highlight { border-color: rgba(245,166,35,0.35); }
.calc-result-label {
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(232,228,217,0.3);
}
.calc-result-value {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #F5A623;
  transition: opacity 0.3s;
}
.calc-result-note {
  font-size: 0.62rem;
  color: rgba(232,228,217,0.25);
  font-style: italic;
}
.calc-reserve-row {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
  display: flex;
  justify-content: flex-end;
}
.calc-reserve-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.4);
  border-radius: 8px;
  color: #F5A623;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 1.2rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.calc-reserve-btn:hover {
  background: rgba(245,166,35,0.22);
  border-color: rgba(245,166,35,0.7);
}
.calc-sources {
  grid-column: 1 / -1;
  font-size: 0.58rem;
  color: rgba(232,228,217,0.18);
  margin-top: 0.1rem;
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .tab-content.active {
    grid-template-columns: 1fr;
  }
  .illus-wrap { min-height: 180px; }
  .energy-strip { gap: 0.75rem; }
  .energy-divider { display: none; }
  .calc-body { grid-template-columns: 1fr; }
  .calc-reserve-row { justify-content: stretch; }
  .calc-reserve-btn { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .app-main { padding: 1rem 0.85rem 2rem; }
  .app-nav { padding: 0.8rem 1rem; }
}
