/* ============================================
   MacroFlow — Pair Detail Panel Styles
   Add these to the bottom of styles.css
   ============================================ */

/* Overlay */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  animation: overlayIn 0.2s ease;
}
@keyframes overlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Panel */
.detail-panel {
  width: min(560px, 100vw);
  height: 100dvh;
  background: #0d1117;
  border-left: 1px solid rgba(124,58,237,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: panelIn 0.28s cubic-bezier(0.22,1,0.36,1);
  box-shadow: -8px 0 48px rgba(124,58,237,0.12);
}
@keyframes panelIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Header */
.detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(var(--accent-rgb,16,185,129),0.06) 0%, transparent 60%);
  flex-shrink: 0;
  position: relative;
}
.detail-header-left { flex: 1; }
.detail-pair {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}
.detail-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.detail-price { font-size: 15px; color: rgba(255,255,255,0.7); }
.detail-chg { font-size: 13px; font-weight: 600; }
.detail-chg.up   { color: var(--bull); }
.detail-chg.down { color: var(--bear); }

.detail-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.detail-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}
.detail-badge .b-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.detail-strength {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.detail-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.detail-close svg { width: 16px; height: 16px; }

/* History Strip */
.detail-history-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.detail-history-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.detail-history-bars {
  display: flex;
  gap: 3px;
  align-items: center;
}
.detail-hist-bar {
  width: 28px;
  height: 10px;
  border-radius: 3px;
  opacity: 0.85;
}

/* Scrollable content */
.detail-analysis,
.detail-meta-row,
.detail-events {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Scroll container for middle content */
.detail-panel > .detail-analysis,
.detail-panel > .detail-meta-row,
.detail-panel > .detail-events {
  overflow-y: auto;
  flex-shrink: 0;
}
.detail-events { flex: 1; overflow-y: auto; }

.detail-section-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 8px;
}

/* Analysis */
.detail-analysis-text {
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
}

/* Meta Row */
.detail-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* Central Bank */
.detail-cb-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.detail-cb-stance {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.detail-cb-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.detail-cb-trend { font-weight: 600; }
.detail-cb-next {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin-top: 4px;
}

/* Key Levels */
.detail-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.detail-level-pivot {
  background: rgba(245,194,75,0.05);
  border-radius: 4px;
  padding: 5px 6px;
}
.detail-level-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.detail-level-val {
  font-size: 12px;
  font-weight: 600;
}

/* Sentiment */
.detail-sent-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.detail-sent-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  width: 28px;
  flex-shrink: 0;
}
.detail-sent-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.detail-sent-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.detail-sent-val {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.detail-sent-note {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-top: 4px;
  line-height: 1.4;
}

/* Events Tabs */
.detail-events-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 0;
}
.detail-events-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
  font-family: inherit;
}
.detail-events-tab:hover { color: rgba(255,255,255,0.7); }
.detail-events-tab.active {
  color: #10b981;
  border-bottom-color: #10b981;
}
.detail-events-count {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  font-family: var(--mono);
}

/* Event Rows */
.detail-events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  transition: background 0.15s;
}
.detail-event-row:hover { background: rgba(255,255,255,0.06); }
.detail-event-day {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  width: 24px;
  flex-shrink: 0;
}
.detail-event-time {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  width: 36px;
  flex-shrink: 0;
}
.detail-event-flag { font-size: 14px; flex-shrink: 0; }
.detail-event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.detail-event-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.detail-event-name {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-event-note {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.3px;
}
.detail-event-impact {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  flex-shrink: 0;
}
.detail-event-impact.impact-high   { color: #ef4444; }
.detail-event-impact.impact-medium { color: #f97316; }
.detail-event-impact.impact-low    { color: #f5c24b; }

.detail-no-events {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  padding: 24px;
}

/* Footer */
.detail-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}
.detail-footer-btn {
  flex: 1;
  font-size: 12px;
  padding: 10px 12px;
  white-space: nowrap;
}

/* Make pair cards clickable */
.pair-card {
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s !important;
}
.pair-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,58,237,0.4) !important;
  box-shadow: 0 8px 32px rgba(124,58,237,0.12);
}

/* Mobile */
@media (max-width: 640px) {
  .detail-panel {
    width: 100vw;
    border-left: none;
    border-top: 1px solid rgba(124,58,237,0.3);
    height: 92dvh;
    border-radius: 16px 16px 0 0;
  }
  .detail-overlay {
    align-items: flex-end;
    justify-content: center;
  }
  @keyframes panelIn {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .detail-meta-row {
    grid-template-columns: 1fr 1fr;
  }
  .detail-sentiment { grid-column: 1 / -1; }
}
