/* Market Dashboard Styles - Advanced Economic Interface */

.market-dashboard {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: 'Courier New', monospace;
  color: #00ff41;
  overflow: hidden;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 2px solid #00ff41;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.dashboard-header h2 {
  margin: 0;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dashboard-controls {
  display: flex;
  gap: 0.5rem;
}

.dashboard-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #00ff41;
  background: transparent;
  color: #00ff41;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
}

.dashboard-btn:hover {
  background: #00ff41;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.dashboard-btn.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.dashboard-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dashboard-section {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
}

.dashboard-section h3 {
  margin: 0 0 1rem 0;
  border-bottom: 1px solid #00ff41;
  padding-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.opportunities-count,
.events-count {
  font-size: 0.9rem;
  color: #666;
}

/* Market Grid */
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.market-card {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.3s ease;
}

.market-card:hover {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.1);
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.market-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.market-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.economic-health {
  font-weight: bold;
  font-size: 1.1rem;
}

.market-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.stat span {
  font-weight: bold;
}

.market-commodities {
  margin-bottom: 1rem;
}

.commodity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

.commodity-item:last-child {
  border-bottom: none;
}

.commodity-name {
  flex: 1;
}

.commodity-price {
  font-weight: bold;
  margin: 0 0.5rem;
}

.commodity-trend {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: bold;
}

.commodity-trend.rising {
  background: rgba(0, 255, 65, 0.2);
  color: #00ff41;
}

.commodity-trend.falling {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.commodity-trend.stable {
  background: rgba(255, 255, 0, 0.2);
  color: #ffff00;
}

.commodity-trend.volatile {
  background: rgba(255, 136, 0, 0.2);
  color: #ff8800;
}

.market-actions {
  display: flex;
  gap: 0.5rem;
}

.market-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #00ff41;
  background: transparent;
  color: #00ff41;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  text-transform: uppercase;
}

.market-btn:hover {
  background: #00ff41;
  color: #000;
}

.market-btn.secondary {
  border-color: #666;
  color: #666;
}

.market-btn.secondary:hover {
  background: #666;
  color: #fff;
}

/* Arbitrage Opportunities */
.arbitrage-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.arbitrage-item {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
}

.arbitrage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.arbitrage-header h4 {
  margin: 0;
  color: #00ff41;
}

.profit-margin {
  background: rgba(0, 255, 65, 0.2);
  color: #00ff41;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: bold;
}

.arbitrage-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arbitrage-location,
.arbitrage-profit {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.arbitrage-profit strong {
  color: #00ff41;
}

/* Price Charts */
.chart-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.chart-controls select {
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  color: #00ff41;
  font-family: inherit;
  border-radius: 4px;
}

.price-chart {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
}

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

.chart-header h4 {
  margin: 0;
}

.chart-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.price-graph {
  display: flex;
  align-items: end;
  height: 200px;
  margin: 1rem 0;
  padding: 0 1rem;
  border-left: 1px solid #333;
  border-bottom: 1px solid #333;
}

.price-bar {
  flex: 1;
  background: linear-gradient(to top, #00ff41, #0080ff);
  margin: 0 1px;
  border-radius: 2px 2px 0 0;
  transition: all 0.3s ease;
  cursor: pointer;
}

.price-bar:hover {
  background: linear-gradient(to top, #ffff00, #00ff41);
  transform: scaleY(1.1);
}

.chart-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #666;
}

/* Intelligence Feed */
.intelligence-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 300px;
  overflow-y: auto;
}

.intelligence-item {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
}

.intelligence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.intelligence-header h4 {
  margin: 0;
  color: #0080ff;
}

.intelligence-confidence {
  background: rgba(0, 128, 255, 0.2);
  color: #0080ff;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.intelligence-insights {
  color: #ccc;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Economic Events */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-item {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
}

.event-item.trade_embargo {
  border-color: #ff4444;
}

.event-item.resource_discovery {
  border-color: #00ff41;
}

.event-item.corporate_war {
  border-color: #ff8800;
}

.event-item.technological_advance {
  border-color: #0080ff;
}

.event-item.pirate_activity {
  border-color: #ff00ff;
}

.event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.event-header h4 {
  margin: 0;
  font-size: 1rem;
}

.event-impact {
  font-weight: bold;
  font-size: 1.1rem;
}

.event-meta {
  font-size: 0.8rem;
  color: #666;
}

/* Trade Simulator Modal */
.trade-simulator-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #000;
  border: 2px solid #00ff41;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #00ff41;
  background: rgba(0, 0, 0, 0.8);
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #00ff41;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: rgba(0, 255, 65, 0.1);
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.form-group select,
.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  color: #00ff41;
  font-family: inherit;
  border-radius: 4px;
}

.simulation-results {
  margin-top: 1rem;
}

.simulation-result {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #00ff41;
  border-radius: 8px;
  padding: 1rem;
}

.simulation-result h4 {
  margin: 0 0 1rem 0;
  color: #00ff41;
}

.simulation-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

.result-item:last-child {
  border-bottom: none;
}

.result-item.total {
  border-top: 2px solid #00ff41;
  font-weight: bold;
  font-size: 1.1rem;
}

.result-item .label {
  color: #ccc;
}

.result-item .value {
  font-weight: bold;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .market-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
  }

  .chart-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .arbitrage-header,
  .event-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .modal-content {
    width: 95%;
    margin: 1rem;
  }

  .price-graph {
    height: 150px;
  }
}

@media (max-width: 480px) {
  .market-dashboard {
    font-size: 14px;
  }

  .dashboard-section {
    padding: 1rem;
  }

  .market-card {
    padding: 0.75rem;
  }

  .commodity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Utility Classes */
.no-opportunities,
.no-events {
  text-align: center;
  color: #666;
  font-style: italic;
  margin: 2rem 0;
}

/* Hidden utility class */
.hidden {
  display: none !important;
}

/* Scrollbar styling */
.market-dashboard ::-webkit-scrollbar {
  width: 8px;
}

.market-dashboard ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.market-dashboard ::-webkit-scrollbar-thumb {
  background: #00ff41;
  border-radius: 4px;
}

.market-dashboard ::-webkit-scrollbar-thumb:hover {
  background: #0080ff;
}
