/* Analytics Dashboard Styles - Enterprise AI-Powered Analytics Interface */

.analytics-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 2rem;
  border-bottom: 2px solid #00ff41;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.dashboard-title h1 {
  margin: 0;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.dashboard-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.25rem;
}

.dashboard-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

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

.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;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.dashboard-btn.active {
  background: #00ff41;
  color: #000;
}

.dashboard-btn.primary {
  border-color: #0080ff;
  color: #0080ff;
}

.dashboard-btn.primary:hover {
  background: #0080ff;
  color: #fff;
}

.dashboard-navigation {
  border-bottom: 1px solid #333;
  background: rgba(0, 0, 0, 0.5);
}

.dashboard-nav {
  display: flex;
  padding: 0 2rem;
}

.nav-btn {
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: #666;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

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

.nav-btn.active {
  color: #00ff41;
  border-bottom-color: #00ff41;
  background: rgba(0, 255, 65, 0.1);
}

.nav-icon {
  font-size: 1.2rem;
}

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

.dashboard-tab {
  display: none;
}

.dashboard-tab.active {
  display: block;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

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

.kpi-title {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.kpi-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.kpi-change.up {
  color: #00ff41;
}

.kpi-change.down {
  color: #ff4444;
}

.change-icon {
  font-size: 1.1rem;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

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

.chart-container.full-width {
  grid-column: 1 / -1;
}

.chart-container h3 {
  margin: 0 0 1rem 0;
  text-align: center;
  border-bottom: 1px solid #00ff41;
  padding-bottom: 0.5rem;
}

/* AI Insights Tab */
.insights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.insights-header h2 {
  margin: 0;
}

.insights-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.insight-card {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
}

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

.insight-card.good {
  border-color: #00ff41;
}

.insight-card.warning {
  border-color: #ff8800;
}

.insight-card.danger {
  border-color: #ff4444;
}

.insight-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.insight-content h4 {
  margin: 0 0 0.5rem 0;
}

.insight-value {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.insight-description {
  font-size: 0.9rem;
  color: #ccc;
}

.insights-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.insights-widget h4 {
  margin: 0 0 1rem 0;
  border-bottom: 1px solid #00ff41;
  padding-bottom: 0.5rem;
}

.model-card {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}

.model-card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.model-name {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.model-metrics {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #ccc;
}

/* Players Tab */
.players-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

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

.players-filters input {
  flex: 1;
  max-width: 300px;
}

.players-table-container {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.players-table {
  width: 100%;
  border-collapse: collapse;
}

.players-table th,
.players-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #333;
}

.players-table th {
  background: rgba(0, 255, 65, 0.1);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.players-table tbody tr:hover {
  background: rgba(0, 255, 65, 0.05);
}

.segment-badge,
.risk-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: bold;
}

.segment-badge.hardcore {
  background: rgba(0, 255, 65, 0.2);
  color: #00ff41;
}

.segment-badge.casual {
  background: rgba(0, 128, 255, 0.2);
  color: #0080ff;
}

.segment-badge.social {
  background: rgba(255, 136, 0, 0.2);
  color: #ff8800;
}

.segment-badge.competitive {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.segment-badge.whale {
  background: rgba(255, 255, 0, 0.2);
  color: #ffff00;
}

.risk-badge.low {
  background: rgba(0, 255, 65, 0.2);
  color: #00ff41;
}

.risk-badge.medium {
  background: rgba(255, 136, 0, 0.2);
  color: #ff8800;
}

.risk-badge.high {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.risk-badge.critical {
  background: rgba(255, 0, 0, 0.2);
  color: #ff0000;
}

.player-action-btn {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid #00ff41;
  color: #00ff41;
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
}

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

/* Monetization Metrics */
.monetization-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.metric-card h4 {
  margin: 0 0 0.5rem 0;
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #00ff41;
}

/* Engagement Metrics */
.engagement-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Predictions Tab */
.predictions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.predictions-summary {
  display: flex;
  gap: 1rem;
}

.prediction-stat {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  text-align: center;
}

.prediction-stat .stat-value {
  font-size: 1.2rem;
  font-weight: bold;
  color: #00ff41;
}

.prediction-stat .stat-label {
  font-size: 0.8rem;
  color: #666;
}

.predictions-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.predictions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.prediction-item.high {
  border-color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

.prediction-item.medium {
  border-color: #ff8800;
  background: rgba(255, 136, 0, 0.1);
}

.prediction-item.low {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.1);
}

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

.prediction-header h4 {
  margin: 0;
}

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

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

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

.recommendations-panel h3 {
  margin: 0 0 1rem 0;
  border-bottom: 1px solid #00ff41;
  padding-bottom: 0.5rem;
}

.recommendation-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #333;
}

.recommendation-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.recommendation-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.recommendation-description {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.recommendation-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.recommendation-priority {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.recommendation-priority.high {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
}

.recommendation-priority.medium {
  background: rgba(255, 136, 0, 0.2);
  color: #ff8800;
}

.recommendation-priority.low {
  background: rgba(0, 255, 65, 0.2);
  color: #00ff41;
}

/* Loading Overlay */
.dashboard-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid #333;
  border-top: 3px solid #00ff41;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #00ff41;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Export Modal */
.export-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;
}

.export-modal .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;
}

.export-modal .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);
}

.export-modal .modal-header h3 {
  margin: 0;
}

.export-modal .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;
}

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

.export-modal .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[type="checkbox"] {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #333;
  color: #00ff41;
  font-family: inherit;
  border-radius: 4px;
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .dashboard-nav {
    padding: 0 1rem;
    overflow-x: auto;
  }

  .dashboard-nav {
    flex-wrap: nowrap;
  }

  .nav-btn {
    white-space: nowrap;
    min-width: 100px;
  }

  .dashboard-content {
    padding: 1rem;
  }

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

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

  .insights-content,
  .predictions-content {
    grid-template-columns: 1fr;
  }

  .players-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .players-table {
    font-size: 0.8rem;
  }

  .players-table th,
  .players-table td {
    padding: 0.5rem;
  }

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

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

  .dashboard-title h1 {
    font-size: 1.5rem;
  }

  .kpi-value {
    font-size: 1.5rem;
  }

  .charts-grid {
    gap: 1rem;
  }

  .chart-container {
    padding: 1rem;
  }
}

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

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

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

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

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