/* ─── EXPLORER PANEL — Theme-agnostic floating panel ─────────── */
/* This panel MUST remain visually independent from any theme.     */
/* Uses its own font stack, colors, and z-index layer.             */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Panel Toggle Button ─────────────────────────────────────── */
.explorer-toggle {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 100000;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: none;
  background: #111827;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}
.explorer-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 44px -10px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1);
}
.explorer-toggle:active {
  transform: scale(0.95);
}
.explorer-toggle svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}
.explorer-toggle.open svg {
  transform: rotate(180deg);
}

/* ── Backdrop ────────────────────────────────────────────────── */
.explorer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.explorer-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Panel Container ─────────────────────────────────────────── */
.explorer-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 99999;
  width: 340px;
  background: #111827;
  border-right: 1px solid #1F2937;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 20px 0 60px -15px rgba(0,0,0,0.5);
  overflow: hidden;
}
.explorer-panel.open {
  transform: translateX(0);
}

/* ── Panel Header ────────────────────────────────────────────── */
.explorer-header {
  padding: 24px 24px 20px;
  border-bottom: 1px solid #1F2937;
  flex-shrink: 0;
}
.explorer-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.explorer-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6B7280;
}
.explorer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.explorer-close:hover {
  background: #1F2937;
  color: #E5E7EB;
}
.explorer-close svg {
  width: 18px;
  height: 18px;
}
.explorer-subtitle {
  font-size: 13px;
  color: #9CA3AF;
  line-height: 1.5;
  margin-top: 8px;
}

/* ── Theme Options ───────────────────────────────────────────── */
.explorer-options {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.explorer-options::-webkit-scrollbar {
  width: 4px;
}
.explorer-options::-webkit-scrollbar-track {
  background: transparent;
}
.explorer-options::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

/* ── Theme Option Button ─────────────────────────────────────── */
.explorer-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #1F2937;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: #E5E7EB;
  transition: all 0.2s ease;
  font-family: inherit;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.explorer-option:hover {
  background: #1F2937;
  border-color: #374151;
}
.explorer-option.active {
  background: rgba(14, 165, 233, 0.08);
  border-color: #0EA5E9;
}
.explorer-option.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: #0EA5E9;
  border-radius: 0 3px 3px 0;
}

/* Badge */
.explorer-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* Text */
.explorer-opt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.explorer-opt-name {
  font-size: 14px;
  font-weight: 600;
  color: #F3F4F6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.explorer-opt-desc {
  font-size: 12px;
  color: #9CA3AF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active checkmark */
.explorer-check {
  margin-left: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0EA5E9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.explorer-option.active .explorer-check {
  opacity: 1;
  transform: scale(1);
}
.explorer-check svg {
  width: 12px;
  height: 12px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
}

/* ── Panel Footer ────────────────────────────────────────────── */
.explorer-footer {
  padding: 16px 24px;
  border-top: 1px solid #1F2937;
  flex-shrink: 0;
}
.explorer-footer-text {
  font-size: 11px;
  color: #4B5563;
  text-align: center;
  line-height: 1.5;
}
.explorer-footer-text strong {
  color: #9CA3AF;
  font-weight: 600;
}

/* ── Loading State ───────────────────────────────────────────── */
.explorer-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99997;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.explorer-loading.active {
  opacity: 1;
  pointer-events: all;
}
.explorer-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #0EA5E9;
  border-radius: 50%;
  animation: explorerSpin 0.8s linear infinite;
}
.explorer-loading-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: #9CA3AF;
  font-weight: 500;
}
@keyframes explorerSpin {
  to { transform: rotate(360deg); }
}

/* ── Page Container Transitions ──────────────────────────────── */
#app-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#app-container.fade-out {
  opacity: 0;
  transform: translateY(8px);
}
#app-container.fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Prevent overlap: push theme WA floats above explorer toggle ── */
[class*="-wa-float"] {
  bottom: 92px !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .explorer-panel {
    width: 100%;
    max-width: 340px;
  }
  .explorer-toggle {
    bottom: 90px; /* above mobile bars */
    left: 16px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  [class*="-wa-float"] {
    bottom: 152px !important;
  }
}

/* ── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .explorer-panel,
  .explorer-toggle,
  .explorer-option,
  .explorer-check,
  #app-container {
    transition-duration: 0.01ms !important;
  }
  .explorer-spinner {
    animation: none;
  }
}
