/* Economy Dashboard Styles */

.economy-dashboard {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

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

.economy-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.market-sentiment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--card-bg, #f3f4f6);
  font-size: 0.85rem;
}

.sentiment-icon { font-size: 1.2rem; }
.sentiment-label { font-weight: 600; letter-spacing: 0.05em; }
.sentiment-volume { color: var(--muted, #6b7280); font-size: 0.75rem; }

/* Price Cards Grid */
.price-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.price-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px;
  border-top: 3px solid var(--accent, #3b82f6);
  transition: transform 0.2s, box-shadow 0.2s;
}

.price-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.price-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.resource-emoji { font-size: 1.3rem; }

.resource-name {
  font-weight: 600;
  text-transform: capitalize;
  flex: 1;
}

.price-trend { font-size: 1rem; }

.price-card-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
}

.price-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.multiplier {
  color: var(--muted, #6b7280);
  background: var(--badge-bg, #f3f4f6);
  padding: 2px 6px;
  border-radius: 4px;
}

.change { font-weight: 600; }
.change.positive { color: #22c55e; }
.change.negative { color: #ef4444; }

/* Supply/Demand Bars */
.price-card-bars { margin-top: 8px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.7rem;
}

.bar-label {
  width: 50px;
  color: var(--muted, #6b7280);
}

.bar-track {
  flex: 1;
  height: 6px;
  background: var(--bar-bg, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.bar-fill.supply { background: #22c55e; }
.bar-fill.demand { background: #f59e0b; }

.bar-value {
  width: 30px;
  text-align: right;
  color: var(--muted, #6b7280);
  font-size: 0.65rem;
}

/* Sections */
.economy-section {
  margin-bottom: 24px;
}

.economy-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

/* Price Chart */
.price-chart-container {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 16px;
}

#price-chart {
  width: 100%;
  max-height: 200px;
}

/* Events Feed */
.events-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 14px;
  border-left: 3px solid #6b7280;
}

.event-card.boom { border-left-color: #22c55e; }
.event-card.crash { border-left-color: #ef4444; }
.event-card.inflation { border-left-color: #f59e0b; }
.event-card.deflation { border-left-color: #3b82f6; }
.event-card.stabilization { border-left-color: #8b5cf6; }

.event-message { font-size: 0.85rem; margin-bottom: 4px; }
.event-meta { font-size: 0.7rem; color: var(--muted, #6b7280); }

/* Volume Grid */
.volume-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.volume-item {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.volume-number {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.volume-label {
  font-size: 0.7rem;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Fallback */
.economy-fallback {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted, #6b7280);
}

.economy-fallback p.muted { font-size: 0.85rem; }

/* Muted text */
p.muted {
  color: var(--muted, #6b7280);
  font-size: 0.85rem;
}

/* Dark Mode */
.dark .price-card,
.dark .price-chart-container,
.dark .event-card,
.dark .volume-item {
  background: #1f2937;
  border-color: #374151;
}

.dark .market-sentiment {
  background: #1f2937;
}

.dark .bar-track {
  background: #374151;
}

.dark .multiplier {
  background: #374151;
}

/* Mobile */
@media (max-width: 768px) {
  .price-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .volume-grid {
    grid-template-columns: 1fr;
  }

  .economy-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .price-card-value {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .price-cards {
    grid-template-columns: 1fr;
  }
}
