/* ─── OSIM Demo — Styles ─── */

:root {
  --bg: #0a0c14;
  --bg-card: #12151f;
  --bg-card-hover: #171b28;
  --bg-input: #1c2030;
  --bg-header: #0e1019;
  --border: #222640;
  --border-accent: #2a3050;
  --text: #d8dae5;
  --text-dim: #6b7094;
  --text-bright: #ffffff;
  --accent: #4a9eff;
  --green: #34c759;
  --yellow: #ffcc00;
  --orange: #ff9500;
  --red: #ff3b30;
  --purple: #af52de;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}


/* ─── Hero ─── */

.hero {
  padding: 20px 24px 36px;
  text-align: center;
  background: linear-gradient(180deg, #111528 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto 16px;
}

.hero-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.hero-nav-link:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.05);
}

.hero-content {
  max-width: 640px;
  margin: 0 auto;
}

/* ─── WhatsApp FAB ─── */

.whatsapp-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: transform 0.15s, background 0.15s;
  text-decoration: none;
}

.whatsapp-fab:hover {
  background: #20BD5A;
  transform: scale(1.05);
}

.whatsapp-fab:active {
  transform: scale(0.95);
}

.hero-logo {
  height: 36px;
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(74, 158, 255, 0.1);
  border: 1px solid rgba(74, 158, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}


/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  min-width: 44px;
}

.btn:active {
  transform: scale(0.97);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  background: #5eaaff;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}

.btn-start {
  background: linear-gradient(135deg, #1a6b3c, #22883e);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.btn-start:hover {
  background: linear-gradient(135deg, #1f7d45, #28994a);
}

.btn-stop {
  background: linear-gradient(135deg, #8b1a1a, #b32020);
  color: #fff;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}
.btn-stop:hover {
  background: linear-gradient(135deg, #a01f1f, #cc2828);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}


/* ─── Group Gauge Section ─── */

.group-section {
  padding: 24px 24px 0;
  max-width: 900px;
  margin: 0 auto;
}

.group-gauge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.group-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-icon {
  color: var(--yellow);
}

.group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.throttle-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--orange);
  background: rgba(255, 149, 0, 0.12);
  border: 1px solid rgba(255, 149, 0, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  animation: pulse 1.5s infinite;
}

.throttle-badge.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.group-values {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.group-power-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
}

.group-power-separator {
  font-size: 16px;
  color: var(--text-dim);
}

.group-power-max {
  font-size: 14px;
  color: var(--text-dim);
}

.group-bar-bg {
  position: relative;
  height: 10px;
  background: var(--bg-input);
  border-radius: 5px;
  overflow: hidden;
}

.group-bar-fill {
  height: 100%;
  border-radius: 5px;
  width: 0%;
  transition: width 0.5s ease-out, background-color 0.3s;
  background: var(--green);
}

.group-bar-fill.bar-warning {
  background: var(--yellow);
}

.group-bar-fill.bar-over {
  background: var(--orange);
}

.group-strips {
  display: flex;
  height: 6px;
  margin-top: 6px;
  border-radius: 3px;
  overflow: hidden;
  gap: 2px;
}

.group-strip {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease-out, opacity 0.3s;
  min-width: 0;
}

.group-stats {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.group-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.group-stat-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
}

.group-stat-label {
  font-size: 12px;
  color: var(--text-dim);
}


/* ─── Charger Grid ─── */

.chargers-section {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.charger-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}


/* ─── Charger Card ─── */

.charger-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
}

.charger-card.throttled {
  border-color: rgba(255, 149, 0, 0.4);
  box-shadow: 0 0 20px rgba(255, 149, 0, 0.06);
}

.charger-card.charging {
  border-color: rgba(74, 158, 255, 0.3);
}

/* EV Illustration */
.ev-illustration {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
}

.ev-car-svg {
  width: 120px;
  height: 70px;
}

.ev-cable-line {
  stroke-dasharray: 6 4;
  transition: opacity 0.3s;
}

.ev-charging .ev-cable-line {
  animation: cable-flow 0.8s linear infinite;
}

@keyframes cable-flow {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -10; }
}

.ev-plug-dot {
  transition: fill 0.3s, r 0.3s;
}

.charger-dot {
  transition: fill 0.3s;
}

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

.card-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
}

.card-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-unplugged {
  color: var(--text-dim);
  background: rgba(107, 112, 148, 0.1);
}

.status-plugged {
  color: var(--yellow);
  background: rgba(255, 204, 0, 0.1);
}

.status-charging {
  color: var(--accent);
  background: rgba(74, 158, 255, 0.12);
}

.status-finishing {
  color: var(--orange);
  background: rgba(255, 149, 0, 0.12);
}

/* Power Bar */
.power-section {
  margin-bottom: 14px;
}

.power-bar-bg {
  position: relative;
  height: 8px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
}

.power-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s ease-out, background-color 0.3s;
}

.power-bar-limit {
  position: absolute;
  top: -2px;
  height: 12px;
  width: 2px;
  background: var(--red);
  border-radius: 1px;
  transition: left 0.5s ease-out, opacity 0.3s;
  opacity: 0;
}

.power-bar-limit.visible {
  opacity: 1;
}

.power-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 6px;
}

.power-current {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  transition: color 0.3s;
}

.power-limit-label {
  font-size: 11px;
  color: var(--text-dim);
  transition: color 0.3s, opacity 0.3s;
  opacity: 0;
}

.power-limit-label.visible {
  opacity: 1;
  color: var(--orange);
}

/* Session Info */
.session-info {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  min-height: 36px;
}

.session-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-stat-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.session-stat-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Card Action */
.card-action {
  margin-top: auto;
}


/* ─── Footer ─── */

.demo-footer {
  text-align: center;
  padding: 32px 24px 40px;
  max-width: 640px;
  margin: 0 auto;
}

.demo-footer .btn-secondary {
  margin-bottom: 20px;
}

.explainer {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.footer-logo {
  height: 22px;
  opacity: 0.7;
}

.brand-sep {
  color: var(--border);
}


/* ─── Guided Tour ─── */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  transition: clip-path 0.3s ease;
}

.tour-overlay.hidden {
  display: none;
}

.tour-tooltip {
  position: fixed;
  z-index: 1001;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 360px;
  width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tour-tooltip.hidden {
  display: none;
}

.tour-step-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.tour-tooltip h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.tour-tooltip p {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 16px;
}

.tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tour-actions .btn {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 12px;
}


/* ─── Responsive ─── */

@media (max-width: 1080px) {
  .charger-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 32px 16px 24px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 14px;
  }

  .group-section {
    padding: 16px 12px 0;
  }

  .group-gauge {
    padding: 16px;
  }

  .group-stats {
    gap: 16px;
  }

  .chargers-section {
    padding: 16px 12px;
  }

  .charger-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .charger-card {
    padding: 16px;
  }

  .ev-illustration {
    height: 80px;
  }

  .tour-tooltip {
    max-width: calc(100vw - 24px);
  }
}


/* ─── Utility ─── */

.hidden {
  display: none !important;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
