/* === WP FGI v7 — финальная версия === */

.wp-fgi {
  width: 100%;
  font-family: "Inter", sans-serif;
  color: #111827;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Gauge Section ===== */
.fgi-section {
  width: 100%;
  background-color: #f9fafb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px 40px;
  border-radius: 12px;
  box-sizing: border-box;
}

.gauge-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 24px 40px;
  flex: 1;
  margin-right: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.gauge-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: 200px;
}

.gauge-container canvas {
  width: 100% !important;
  height: 180px !important;
  display: block;
  margin: 0 auto;
}

.fgi-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2px;
  height: 90px;
  background: #6b7280;
  transform-origin: bottom center;
  border-radius: 2px;
}
.fgi-needle::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  background: #6b7280;
  border-radius: 50%;
}

.fgi-value {
  font-size: 36px;
  font-weight: 700;
  margin-top: 8px;
}

.fgi-state {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.fgi-desc {
  margin-top: 8px;
  font-size: 13px;
  color: #374151;
  text-align: center;
  max-width: 420px;
  line-height: 1.4;
}

/* ===== Stats (2 columns) ===== */
.stats-wrap {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.stats-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}

.stats-item {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 8px;
  line-height: 1.5;
}

.stats-item .label {
  color: #9ca3af;
  display: block;
  margin-bottom: 2px;
}

.stats-item .value {
  font-weight: 600;
  margin-right: 6px;
}

.stats-item .date {
  color: #9ca3af;
  margin-left: 4px;
}

/* ===== Colors ===== */
.value.red { color: #ef4444; }
.value.lightred { color: #f87171; }
.value.gray { color: #9ca3af; }
.value.green { color: #16a34a; }
.value.darkgreen { color: #15803d; }

/* ===== Chart Section ===== */
.chart-section {
  width: 100%;
  margin-top: 48px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 16px 24px;
  box-sizing: border-box;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chart-controls {
  display: flex;
  gap: 8px;
}

.chart-controls button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  padding: 4px 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.chart-controls button.active,
.chart-controls button:hover {
  background: #f3f4f6;
}

.chart canvas {
  width: 100% !important;
  height: 260px !important;
}

.chart-legend {
  text-align: center;
  font-size: 13px;
  margin-top: 8px;
  color: #374151;
}

.chart-legend .circle {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.legend-index { background: #16a34a; }
.legend-price { background: #f4b400; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .fgi-section {
    flex-direction: column;
    padding: 20px;
  }
  .gauge-wrap {
    margin-right: 0;
    margin-bottom: 24px;
  }
  .stats-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .fgi-value { font-size: 30px; }
  .fgi-state { font-size: 15px; }
  .fgi-desc { font-size: 12px; }
  .stats-item { font-size: 13px; }
  .fgi-section { padding: 16px; }
}
