/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 300;
}

.header p {
  opacity: 0.9;
  font-size: 1.1rem;
}

.content {
  padding: 30px;
}

/* Sections */
.section {
  margin-bottom: 40px;
  padding: 25px;
  border: 2px solid #ecf0f1;
  border-radius: 10px;
  background: #fafafa;
}

.section h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Forms and Inputs */
.api-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-weight: 600;
  color: #34495e;
  font-size: 0.9rem;
}

.input-group input, select {
  padding: 12px 15px;
  border: 2px solid #bdc3c7;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.input-group input:focus, select:focus {
  outline: none;
  border-color: #3498db;
}

.controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

/* Buttons */
.btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-success {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* League Buttons */
.leagues-container {
  margin-bottom: 20px;
}

.league-category {
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

.league-category.high {
  color: #27ae60;
}

.league-category.medium {
  color: #f39c12;
}

.league-category.testing {
  color: #3498db;
}

.league-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.league-btn-high {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.league-btn-medium {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* Status Messages */
.status {
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.status.success {
  background: #d5f5d5;
  color: #27ae60;
  border-left: 4px solid #27ae60;
}

.status.error {
  background: #ffeaa7;
  color: #d63031;
  border-left: 4px solid #d63031;
}

.status.loading {
  background: #dbeafe;
  color: #3b82f6;
  border-left: 4px solid #3b82f6;
}

.status.info {
  background: #e8f4fd;
  color: #2980b9;
  border-left: 4px solid #2980b9;
}

/* API Status */
.api-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.api-card {
  padding: 20px;
  border: 2px solid #ecf0f1;
  border-radius: 10px;
  background: white;
  text-align: center;
}

.api-card h3 {
  color: #2c3e50;
  margin-bottom: 10px;
}

/* Team Mapping Interface */
.team-mapping-container {
  display: none;
  margin-top: 20px;
}

.mapping-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ecf0f1;
}

.mapping-controls {
  display: flex;
  gap: 10px;
}

.teams-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}

.teams-list {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #ecf0f1;
}

.teams-list h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ecf0f1;
}

.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 4px solid #ecf0f1;
}

.team-item.matched {
  border-left-color: #27ae60;
  background: #e8f5e8;
}

.team-item.unmatched {
  border-left-color: #e74c3c;
  background: #ffeaa7;
}

.confidence-score {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
}

.confidence-high {
  background: #27ae60;
  color: white;
}

.confidence-medium {
  background: #f39c12;
  color: white;
}

.confidence-low {
  background: #e74c3c;
  color: white;
}

.manual-mapping {
  margin-top: 20px;
  padding: 20px;
  background: white;
  border-radius: 10px;
  border: 2px solid #f39c12;
}

.manual-mapping h4 {
  color: #f39c12;
  margin-bottom: 15px;
}

.mapping-row {
  display: grid;
  grid-template-columns: 1fr 1fr 100px;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
}

/* Results Table */
.results-table-container {
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.results-table th {
  background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
  color: white;
  padding: 15px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

.results-table td {
  padding: 12px;
  border-bottom: 1px solid #ecf0f1;
  vertical-align: middle;
}

.results-table tbody tr:hover {
  background: #f8f9fa;
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

.match-teams {
  font-weight: 600;
  color: #2c3e50;
}

.match-date {
  font-size: 0.85rem;
  color: #7f8c8d;
}

.odds-cell {
  font-family: monospace;
  font-size: 0.9rem;
}

.profit-positive {
  color: #27ae60;
  font-weight: bold;
}

.profit-negative {
  color: #e74c3c;
  font-weight: bold;
}

.details-btn {
  padding: 6px 12px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.details-btn:hover {
  background: #2980b9;
}

.expandable-row {
  display: none;
}

.expandable-row.show {
  display: table-row;
}

.expandable-row td {
  background: #f8f9fa;
  padding: 20px;
  border-bottom: 2px solid #ecf0f1;
}

.details-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stake-details, .profit-details {
  background: white;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

/* Arbitrage Results */
.arbitrage-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.summary-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  border: 2px solid #ecf0f1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.summary-card h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1rem;
}

.summary-number {
  font-size: 2rem;
  font-weight: bold;
  color: #3498db;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .api-form {
    grid-template-columns: 1fr;
  }
  
  .api-status {
    grid-template-columns: 1fr;
  }

  .teams-comparison {
    grid-template-columns: 1fr;
  }

  .league-buttons {
    grid-template-columns: 1fr;
  }

  .mapping-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .details-content {
    grid-template-columns: 1fr;
  }

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

  .results-table th,
  .results-table td {
    padding: 8px 6px;
  }

  .arbitrage-summary {
    grid-template-columns: 1fr;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-success {
  color: #27ae60;
}

.text-danger {
  color: #e74c3c;
}

.text-info {
  color: #3498db;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
/* Add this to your existing styles.css - new styles for verified leagues */

.league-category.verified {
  color: #27ae60;
  border-left: 4px solid #27ae60;
  padding-left: 15px;
  background: linear-gradient(90deg, rgba(39, 174, 96, 0.1) 0%, transparent 100%);
  margin-bottom: 15px;
  padding: 10px 15px;
  border-radius: 8px;
}

.league-description {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #3498db;
}

/* Enhanced league buttons grid for better organization with 30 leagues */
.league-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #ecf0f1;
  border-radius: 8px;
  background: #fafafa;
}

/* Improved button styling for verified leagues */
.league-buttons .btn {
  justify-content: flex-start;
  text-align: left;
  padding: 10px 15px;
  font-size: 0.9rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  background: white;
  color: #2c3e50;
  border: 1px solid #ecf0f1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.league-buttons .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(39, 174, 96, 0.2);
  border-color: #27ae60;
}

.league-buttons .btn-success {
  background: white;
  color: #2c3e50;
  border: 1px solid #27ae60;
}

.league-buttons .btn-success:hover {
  background: #27ae60;
  color: white;
}

/* Scrollbar styling for league buttons container */
.league-buttons::-webkit-scrollbar {
  width: 8px;
}

.league-buttons::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.league-buttons::-webkit-scrollbar-thumb {
  background: #27ae60;
  border-radius: 4px;
}

.league-buttons::-webkit-scrollbar-thumb:hover {
  background: #229954;
}

/* Stats for verified leagues count */
.summary-card:last-child {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
}

.summary-card:last-child .summary-number {
  color: white;
}

/* Responsive updates for mobile */
@media (max-width: 768px) {
  .league-buttons {
    grid-template-columns: 1fr;
    max-height: 300px;
  }
  
  .league-buttons .btn {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}