/* ==========================================================================
   CHAMP Demo — Detail Panel (slide-in)
   ========================================================================== */

/* ---------- Overlay ---------- */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 65, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.panel-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ---------- Panel ---------- */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--color-white);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-panel.active {
  transform: translateX(0);
}

/* ---------- Panel Header ---------- */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--color-primary);
  color: var(--color-white);
  flex-shrink: 0;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--color-white);
}

.panel-close {
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.2s;
}

.panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.panel-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

/* ---------- Panel Body ---------- */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Status badge */
.panel-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-endorsed);
  color: var(--color-white);
}

.status-badge.prospective {
  background: var(--color-prospective);
  color: var(--color-text);
}

.status-date {
  font-size: 13px;
  color: var(--color-text-light);
}

/* Panel sections */
.panel-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.panel-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.panel-section p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
}

.panel-section ul {
  list-style: none;
  padding: 0;
}

.panel-section ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-bg-light);
  font-size: 14px;
  line-height: 1.5;
}

.panel-section ul li:last-child {
  border-bottom: none;
}

.panel-section ul li a {
  color: var(--color-link);
  font-weight: 600;
}

.panel-section ul li a:hover {
  color: var(--color-primary);
}

/* Resource type badges */
.resource-type {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-bg-light);
  color: var(--color-text-light);
  margin-left: 8px;
}

/* Event date */
.event-date {
  display: block;
  font-size: 12px;
  color: var(--color-text-light);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Data point values */
.data-value {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--color-primary);
}

/* ---------- Pledge Checklist ---------- */
.pledge-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pledge-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--color-bg-light);
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-light);
  transition: background 0.15s;
}

.pledge-check-item.adopted {
  background: #f0fdf4;
  color: var(--color-text);
}

.pledge-check-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-light);
}

.pledge-check-item.adopted .pledge-check-icon {
  background: #15803d;
  color: #fff;
}

.pledge-check-label strong {
  color: var(--color-primary);
}

.pledge-check-item:not(.adopted) .pledge-check-label strong {
  color: var(--color-text-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .detail-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* ---------- Focus Trap ---------- */
.detail-panel:focus {
  outline: none;
}

/* Prevent body scroll when panel is open */
body.panel-open {
  overflow: hidden;
}
