/* ========================================
   Light App - Core Styles
   Phase 1: MVP Color Light
   ======================================== */

/* --- Reset & Base --- */

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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background-color: #2a2a2a;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background-color 0.15s ease;
}

/* --- Intensity Overlay --- */

.intensity-overlay {
  position: fixed;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.1s ease;
}

/* --- App Container --- */

.app-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  max-width: 90vw;
  max-height: 90vh;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --- Control Panel --- */

.control-panel {
  width: auto;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 32px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-panel.hidden {
  display: none;
}

/* --- Color Swatches --- */

.swatches {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.swatch {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.swatch:active {
  transform: scale(0.92);
}

.swatch.active {
  box-shadow: 0 0 0 3px white;
}

/* --- Recent Colors --- */

.recent-colors {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.recent-colors.hidden {
  display: none;
}

.recent-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
}

.recent-swatches {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.recent-swatch {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  background: none;
}

.recent-swatch:active {
  transform: scale(0.92);
}

.recent-swatch.active {
  box-shadow: 0 0 0 2px white;
}

/* --- Hex Input + Color Picker --- */

.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hex-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.15s ease;
}

.hex-input-wrapper.valid {
  border-color: rgba(255, 255, 255, 0.35);
}

.hex-input-wrapper.invalid {
  border-color: rgba(255, 80, 80, 0.6);
}

.hex-prefix {
  font-size: 15px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
  margin-right: 2px;
}

.hex-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  width: 100%;
}

.hex-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.hex-apply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
  padding: 0;
}

.hex-apply-btn:active {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.picker-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  background-color: #2A2A2A;
  overflow: hidden;
  transition: transform 0.1s ease;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  padding: 0;
}

.picker-btn:active {
  transform: scale(0.92);
}

.color-picker-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* --- FX Scenes --- */

.fx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.fx-scenes {
  display: flex;
  gap: 8px;
}

.fx-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.fx-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

.fx-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.fx-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fx-dot-police {
  background: linear-gradient(90deg, #FF0000 50%, #0044FF 50%);
}

.fx-dot-fire {
  background: #FF6600;
}

.fx-dot-storm {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- Speed Toggle --- */

.speed-toggle {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

.speed-toggle.hidden {
  display: none;
}

.speed-btn {
  flex: 1;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none;
}

.speed-btn:first-child {
  border-radius: 8px 0 0 8px;
}

.speed-btn:last-child {
  border-radius: 0 8px 8px 0;
}

.speed-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.speed-btn:active {
  background: rgba(255, 255, 255, 0.2);
}

/* --- Intensity Slider --- */

.intensity-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intensity-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  user-select: none;
}

.intensity-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  cursor: pointer;
}

/* Slider track - WebKit */
.intensity-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
}

/* Slider thumb - WebKit */
.intensity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  margin-top: -11px;
}

/* Slider track - Firefox */
.intensity-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
}

/* Slider thumb - Firefox */
.intensity-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  border: none;
}

/* --- Fullscreen Button --- */

.fullscreen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s ease;
  outline: none;
}

.fullscreen-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

.fullscreen-icon {
  flex-shrink: 0;
}

/* --- Branding --- */

.branding {
  position: fixed;
  bottom: 14px;
  right: 48px;
  z-index: 2;
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  font-size: 11px;
  color: white;
  text-decoration: none;
  user-select: none;
  pointer-events: auto;
  mix-blend-mode: difference;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.branding:hover {
  mix-blend-mode: normal;
  background: #1a1a1a;
  color: #f5c518;
}

.branding:active {
  opacity: 0.7;
}

/* --- Info Button --- */

.info-btn {
  position: fixed;
  bottom: 12px;
  right: 16px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid white;
  background: none;
  color: white;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  mix-blend-mode: difference;
  transition: all 0.2s ease;
  outline: none;
  padding: 0;
}

.info-btn:hover {
  mix-blend-mode: normal;
  background: #1a1a1a;
  color: #f5c518;
  border-color: #f5c518;
}

/* --- Info Panel --- */

.info-panel {
  width: 380px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 28px 24px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  line-height: 1.6;
}

.info-panel.hidden {
  display: none;
}

.info-panel h2 {
  font-size: 18px;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

.info-panel p {
  margin-bottom: 12px;
}

.info-panel ul {
  list-style: none;
  padding: 0;
  margin-bottom: 16px;
}

.info-panel ul li {
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.info-panel ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
}

.info-panel a {
  color: #f5c518;
  text-decoration: none;
}

.info-panel a:hover {
  text-decoration: underline;
}

.info-panel .info-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.info-close-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  outline: none;
}

.info-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}
