/* ============================================================================
 * Pocket Austin — Track 3.9: Live Wind-Driven Weather FX, Cloud Shadows &
 * Lady Bird Lake Fireworks
 * Warm ligne claire parchment aesthetic matching #pa-explore-dock
 * ============================================================================ */

#pa-skyfx-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 100%;
}

/* Self-contained fallback styling if discovery_layers.css is absent */
#pa-skyfx-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--border, #4a3b2c);
  background: var(--paper, rgba(251, 246, 234, 0.95));
  color: var(--ink, #2c221a);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 15, 10, 0.22);
  backdrop-filter: blur(8px);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  white-space: nowrap;
}

#pa-skyfx-btn:hover {
  background: #f2e8d2;
  transform: translateY(-1px);
}

#pa-skyfx-btn:focus-visible {
  outline: 2px solid #c45735;
  outline-offset: 2px;
}

#pa-skyfx-btn.is-open {
  background: #4a3b2c;
  color: #fbf6ea;
  border-color: #2c221a;
}

#pa-skyfx-btn.mode-clouds:not(.is-open) {
  border-color: #5b6380;
}

#pa-skyfx-btn.mode-rain:not(.is-open) {
  border-color: #4c8e88;
  background: rgba(232, 244, 242, 0.96);
  color: #1e3f3d;
}

#pa-skyfx-btn.mode-fireworks:not(.is-open) {
  border-color: #bf5700;
  background: rgba(255, 242, 224, 0.96);
  color: #6b2d00;
}

#pa-skyfx-btn.mode-clear:not(.is-open) {
  border-style: dashed;
  opacity: 0.88;
}

.pa-skyfx-ico {
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.pa-skyfx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  display: none;
  background: #4c8e88;
}

#pa-skyfx-btn.has-fx .pa-skyfx-dot {
  display: inline-block;
}

#pa-skyfx-btn.mode-clouds .pa-skyfx-dot {
  background: #5b6380;
}

#pa-skyfx-btn.mode-rain .pa-skyfx-dot {
  background: #4c8e88;
}

#pa-skyfx-btn.mode-fireworks .pa-skyfx-dot {
  background: #bf5700;
  box-shadow: 0 0 0 2px rgba(245, 194, 107, 0.55);
  animation: paSkyFxPulse 1.5s ease-in-out infinite;
}

#pa-skyfx-btn.is-open .pa-skyfx-dot {
  background: #f5c26b;
}

.pa-skyfx-caret {
  font-size: 9px;
  opacity: 0.72;
  margin-left: 1px;
  transition: transform 0.16s ease;
}

#pa-skyfx-btn.is-open .pa-skyfx-caret {
  transform: rotate(180deg);
}

@keyframes paSkyFxPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.7;
  }
}

/* Compact Parchment Dropdown Menu */
#pa-skyfx-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 42;
  width: 256px;
  max-width: calc(100vw - 24px);
  display: none;
  flex-direction: column;
  background: rgba(251, 246, 234, 0.97);
  border: 1.5px solid #4a3b2c;
  border-radius: 11px;
  box-shadow: 0 10px 28px rgba(20, 15, 10, 0.30);
  backdrop-filter: blur(10px);
  color: #2c221a;
  overflow: hidden;
  box-sizing: border-box;
}

#pa-skyfx-menu.open {
  display: flex;
  animation: paSkyFxMenuIn 0.15s ease-out;
}

@keyframes paSkyFxMenuIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pa-skyfx-head {
  padding: 9px 11px 8px;
  border-bottom: 1px solid rgba(74, 59, 44, 0.16);
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.92), rgba(244, 236, 218, 0.6));
}

.pa-skyfx-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pa-skyfx-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-weight: 700;
  color: #2c221a;
  line-height: 1.15;
}

.pa-skyfx-live-badge {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4c8e88;
  background: rgba(76, 142, 136, 0.12);
  border: 1px solid rgba(76, 142, 136, 0.32);
  border-radius: 999px;
  padding: 1.5px 6px;
  white-space: nowrap;
}

.pa-skyfx-telemetry {
  margin-top: 3px;
  font-size: 10.5px;
  color: #665848;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pa-skyfx-list {
  display: flex;
  flex-direction: column;
  padding: 5px;
  gap: 3px;
}

.pa-skyfx-opt {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #2c221a;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.pa-skyfx-opt:hover {
  background: rgba(74, 59, 44, 0.07);
}

.pa-skyfx-opt:focus-visible {
  outline: 2px solid #c45735;
  outline-offset: -1px;
}

.pa-skyfx-opt.is-active {
  background: rgba(196, 87, 53, 0.11);
  border-color: rgba(196, 87, 53, 0.42);
}

.pa-skyfx-opt[data-mode="rain"].is-active {
  background: rgba(76, 142, 136, 0.12);
  border-color: rgba(76, 142, 136, 0.44);
}

.pa-skyfx-opt[data-mode="fireworks"].is-active {
  background: rgba(191, 87, 0, 0.12);
  border-color: rgba(191, 87, 0, 0.46);
}

.pa-skyfx-opt-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(74, 59, 44, 0.07);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.pa-skyfx-opt.is-active .pa-skyfx-opt-ico {
  background: rgba(255, 252, 244, 0.92);
  box-shadow: 0 1px 3px rgba(44, 34, 26, 0.14);
}

.pa-skyfx-opt-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.pa-skyfx-opt-name {
  font-size: 11.8px;
  font-weight: 700;
  color: #2c221a;
  line-height: 1.2;
}

.pa-skyfx-opt-desc {
  font-size: 10.2px;
  color: #665848;
  line-height: 1.2;
}

.pa-skyfx-opt-check {
  font-size: 12px;
  font-weight: 800;
  color: #c45735;
  opacity: 0;
  flex-shrink: 0;
  transition: opacity 0.12s ease;
}

.pa-skyfx-opt[data-mode="rain"] .pa-skyfx-opt-check {
  color: #4c8e88;
}

.pa-skyfx-opt[data-mode="fireworks"] .pa-skyfx-opt-check {
  color: #bf5700;
}

.pa-skyfx-opt.is-active .pa-skyfx-opt-check {
  opacity: 1;
}

.pa-skyfx-foot {
  padding: 6px 10px 7px;
  border-top: 1px solid rgba(74, 59, 44, 0.12);
  background: rgba(244, 236, 218, 0.42);
  font-size: 10px;
  color: #665848;
  line-height: 1.3;
  display: none;
}

.pa-skyfx-foot.visible {
  display: block;
}

@media (max-width: 760px) {
  #pa-skyfx-btn {
    padding: 5px 9px;
    font-size: 11.2px;
  }

  #pa-skyfx-menu {
    width: min(252px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
  }
}
