/* ============================================================
   area-comparison.css — Fallout Bright Area Comparison Panel
   RadiaMaps — Feature P2-9
   ============================================================ */

/* ── Panel Wrapper ─────────────────────────────────────────── */
#area-comparison-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 9000;
  width: 680px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  font-family: var(--font-display), monospace;
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
  padding: 16px;
  box-sizing: border-box;
}

/* Scrollbar */
#area-comparison-panel::-webkit-scrollbar {
  width: 4px;
}
#area-comparison-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}
#area-comparison-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 224, 48, 0.4);
  border-radius: var(--radius-sm);
}

/* ── Panel Header ──────────────────────────────────────────── */
.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-medium);
  padding-bottom: 10px;
}

.comparison-header h2 {
  color: var(--primary);
  font-size: 1.4em;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 0 8px rgba(255, 224, 48, 0.5);
}

.comparison-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 224, 48, 0.4);
  color: var(--primary);
  font-family: var(--font-display), monospace;
  font-size: 1.2em;
  cursor: pointer;
  padding: 2px 10px;
  border-radius: 2px;
  transition: background 0.2s, box-shadow 0.2s;
  line-height: 1.4;
}

.comparison-close-btn:hover {
  background: var(--primary-dim);
  box-shadow: 0 0 8px rgba(255, 224, 48, 0.3);
}

/* ── Area Selector Section ─────────────────────────────────── */
.area-selector-section {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.area-selector-section label {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.area-selector-section select {
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  color: var(--text-primary);
  font-family: var(--font-display), monospace;
  font-size: 1em;
  padding: 4px 8px;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
  min-width: 160px;
  transition: box-shadow 0.2s;
}

.area-selector-section select:focus {
  box-shadow: 0 0 8px rgba(255, 224, 48, 0.4);
}

.area-selector-section select option {
  background: var(--bg-base);
  color: var(--text-primary);
}

/* ── Compare Button ────────────────────────────────────────── */
.compare-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-display), monospace;
  font-size: 1.1em;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  align-self: flex-end;
}

.compare-btn:hover {
  background: var(--primary-dim);
  box-shadow: 0 0 12px rgba(255, 224, 48, 0.4), 0 0 4px rgba(255, 224, 48, 0.6);
  color: #ffffff;
}

.compare-btn:active {
  background: rgba(255, 224, 48, 0.2);
}

/* ── Comparison Columns ────────────────────────────────────── */
.comparison-columns {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
}

/* ── Individual Column ─────────────────────────────────────── */
.comparison-col {
  flex: 1;
  min-width: 200px;
  border: 1px solid rgba(255, 224, 48, 0.3);
  padding: 12px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

.comparison-col h3 {
  color: var(--primary);
  font-size: 1.1em;
  margin: 0 0 10px 0;
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(255, 224, 48, 0.4);
  word-break: break-word;
}

/* ── Stat Rows ─────────────────────────────────────────────── */
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: baseline;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85em;
  flex-shrink: 0;
  margin-right: 8px;
}

.stat-value {
  color: var(--text-primary);
  font-weight: bold;
  text-align: right;
}

/* ── Value Highlights ──────────────────────────────────────── */
.highlight-best .stat-value {
  color: var(--primary);
  text-shadow: 0 0 6px rgba(255, 224, 48, 0.5);
}

.highlight-worst .stat-value {
  color: #ff4444;
  text-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
}

/* ── Bar Chart ─────────────────────────────────────────────── */
.bar-chart-container {
  margin-top: 8px;
}

.bar-chart-container h4 {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 4px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 60px;
}

.bar {
  flex: 1;
  background: var(--primary);
  height: var(--bar-height, 0%);
  min-height: 2px;
  transition: height 0.3s ease;
  border-radius: 1px 1px 0 0;
  box-shadow: 0 0 4px rgba(255, 224, 48, 0.3);
  position: relative;
}

.bar:hover {
  background: var(--secondary);
  box-shadow: 0 0 8px rgba(255, 224, 48, 0.6);
}

.bar-label {
  font-size: 0.6em;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Premium Gate Overlay ──────────────────────────────────── */
.comparison-premium-gate {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 10;
  border-radius: 2px;
  padding: 20px;
  box-sizing: border-box;
}

.comparison-premium-gate .premium-gate-icon {
  font-size: 2em;
  margin-bottom: 8px;
}

.comparison-premium-gate .premium-gate-message {
  color: var(--primary);
  font-size: 1.1em;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(255, 224, 48, 0.4);
}

.comparison-premium-gate .premium-gate-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85em;
  margin-bottom: 14px;
}

.comparison-premium-gate .premium-upgrade-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-display), monospace;
  font-size: 1em;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 20px;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s, box-shadow 0.2s;
}

.comparison-premium-gate .premium-upgrade-btn:hover {
  background: rgba(255, 224, 48, 0.15);
  box-shadow: 0 0 12px rgba(255, 224, 48, 0.4);
}

/* ── Loading / Empty States ────────────────────────────────── */
.comparison-loading {
  text-align: center;
  color: rgba(255, 224, 48, 0.7);
  padding: 20px;
  letter-spacing: 2px;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

.comparison-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 20px;
  font-size: 0.9em;
}

/* ── Responsive — Mobile ───────────────────────────────────── */
@media (max-width: 768px) {
  #area-comparison-panel {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .comparison-columns {
    flex-direction: column;
  }

  .comparison-col {
    min-width: unset;
  }

  .area-selector-section {
    flex-direction: column;
    align-items: stretch;
  }

  .area-selector-section select {
    min-width: unset;
    width: 100%;
  }

  .compare-btn {
    width: 100%;
    text-align: center;
  }
}
