/* App.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
}

.App {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Loading Spinner Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Pulse Animation for Loading Indicators */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Header Styles */
.App-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  text-align: right;
}

.App-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.App-header p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}


/* Main Content Styles */
.App-main {
  flex: 1;
  padding: 2rem 0;
}

.lobbies-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.lobbies-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #2c3e50;
}


/* Footer Styles */
.App-footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
}

.App-footer p {
  opacity: 0.8;
}

/* Table Styles */
table {
  border-collapse: collapse;
  width: 100%;
}

tr:hover {
  background-color: #e9ecef !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .App-header h1 {
    font-size: 2rem;
  }
  
  .lobbies-section {
    padding: 1rem;
  }
  
  .lobbies-section h2 {
    font-size: 1.5rem;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 8px !important;
  }
}

.wip-banner {
  background: #fffae6;       /* light yellow */
  color: #664d03;            /* dark amber text */
  padding: 0.5rem 1rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #ffe58f;
  font-size: 0.95rem;
}

.origin-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 10px 20px;
  background: #28a745;       /* green to distinguish from blue refresh */
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
.origin-btn:hover {
  background: #218838;
}
.origin-btn:active {
  transform: translateY(1px);
}

.discord-login-btn {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 12px 24px;
  background: #5865F2;       /* Discord brand color */
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(88, 101, 242, 0.3);
}
.discord-login-btn:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(88, 101, 242, 0.4);
}
.discord-login-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(88, 101, 242, 0.3);
}

.logout-btn {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 10px 20px;
  background: #dc3545;       /* Bootstrap danger red */
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
  width: 100%;
}
.logout-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}
.logout-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(220, 53, 69, 0.3);
}

.logged-in-message {
  margin-bottom: 0.75rem;
  padding: 10px 15px;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  font-weight: 500;
  text-align: center;
}

.set-openfront-id-btn {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 10px 20px;
  background: #17a2b8;       /* Bootstrap info cyan */
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
  width: 100%;
}
.set-openfront-id-btn:hover {
  background: #138496;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
}
.set-openfront-id-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(23, 162, 184, 0.3);
}

@media (max-width: 768px) {
  .origin-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
  }
  
  .discord-login-btn {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

/* Single Game Analysis Styles */
.analysis-section {
  max-width: 800px;       /* increased for two-column layout */
  margin: 3rem auto 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  text-align: left;       /* left-align for better column layout */
}

.analysis-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.game-analysis-form {
  margin-top: 1.5rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.game-id-input {
  padding: 10px 15px;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  width: 150px;
  text-align: center;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.game-id-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.game-id-input:disabled {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

.analyze-btn {
  padding: 10px 20px;
  font-size: 1rem;
  background: #6f42c1;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  min-width: 150px;
}

.analyze-btn:hover:not(:disabled) {
  background: #5a2d91;
  transform: translateY(-1px);
}

.analyze-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.analyze-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
}

.analysis-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-weight: 500;
}

.success-message {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Analysis Wrapper - Two Column Layout */
.analysis-wrapper {
  display: flex;
  gap: 2rem;            /* space between columns */
  flex-wrap: wrap;      /* stack on small screens */
}

.analysis-left {
  flex: 1 1 300px;      /* grow/shrink, min-width */
}

.analysis-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start; /* left-align buttons */
  flex: 0 0 250px;      /* fixed-ish width column */
}

.analysis-right a,
.analysis-right button {
  width: 100%;          /* full-width buttons for neat column */
}

@media (max-width: 600px) {
  .analysis-right {
    flex: 1 1 100%;
  }
}

@media (max-width: 768px) {
  .analysis-section {
    margin: 2rem auto 0;
    padding: 1.5rem;
  }
  
  .analysis-section h2 {
    font-size: 1.5rem;
  }
  
  .input-group {
    flex-direction: column;
    gap: 1rem;
  }
  
  .game-id-input {
    width: 100%;
    max-width: 200px;
  }
  
  .analyze-btn {
    width: 100%;
    max-width: 200px;
  }
}

/* Chart Styles */
.line-chart {
  margin: 20px 0;
  display: flex;
  justify-content: center;
}

.game-analysis {
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 20px;
}

.chart-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.metric-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.metric-button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background: white;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.metric-button:hover {
  background-color: #f0f0f0;
}

.metric-button.active {
  border: 2px solid #007bff;
  background-color: #007bff;
  color: white;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
}

.player-card {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border: 1px solid #dee2e6;
}

.player-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.events-container {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.event-item {
  padding: 10px 15px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 14px;
}

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

.event-category {
  font-weight: bold;
  margin-right: 8px;
}

.event-category.general {
  color: #007bff;
}

.event-category.display {
  color: #28a745;
}

.event-time {
  color: #6c757d;
  font-size: 12px;
  min-width: 60px;
  text-align: right;
}

.game-summary {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.summary-item h4 {
  margin: 0 0 5px 0;
  color: #495057;
  font-size: 14px;
}

.summary-item p {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #212529;
}

/* Team Badge Styles for Victory Display */
.team-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9em;
  text-transform: capitalize;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Team colors */
.team-badge.red {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.team-badge.blue {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.team-badge.green {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.team-badge.yellow {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #333; /* darker text for yellow background */
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

.team-badge.orange {
  background: linear-gradient(135deg, #fd7e14 0%, #dc6105 100%);
}

.team-badge.purple {
  background: linear-gradient(135deg, #6f42c1 0%, #5a2d91 100%);
}

.team-badge.pink {
  background: linear-gradient(135deg, #e83e8c 0%, #d91a72 100%);
}

.team-badge.cyan {
  background: linear-gradient(135deg, #20c997 0%, #1aa179 100%);
}

.team-badge.gray,
.team-badge.grey {
  background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

.team-badge.brown {
  background: linear-gradient(135deg, #8b4513 0%, #6b3410 100%);
}

.team-badge.white {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  text-shadow: none;
  border: 1px solid #dee2e6;
}

.team-badge.black {
  background: linear-gradient(135deg, #343a40 0%, #1d2124 100%);
}

/* Player Ranking Scrollable Container Styles */
.player-ranking-container {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background-color: #f8f9fa;
}

.player-ranking-container::-webkit-scrollbar {
  width: 8px;
}

.player-ranking-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.player-ranking-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.player-ranking-container::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.player-ranking-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #e9ecef;
}

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

.player-ranking-item.first-place {
  background-color: #fff3cd;
  font-weight: 500;
}

.player-ranking-item.even {
  background-color: white;
}

.player-ranking-item.odd {
  background-color: #f8f9fa;
}

.player-ranking-item.combat-first {
  background-color: #f8d7da;
  font-weight: 500;
}

/* Analysis Queue Styles */
.analysis-queue {
  width: 300px;
  min-width: 280px;
  max-width: 320px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.analysis-queue h3 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

.analysis-queue table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.analysis-queue th {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  background-color: #f8f9fa;
}

.analysis-queue td {
  padding: 12px 16px;
  border-bottom: 1px solid #dee2e6;
  transition: background-color 0.2s ease;
}

/* Zebra striping for table rows */
.analysis-queue tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.analysis-queue tbody tr:hover {
  background-color: #e9ecef !important;
}

.analysis-queue .game-id {
  font-family: monospace;
  font-weight: 600;
  color: #007bff;
}

.analysis-queue .status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.analysis-queue .status-pending {
  background-color: #fff3cd;
  color: #856404;
}

.analysis-queue .status-processing {
  background-color: #d1ecf1;
  color: #0c5460;
}

.analysis-queue .status-completed {
  background-color: #d4edda;
  color: #155724;
}

.analysis-queue .status-failed {
  background-color: #f8d7da;
  color: #721c24;
}

.analysis-queue .queued-time {
  font-family: monospace;
  color: #6c757d;
}

.analysis-queue .empty-state {
  padding: 40px;
  text-align: center;
  color: #6c757d;
  font-size: 16px;
}

.analysis-queue .refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6c757d;
}

.analysis-queue .refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #28a745;
}

.analysis-queue .refresh-dot.loading {
  background-color: #ffc107;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Reusable Spinner Class */
.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
}

.spinner-circle {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Reusable Error Message Class */
.error-display {
  background: #ffe6e6;
  border: 1px solid #ff4444;
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  color: #cc0000;
  text-align: center;
}

.error-display strong {
  font-weight: 600;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
  .line-chart svg {
    width: 100% !important;
    height: 300px !important;
  }
  
  .game-analysis {
    margin: 10px;
    padding: 10px;
  }
  
  .metric-selector {
    justify-content: center;
  }
  
  .player-grid {
    grid-template-columns: 1fr;
  }
  
  .team-badge {
    font-size: 0.85em;
    padding: 3px 8px;
  }
  
  .player-ranking-container {
    max-height: 250px;
  }
  
  .player-ranking-item {
    padding: 10px 12px;
  }
  
  /* Analysis Queue responsive adjustments */
  .analysis-queue {
    width: 100%;
    min-width: auto;
    max-width: none;
  }
  
  .analysis-queue th,
  .analysis-queue td {
    padding: 8px 12px;
  }
  
  .analysis-queue h3 {
    font-size: 1.2rem;
  }
}
/* Global styles */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}

#root {
  width: 100%;
  min-height: 100vh;
}

.spawn-grid-legend {
  display:flex;
  flex-wrap:wrap;
  gap:6px 12px;
  margin-top:8px;
  font-size:12px;
}
.spawn-grid-legend-item {
  display:flex;
  align-items:center;
  gap:4px;
}
