/**
 * demo.css
 * --------
 * Split-screen layout: left panel (WifiWhirl UI), right panel (virtual whirlpool).
 * Responsive: side-by-side on desktop, stacked on mobile.
 */

/* ========================================================================= */
/* Reset & Base                                                               */
/* ========================================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --accent: #4051b5;
  --bg-dark: #1a1a2e;
  --bg-panel: #16213e;
  --text-light: #e0e0e0;
  --text-muted: #8a8a9a;
  --border-color: #2a2a4a;
  --pool-water: #1a8cb0;
  --pool-water-dark: #0e5a73;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family:
    "Segoe UI", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  overflow: hidden;
}

/* ========================================================================= */
/* Top banner                                                                 */
/* ========================================================================= */
.demo-banner {
  background: linear-gradient(135deg, var(--accent) 0%, #2d3a8c 100%);
  color: white;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.95em;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 44px;
  flex-shrink: 0;
}

.demo-banner .demo-tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.demo-banner .demo-title {
  font-weight: 300;
  font-size: 1.05em;
}

/* ========================================================================= */
/* Main container: split-screen                                               */
/* ========================================================================= */
.demo-container {
  display: flex;
  height: calc(100vh - 44px);
  overflow: hidden;
}

/* ========================================================================= */
/* Left panel: WifiWhirl UI iframe                                            */
/* ========================================================================= */
.panel-left {
  width: 440px;
  min-width: 340px;
  max-width: 480px;
  flex-shrink: 0;
  border-right: 2px solid var(--border-color);
  position: relative;
  background: #dfdfdf;
  overflow: hidden;
}

.panel-left iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.panel-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  padding: 4px 0;
  font-size: 0.75em;
  letter-spacing: 1px;
  text-transform: uppercase;
  z-index: 100;
  pointer-events: none;
  opacity: 0.7;
}

/* ========================================================================= */
/* Right panel: Virtual whirlpool                                             */
/* ========================================================================= */
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0f0f23 0%, #1a1a2e 40%, #16213e 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.panel-right canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

/* ========================================================================= */
/* Pump status panel (below the pool)                                         */
/* ========================================================================= */
.pump-status {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.status-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: center;
  min-width: 90px;
  transition: all 0.3s ease;
}

.status-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(64, 81, 181, 0.3);
}

.status-item .label {
  font-size: 0.7em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.status-item .value {
  font-size: 1.1em;
  font-weight: 600;
}

.status-item .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  background: #555;
  transition: background 0.3s ease;
}

.status-item.active .indicator {
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.status-item.heating .indicator {
  background: #f44336;
  box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}

.status-item.standby .indicator {
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

/* ========================================================================= */
/* Temperature display overlay on canvas area                                 */
/* ========================================================================= */
.temp-overlay {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  gap: 24px;
  z-index: 5;
}

/* ========================================================================= */
/* Responsive: stack on narrow screens                                        */
/* ========================================================================= */
@media (max-width: 900px) {
  .demo-container {
    flex-direction: column;
  }

  .panel-left {
    width: 100%;
    max-width: 100%;
    min-width: unset;
    height: 55vh;
    border-right: none;
    border-bottom: 2px solid var(--border-color);
  }

  .panel-right {
    height: 45vh;
    padding: 10px;
  }
}

@media (max-width: 500px) {
  .demo-banner {
    font-size: 0.8em;
    padding: 8px 12px;
    height: 38px;
  }

  .demo-container {
    height: calc(100vh - 38px);
  }

  .panel-left {
    height: 60vh;
  }

  .panel-right {
    height: 40vh;
  }

  .pump-status {
    gap: 8px;
  }

  .status-item {
    padding: 6px 10px;
    min-width: 70px;
  }
}
