/* planet-fx.css — Planet FX panel and dock button styles */

/* ─────────────────────────────────────────────
   Dock button
───────────────────────────────────────────── */
#module-planet-fx .module-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

#module-planet-fx .pfx-btn-icon {
  width: 44px;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Planet body */
#module-planet-fx .pfx-btn-planet {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 32%, #c8a0ff 0%, #7c3aed 52%, #3b1573 100%);
  box-shadow: 0 0 8px rgba(160, 110, 255, 0.7), inset -3px -2px 6px rgba(0,0,0,0.4);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Animated ring around planet */
#module-planet-fx .pfx-btn-ring {
  position: absolute;
  width: 38px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(200, 160, 255, 0.75);
  box-shadow: 0 0 6px rgba(180, 130, 255, 0.5);
  animation: pfx-ring-spin 3.2s linear infinite;
  transform-origin: center center;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

@keyframes pfx-ring-spin {
  0%   { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

/* Active / hover states mirror other module cards */
#module-planet-fx.is-active {
  background: rgba(160, 110, 255, 0.18);
  border-color: rgba(160, 110, 255, 0.55);
}

#module-planet-fx.is-active .pfx-btn-ring {
  border-color: rgba(220, 190, 255, 0.9);
  box-shadow: 0 0 10px rgba(200, 160, 255, 0.75);
  animation-duration: 1.6s;
}

/* ─────────────────────────────────────────────
   Panel
───────────────────────────────────────────── */
.pfx-panel {
  position: fixed;
  right: 88px;
  top: 56px;
  width: 264px;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 110, 255, 0.3) transparent;

  background: rgba(8, 4, 22, 0.88);
  border: 1px solid rgba(160, 110, 255, 0.22);
  border-radius: 14px;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(130, 60, 255, 0.12);

  padding: 0;
  z-index: 9000;

  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transform-origin: top right;
  transition:
    opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pfx-panel--open {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

/* ── Header ── */
.pfx-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(160, 110, 255, 0.14);
  position: sticky;
  top: 0;
  background: rgba(8, 4, 22, 0.92);
  backdrop-filter: blur(12px);
  z-index: 1;
  border-radius: 14px 14px 0 0;
  cursor: grab;
  user-select: none;
}
.pfx-panel-header:active {
  cursor: grabbing;
}

.pfx-panel-title {
  font-family: "Syne", "IBM Plex Mono", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(210, 185, 255, 0.9);
}

.pfx-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(180, 150, 255, 0.55);
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 150ms, background 150ms;
}
.pfx-panel-close:hover {
  color: rgba(220, 200, 255, 0.9);
  background: rgba(160, 110, 255, 0.14);
}

/* ── Sections ── */
.pfx-section {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(160, 110, 255, 0.08);
}
.pfx-section:last-child {
  border-bottom: none;
  padding-bottom: 18px;
}

.pfx-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pfx-section-label {
  font-family: "IBM Plex Mono", monospace, system-ui;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(180, 150, 255, 0.65);
}

/* ── Controls area ── */
.pfx-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 200ms;
}
.pfx-controls--disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Row ── */
.pfx-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pfx-label {
  font-family: "IBM Plex Mono", monospace, system-ui;
  font-size: 10px;
  color: rgba(200, 175, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pfx-val {
  color: rgba(210, 190, 255, 0.85);
  font-variant-numeric: tabular-nums;
}

/* ── Slider ── */
.pfx-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(160, 110, 255, 0.18);
  outline: none;
  cursor: pointer;
  transition: background 150ms;
}
.pfx-slider:hover {
  background: rgba(160, 110, 255, 0.3);
}
.pfx-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #d4b0ff, #8b4cf7);
  box-shadow: 0 0 0 2px rgba(160, 110, 255, 0.35), 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 120ms, box-shadow 120ms;
}
.pfx-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px rgba(180, 130, 255, 0.5), 0 2px 8px rgba(0,0,0,0.5);
}
.pfx-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 38% 36%, #d4b0ff, #8b4cf7);
  box-shadow: 0 0 0 2px rgba(160, 110, 255, 0.35), 0 2px 6px rgba(0,0,0,0.5);
  cursor: pointer;
}

/* ── Dual-color + gradient row ── */
.pfx-color-row {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  flex-wrap: wrap;
}
.pfx-color-row .pfx-label {
  font-size: 9px;
  white-space: nowrap;
}

/* ── Color picker ── */
.pfx-color {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(160, 110, 255, 0.3);
  background: none;
  padding: 1px;
  cursor: pointer;
}
.pfx-color::-webkit-color-swatch-wrapper {
  padding: 0;
}
.pfx-color::-webkit-color-swatch {
  border-radius: 3px;
  border: none;
}

/* ── Preset grid (5 atmosphere presets) ── */
.pfx-preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 8px;
}

.pfx-preset-btn {
  background: rgba(100, 55, 180, 0.12);
  border: 1px solid rgba(160, 110, 255, 0.18);
  border-radius: 8px;
  color: rgba(190, 165, 255, 0.65);
  font-family: "IBM Plex Mono", monospace, system-ui;
  font-size: 16px;
  line-height: 1;
  padding: 7px 2px 5px;
  cursor: pointer;
  text-align: center;
  transition: background 160ms, border-color 160ms, color 160ms, transform 120ms;
}
.pfx-preset-btn span {
  display: block;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 3px;
  color: rgba(180, 155, 255, 0.6);
  transition: color 160ms;
}
.pfx-preset-btn:hover {
  background: rgba(160, 100, 255, 0.22);
  border-color: rgba(190, 150, 255, 0.4);
  color: rgba(230, 215, 255, 0.9);
  transform: translateY(-1px);
}
.pfx-preset-btn:hover span { color: rgba(210, 195, 255, 0.85); }

.pfx-preset-btn--active {
  background: rgba(140, 80, 255, 0.28);
  border-color: rgba(200, 160, 255, 0.55);
  color: rgba(240, 225, 255, 1);
  box-shadow: 0 0 10px rgba(160, 100, 255, 0.25);
}
.pfx-preset-btn--active span { color: rgba(220, 205, 255, 0.9); }

/* ── Subsections ── */
.pfx-subsection {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(160, 110, 255, 0.07);
}
.pfx-subsection:last-child { border-bottom: none; margin-bottom: 0; }

/* Ring lightning sub-controls — indented inside the pfx-controls area */
#pfx-ring-light-ctrl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 2px 4px;
}
#pfx-ring-light-ctrl.pfx-controls--disabled {
  opacity: 0.3;
  pointer-events: none;
}

.pfx-sub-label {
  font-size: 9px !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(160, 135, 220, 0.55) !important;
  margin-bottom: 6px;
  display: block;
}

.pfx-ring-shape-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.pfx-ring-shape-card {
  min-height: 0;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
}

.pfx-ring-shape-card .custom-texture-chip-preview {
  border-radius: 9px;
}

.pfx-ring-shape-card .custom-texture-chip-name {
  font-size: 0.5rem;
  letter-spacing: 0.03em;
}

/* ── Layer list (per-preset cloud layer controls) ── */
.pfx-layer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Each layer = header row + slider block */
.pfx-layer-block {
  border-radius: 7px;
  background: rgba(130, 80, 255, 0.06);
  border: 1px solid rgba(160, 110, 255, 0.09);
  overflow: hidden;
}

.pfx-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(130, 80, 255, 0.08);
}

.pfx-layer-name {
  font-family: "IBM Plex Mono", monospace, system-ui;
  font-size: 10px;
  font-weight: 600;
  color: rgba(210, 185, 255, 0.82);
  letter-spacing: 0.04em;
}

/* Slider sub-block inside a layer */
.pfx-layer-sliders {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 10px;
  transition: opacity 180ms;
}
.pfx-layer-sliders--off {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Toggle switch ── */
.pfx-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.pfx-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pfx-toggle-track {
  display: block;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: rgba(100, 60, 180, 0.25);
  border: 1px solid rgba(160, 110, 255, 0.25);
  transition: background 200ms, border-color 200ms;
  position: relative;
}

.pfx-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(180, 150, 255, 0.55);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1), background 200ms;
}

.pfx-toggle input:checked + .pfx-toggle-track {
  background: rgba(130, 70, 255, 0.5);
  border-color: rgba(190, 150, 255, 0.5);
}

.pfx-toggle input:checked + .pfx-toggle-track::after {
  transform: translateX(14px);
  background: #c8a0ff;
  box-shadow: 0 0 6px rgba(200, 160, 255, 0.7), 0 1px 3px rgba(0,0,0,0.4);
}
