/**
 * JGP Forecast — Frontend styles
 * 國際投行 黃金價格目標 セクション専用
 */

/* ============ Title (outside the colored section) ============ */
.jgp-fcst-outer-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #d4af37;
}

/* ============ Forecast Section (Light & Eye-catching) ============ */
.jgp-forecast-section {
  background: linear-gradient(135deg, #fff4d1 0%, #fff9e3 40%, #fef0c4 100%);
  border: 1px solid #e0c97a;
  border-radius: 12px;
  padding: 24px 26px;
  margin: 0 0 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.12);
}

.jgp-forecast-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #b8860b, #d4af37, #f5c645, #d4af37, #b8860b);
}

/* Header */
.jgp-fcst-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.jgp-fcst-meta {
  font-size: 12px;
  color: #856b25;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.jgp-fcst-meta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #4caf50;
  animation: jgpFcstPulse 2s infinite;
}

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

.jgp-fcst-subtitle {
  color: #666;
  font-size: 13px;
  margin: 0 0 22px 0;
}

/* Cards Grid */
.jgp-fcst-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

/* 4 banks: 1 row x 4 cols */
.jgp-fcst-grid--4 { grid-template-columns: repeat(4, 1fr); }
/* 5 banks: tries 5 across desktop */
.jgp-fcst-grid--5 { grid-template-columns: repeat(5, 1fr); }
/* 6 banks: 2 rows x 3 cols */
.jgp-fcst-grid--6 { grid-template-columns: repeat(3, 1fr); }
/* fallback for any other count */
.jgp-fcst-grid--3 { grid-template-columns: repeat(3, 1fr); }
.jgp-fcst-grid--2 { grid-template-columns: repeat(2, 1fr); }
.jgp-fcst-grid--1 { grid-template-columns: 1fr; }

@media (max-width: 900px) {
  .jgp-fcst-grid--4,
  .jgp-fcst-grid--5,
  .jgp-fcst-grid--6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .jgp-fcst-grid { grid-template-columns: 1fr !important; }
}

/* Card */
.jgp-fcst-card {
  background: #fff;
  border: 1px solid #e8dec0;
  border-radius: 10px;
  padding: 18px 16px;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.jgp-fcst-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.15);
  border-color: #d4af37;
}

.jgp-fcst-card-bank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.jgp-fcst-bank-logo,
.jgp-fcst-bank-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.jgp-fcst-bank-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  font-family: -apple-system, "SF Pro Display", Helvetica, sans-serif;
}

.jgp-fcst-bank-logo-img {
  object-fit: contain;
  background: #fff;
  border: 1px solid #f0e8d4;
}

.jgp-fcst-bank-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.jgp-fcst-bank-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jgp-fcst-bank-zh {
  font-size: 11px;
  color: #888;
}

/* Target value */
.jgp-fcst-card-target {
  font-size: 30px;
  font-weight: 800;
  color: #b8860b;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
  font-family: -apple-system, "SF Pro Display", sans-serif;
}

.jgp-fcst-card-target-unit {
  font-size: 12px;
  color: #999;
  font-weight: 500;
  margin-left: 2px;
}

.jgp-fcst-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0e8d4;
}

.jgp-fcst-card-horizon {
  font-size: 11px;
  color: #888;
  font-weight: 500;
}

.jgp-fcst-stance {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.jgp-fcst-stance--bullish {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.jgp-fcst-stance--neutral {
  background: #f5f5f5;
  color: #616161;
  border: 1px solid #cccccc;
}

.jgp-fcst-stance--bearish {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.jgp-fcst-card-source {
  margin-top: 8px;
  text-align: right;
}

.jgp-fcst-card-source a,
.jgp-fcst-card-source span {
  color: #999;
  font-size: 10px;
  text-decoration: none;
  border-bottom: 1px dotted #ccc;
}

.jgp-fcst-card-source a:hover {
  color: #b8860b;
  border-bottom-color: #b8860b;
}

/* Consensus Panel */
.jgp-fcst-consensus {
  background: #fff;
  border: 1px solid #e8dec0;
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 14px;
}

.jgp-fcst-consensus-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.jgp-fcst-consensus-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.jgp-fcst-consensus-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.jgp-fcst-consensus-value {
  font-size: 22px;
  font-weight: 700;
  color: #b8860b;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.jgp-fcst-consensus-value-small {
  font-size: 16px;
  color: #1a1a2e;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.jgp-fcst-live-badge {
  font-size: 9px;
  font-weight: 700;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid #a5d6a7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.jgp-fcst-consensus-pct {
  font-size: 13px;
  font-weight: 600;
}

.jgp-fcst-consensus-pct--up { color: #2e7d32; }
.jgp-fcst-consensus-pct--down { color: #c62828; }

.jgp-fcst-stance-summary {
  display: flex;
  gap: 8px;
}

.jgp-fcst-stance-pill {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 12px;
  font-weight: 600;
}

.jgp-fcst-stance-pill--bullish { background: #e8f5e9; color: #2e7d32; }
.jgp-fcst-stance-pill--neutral { background: #f5f5f5; color: #616161; }
.jgp-fcst-stance-pill--bearish { background: #ffebee; color: #c62828; }

/* Range Bar */
.jgp-fcst-range {
  background: #fff;
  border: 1px solid #e8dec0;
  border-radius: 10px;
  padding: 16px 22px 24px;
  margin-bottom: 14px;
}

.jgp-fcst-range-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.jgp-fcst-range-track {
  position: relative;
  height: 8px;
  background: linear-gradient(90deg, #ffcdd2, #f5f5f5, #c8e6c9);
  border-radius: 4px;
  margin: 30px 0 30px;
}

.jgp-fcst-range-marker {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 18px;
  background: #b8860b;
  border-radius: 2px;
}

/* Default: label below */
.jgp-fcst-range-marker::after {
  content: attr(data-label);
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #555;
  white-space: nowrap;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.85);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Alternating: label above */
.jgp-fcst-range-marker--above::after {
  top: auto;
  bottom: 22px;
}

.jgp-fcst-range-marker--current {
  background: #1a1a2e;
  width: 5px;
  height: 26px;
  top: -9px;
  z-index: 3;
}

.jgp-fcst-range-marker--current::after {
  color: #fff;
  font-weight: 700;
  background: #1a1a2e;
  padding: 2px 7px;
  border-radius: 3px;
  top: -24px;
  bottom: auto;
  font-size: 11px;
}

.jgp-fcst-range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #999;
  font-weight: 500;
}

/* Disclaimer */
.jgp-fcst-disclaimer {
  font-size: 11px;
  color: #888;
  text-align: center;
  padding: 10px;
  background: rgba(212, 175, 55, 0.05);
  border-radius: 6px;
  border: 1px dashed #d4af37;
}
