/* pulsr.css — Light business theme for Pulsr brand identity app */
/* Design tokens: blue-600 → violet-700 gradient, slate backgrounds */

.pulsr-light p { text-align: center !important; }

header.fixed { z-index: 9999 !important; }
header > div.max-w-7xl {
  flex-direction: row !important;
  height: auto !important;
}
header > div.max-w-7xl .flex.items-center.gap-3 {
  flex-direction: row !important;
  border-bottom: none !important;
  padding: 0 !important;
  text-align: left !important;
  margin: 0 !important;
}

/* Prevent descender clip on gradient headings */
.bg-clip-text.text-transparent { line-height: 1.15; }

@media (max-width: 768px) {
  #home { padding-top: 50px; }
  .max-w-7xl {
    flex-direction: column;
    height: auto;
    padding: 15px;
  }
  .flex.items-center.gap-3, nav.space-x-6 {
    padding: 20px 0 10px 0;
    text-align: center;
    margin: 0 auto;
    font-size: 14px !important;
  }
  .flex.items-center.gap-3 {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 15px;
    text-align: center;
    margin: 0 auto;
  }
  .space-x-6 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 0 !important;
    margin-right: calc(0.3rem * var(--tw-space-x-reverse)) !important;
    margin-left: calc(0.3rem * calc(1 - var(--tw-space-x-reverse))) !important;
  }
}

/* ── Typography ─────────────────────────────────────────────── */
body.pulsr-light {
  background: #f1f5f9;
  color: #0f172a;
}
body.pulsr-light h4 {
  color: #0f172a;
  font-size: 16px;
  font-family: 'Inter', system-ui, sans-serif;
  text-align: center;
  margin: 0;
}
body.pulsr-light p {
  color: #0f172a;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  text-align: left;
  margin: 0;
}
body.pulsr-light p.centertext {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
  margin: auto;
  font-family: inherit;
}

/* ── Canvas container ───────────────────────────────────────── */
#contain {
  position: relative;
  display: block;
  width: 600px !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: 12px;
  background: #000;
}
#contain:fullscreen,
#contain:-webkit-full-screen,
#contain:-moz-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}
#contain:fullscreen #app-container,
#contain:-webkit-full-screen #app-container,
#contain:-moz-full-screen #app-container {
  border-radius: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
  animation: none !important;
}
#contain:fullscreen canvas,
#contain:-webkit-full-screen canvas,
#contain:-moz-full-screen canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

#app-container {
  position: relative;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  background-image:
    linear-gradient(transparent, transparent),
    linear-gradient(135deg, #2563eb, #7c3aed);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 0 15px rgba(37, 99, 235, 0.5),
    0 0 30px rgba(124, 58, 237, 0.4),
    0 0 60px rgba(37, 99, 235, 0.3),
    0 6px 30px rgba(0,0,0,0.15);
  animation: pulsr-pulse 3s infinite ease-in-out;
}
@keyframes pulsr-pulse {
  0%   { box-shadow: 0 0 10px rgba(37,99,235,0.4), 0 0 20px rgba(124,58,237,0.3), 0 0 40px rgba(37,99,235,0.2), 0 4px 20px rgba(0,0,0,0.12); }
  50%  { box-shadow: 0 0 20px rgba(37,99,235,0.6), 0 0 40px rgba(124,58,237,0.5), 0 0 60px rgba(37,99,235,0.4), 0 6px 25px rgba(0,0,0,0.18); }
  100% { box-shadow: 0 0 10px rgba(37,99,235,0.4), 0 0 20px rgba(124,58,237,0.3), 0 0 40px rgba(37,99,235,0.2), 0 4px 20px rgba(0,0,0,0.12); }
}

.container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  padding-top: 56.25%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

canvas {
  display: block;
  width: 600px !important;
  height: 338px !important;
  border-radius: 12px;
  margin: 0 auto;
  max-width: 100%;
  max-height: 100%;
}

#controls {
  max-width: 600px !important;
  margin: 0 auto;
}

/* ── Control rows ───────────────────────────────────────────── */
.ctrl-row { margin: 2px 0 6px; }
.ctrl-row input[type=range] { margin: 1px 0 0; }
.ctrl-top { display: flex; justify-content: space-between; align-items: baseline; }
.ctrl-label { color: #64748b; font-size: 0.72rem; font-family: 'Inter', system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.ctrl-val { color: #0f172a; font-size: 0.7rem; font-family: monospace; min-width: 3.5rem; text-align: right; }
.ctrl-hints { display: flex; justify-content: space-between; }
.ctrl-hint { color: #cbd5e1; font-size: 0.6rem; }

/* ── Sliders — Pulsr blue/violet theme ───────────────────────── */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  margin: 16px 0;
  background: transparent;
}
input[type=range]:focus { outline: none; }

/* Thumb */
input.range-pulsr[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  cursor: pointer;
  margin-top: -5px;
  box-shadow: 0 0 6px rgba(37,99,235,0.5), 0 0 12px rgba(124,58,237,0.3);
  transition: all 0.2s ease;
}
input.range-pulsr[type=range]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 10px rgba(37,99,235,0.7), 0 0 20px rgba(124,58,237,0.5);
  border-color: #7c3aed;
}
input.range-pulsr[type=range]::-moz-range-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(37,99,235,0.5), 0 0 12px rgba(124,58,237,0.3);
  transition: all 0.2s ease;
}
input.range-pulsr[type=range]::-ms-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(37,99,235,0.5);
}

/* Track */
input.range-pulsr[type=range]::-webkit-slider-runnable-track {
  height: 6px;
  cursor: pointer;
  border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  box-shadow: 0 0 4px rgba(37,99,235,0.3);
}
input.range-pulsr[type=range]::-moz-range-track {
  height: 6px;
  cursor: pointer;
  border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}
input.range-pulsr[type=range]::-ms-track {
  height: 6px;
  cursor: pointer;
  border-radius: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-color: transparent;
  color: transparent;
}

/* ── Misc ───────────────────────────────────────────────────── */
label { color: #ffffff; font-family: 'Inter', system-ui, sans-serif; }
input:not([type=checkbox]):not([type=radio]) { width: 100%; }

#fullscreenBtn {
  position: relative;
  top: 0;
  z-index: 10;
  padding: 8px 16px;
  font-size: 20px;
  background: #ffffff;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
#fullscreenBtn:hover { background: #f8fafc; color: #2563eb; border-color: #2563eb; }

/* ── Audio meter ────────────────────────────────────────────── */
#pulsr-audio-meter {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin: 4px 0 8px;
}
#pulsr-audio-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 3px;
  transition: width 0.05s linear;
}

/* beat indicator */
#pulsr-beat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.1s;
}
#pulsr-beat-dot.active { background: #2563eb; box-shadow: 0 0 8px rgba(37,99,235,0.8); }

/* ── Brand text overlay ─────────────────────────────────────── */
#pulsr-text-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 20;
  white-space: pre-wrap;
  text-align: center;
  word-break: break-word;
}

/* ── Panel cards (light) ────────────────────────────────────── */
.pulsr-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.pulsr-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pulsr-panel-title svg { width: 14px; height: 14px; color: #2563eb; }

/* ── Color swatches ─────────────────────────────────────────── */
.brand-color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.brand-color-label { font-size: 0.72rem; color: #64748b; width: 68px; flex-shrink: 0; }
input[type=color].brand-swatch {
  width: 36px;
  height: 28px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}
input[type=color].brand-swatch::-webkit-color-swatch-wrapper { padding: 0; border-radius: 4px; }
input[type=color].brand-swatch::-webkit-color-swatch { border: none; border-radius: 4px; }

/* ── Tab buttons ────────────────────────────────────────────── */
.pulsr-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.pulsr-tab {
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s;
}
.pulsr-tab:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.pulsr-tab.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  border-color: transparent;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  main { max-width: 100%; padding: 20px; }
  #contain { width: 100% !important; }
  canvas { width: 100% !important; height: auto !important; }
}

/* Camera canvas must always fill its container — overrides the mobile canvas reset above
   (ID selector specificity beats the type selector in the media query) */
#camera-canvas {
  width: 100% !important;
  height: 100% !important;
}
