/* ============================================
   FUNIL ANALYZER PRO v3.0
   ============================================ */

:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --purple: #8b5cf6;
  
  --bg-dark: #0a0f1a;
  --bg-card: #111827;
  --bg-input: #1f2937;
  --bg-hover: #374151;
  
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --border: #1f2937;
  --border-light: #374151;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */

.app {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  grid-template-columns: 1fr 260px;
  min-height: 100vh;
}

.header { grid-column: 1 / -1; }
.stats-bar { grid-column: 1 / -1; }
.alert-banner { grid-column: 1 / -1; }
.main { grid-column: 1; padding: 1.5rem; overflow-y: auto; }
.sidebar { grid-column: 2; background: var(--bg-card); border-left: 1px solid var(--border); padding: 1rem; }
.footer { grid-column: 1 / -1; }

/* ============================================
   HEADER
   ============================================ */

.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo { font-size: 1.75rem; }

.header-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version { font-size: 0.7rem; color: var(--text-muted); }

.header-center { flex: 1; display: flex; justify-content: center; }

.tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: 0.5rem;
  padding: 0.25rem;
}

.tab {
  padding: 0.5rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--primary); color: white; }

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.api-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-dot.connected { background: var(--success); }
.status-dot.error { background: var(--danger); }

.btn {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-config, .btn-refresh {
  background: var(--bg-input);
  color: var(--text-secondary);
}

.btn-config:hover, .btn-refresh:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

#lastUpdate { font-size: 0.75rem; color: var(--text-muted); }

/* ============================================
   STATS BAR
   ============================================ */

.stats-bar {
  background: linear-gradient(90deg, var(--bg-card), #1a2332);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 2rem;
  overflow-x: auto;
}

.stat-item {
  display: flex;
  flex-direction: column;
  min-width: max-content;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-item.highlight-green .stat-value { color: var(--success); }
.stat-item.highlight-blue .stat-value { color: var(--secondary); }
.stat-item.urgent .stat-value { color: var(--danger); animation: pulse 1s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ============================================
   ALERT BANNER
   ============================================ */

.alert-banner {
  background: linear-gradient(90deg, var(--danger), #dc2626);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: pulse-bg 1s infinite;
}

.alert-banner.hidden { display: none; }

@keyframes pulse-bg { 0%, 100% { opacity: 1; } 50% { opacity: 0.85; } }

.alert-icon { font-size: 1.25rem; }
#alertText { flex: 1; font-weight: 600; }
.btn-sound { background: rgba(255,255,255,0.2); border: none; padding: 0.5rem; border-radius: 0.375rem; cursor: pointer; }

/* ============================================
   FILTERS
   ============================================ */

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.filter-group select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  min-width: 180px;
}

.filter-group select:focus { outline: none; border-color: var(--primary); }

/* ============================================
   GAMES SECTIONS
   ============================================ */

.games-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.asian-section .section-header { border-color: var(--secondary); }

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-count {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.asian-section .section-count { background: var(--secondary); }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.loading, .no-games {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   GAME CARD
   ============================================ */

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.3s;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.game-card.urgency-now {
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.game-card.urgency-soon {
  border-color: var(--warning);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.game-card.urgency-wait { border-color: var(--primary); }

.card-header {
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.league-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.badge {
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-now { background: var(--danger); color: white; animation: pulse 1s infinite; }
.badge-soon { background: var(--warning); color: black; }
.badge-wait { background: var(--primary); color: white; }

.match-info {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.team { flex: 1; text-align: center; }
.team-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
.team-stats { font-size: 0.65rem; color: var(--text-muted); }

.score-display { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.score { font-size: 1.25rem; font-weight: 700; background: var(--bg-input); padding: 0.25rem 0.5rem; border-radius: 0.375rem; }

.minute {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.minute::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.card-metrics {
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  background: var(--bg-input);
}

.metric { text-align: center; padding: 0.25rem; }
.metric-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; }
.metric-value { font-size: 0.9rem; font-weight: 700; }
.metric-value.valid { color: var(--success); }
.metric-value.invalid { color: var(--danger); }

.card-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--border);
}

.bet-suggestion { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.bet-type { font-size: 0.75rem; color: var(--text-secondary); }
.bet-line { display: flex; gap: 0.5rem; }

.bet-option {
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.bet-option.integer { background: rgba(16, 185, 129, 0.2); color: var(--primary); border: 1px solid var(--primary); }
.bet-option.half { background: rgba(59, 130, 246, 0.2); color: var(--secondary); border: 1px solid var(--secondary); }

/* ============================================
   SIDEBAR
   ============================================ */

.guide-card {
  background: var(--bg-input);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.guide-card h3 { font-size: 0.8rem; font-weight: 600; margin-bottom: 0.5rem; }

.criteria-list { display: flex; flex-direction: column; gap: 0.25rem; }
.criteria { display: flex; justify-content: space-between; font-size: 0.75rem; }
.criteria span:first-child { color: var(--text-secondary); }
.criteria span:last-child { color: var(--primary); font-weight: 600; }

.time-windows .window { margin-bottom: 0.5rem; }
.window strong { color: var(--accent); font-size: 0.75rem; display: block; }
.window span { font-size: 0.7rem; color: var(--text-muted); }

.asian-info p { font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 0.25rem; }

.leagues-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.65rem;
}

.league-tag {
  background: var(--bg-dark);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 0.75rem;
  text-align: center;
}

.footer p { font-size: 0.75rem; color: var(--text-secondary); }
.footer .disclaimer { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ============================================
   MODAL
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
}

.modal-content h2 { margin-bottom: 1rem; }
.modal-content p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.5rem; }
.modal-content .tip { color: var(--accent); font-size: 0.8rem; margin-bottom: 1rem; }
.modal-content a { color: var(--primary); }

.modal-content input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  color: var(--text-primary);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.modal-content input:focus { outline: none; border-color: var(--primary); }

.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); }

/* ============================================
   DASHBOARD
   ============================================ */

.dashboard-main {
  grid-column: 1 / -1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
}

.metric-card.big {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

.metric-card .metric-icon { font-size: 2.5rem; }
.metric-card .metric-info { flex: 1; }
.metric-card .metric-value { font-size: 2rem; font-weight: 700; display: block; }
.metric-card .metric-label { font-size: 0.8rem; color: var(--text-muted); }

.metric-card.green { border-color: var(--success); }
.metric-card.green .metric-value { color: var(--success); }
.metric-card.blue { border-color: var(--secondary); }
.metric-card.blue .metric-value { color: var(--secondary); }
.metric-card.red { border-color: var(--danger); }
.metric-card.red .metric-value { color: var(--danger); }

.dashboard-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.confidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.confidence-card {
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
}

.confidence-card.alta { background: rgba(34, 197, 94, 0.2); border: 1px solid var(--success); }
.confidence-card.media { background: rgba(245, 158, 11, 0.2); border: 1px solid var(--warning); }
.confidence-card.baixa { background: rgba(239, 68, 68, 0.2); border: 1px solid var(--danger); }

.conf-value { font-size: 2rem; font-weight: 700; display: block; }
.confidence-card.alta .conf-value { color: var(--success); }
.confidence-card.media .conf-value { color: var(--warning); }
.confidence-card.baixa .conf-value { color: var(--danger); }

.conf-label { font-size: 0.8rem; color: var(--text-muted); }

.league-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.league-stat-card {
  background: var(--bg-input);
  padding: 1rem;
  border-radius: 0.5rem;
}

.league-stat-card .league-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.league-stat-card .league-numbers {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
}

.league-stat-card .league-numbers span { color: var(--text-muted); }
.league-stat-card .league-numbers strong { color: var(--text-primary); }

/* ============================================
   RESPONSIVO
   ============================================ */

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header { flex-wrap: wrap; }
  .header-center { order: 3; width: 100%; justify-content: flex-start; }
  .games-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metrics-grid, .confidence-grid { grid-template-columns: 1fr; }
}

/* ============================================
   AUTENTICAÇÃO
   ============================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-dark), #1a1a2e);
  padding: 2rem;
}

.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .logo {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.btn-full {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  padding: 0 1rem;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-google {
  background: white;
  color: #333;
  border: 1px solid #ddd;
}

.btn-google:hover {
  background: #f5f5f5;
}

.btn-github {
  background: #24292e;
  color: white;
  border: 1px solid #24292e;
}

.btn-github:hover {
  background: #1b1f23;
}

.btn-twitter {
  background: #1da1f2;
  color: white;
  border: 1px solid #1da1f2;
}

.btn-twitter:hover {
  background: #1a91da;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--danger);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-align: center;
}

/* ============================================
   USER MENU & CACHE STATUS
   ============================================ */

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-logout:hover {
  background: var(--bg-hover);
  color: var(--danger);
  border-color: var(--danger);
}

.btn-login {
  background: var(--primary);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.875rem;
}

.btn-login:hover {
  background: var(--primary-dark);
}

.cache-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.375rem 0.75rem;
  background: var(--bg-input);
  border-radius: 0.375rem;
}

.cache-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.cache-dot.fresh {
  background: var(--success);
  animation: pulse 1.5s infinite;
}

.cache-dot.from-cache {
  background: var(--accent);
}

.cache-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cache-info p {
  margin-bottom: 0.25rem;
}

.refresh-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ============================================
   RESPONSIVO AUTH
   ============================================ */

@media (max-width: 480px) {
  .auth-container {
    padding: 1.5rem;
  }
  
  .auth-header .logo {
    font-size: 2.5rem;
  }
  
  .auth-header h1 {
    font-size: 1.25rem;
  }
  
  .oauth-buttons {
    flex-direction: column;
  }
}

/* ============================================
   AGENDA PAGE
   ============================================ */

.agenda-page .main,
.agenda-main {
  grid-column: 1 / -1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.agenda-header {
  margin-bottom: 1.5rem;
}

.agenda-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.agenda-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.agenda-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.agenda-filters .filter-group {
  flex: 1;
  min-width: 250px;
}

.agenda-filters .league-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.agenda-filters .league-select:focus {
  outline: none;
  border-color: var(--primary);
}

.filter-stats {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.agenda-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.agenda-league-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.league-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
  border-bottom: 1px solid var(--border);
}

.league-header .league-name {
  font-weight: 600;
  font-size: 1rem;
}

.league-header .league-country {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.league-header .league-count {
  margin-left: auto;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.agenda-games {
  display: flex;
  flex-direction: column;
}

.agenda-game-row {
  display: grid;
  grid-template-columns: 100px 1fr 80px 100px;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.agenda-game-row:last-child {
  border-bottom: none;
}

.agenda-game-row:hover {
  background: var(--bg-input);
}

.game-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.game-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.game-hour {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.game-teams {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.team-home {
  text-align: right;
  flex: 1;
  font-weight: 500;
}

.vs {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.team-away {
  text-align: left;
  flex: 1;
  font-weight: 500;
}

.game-score {
  text-align: center;
}

.game-score .score {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--bg-input);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.game-status {
  text-align: center;
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.game-status.live .status-badge {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  animation: pulse 1.5s infinite;
}

.game-status.live .status-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--danger);
  border-radius: 50%;
  margin-right: 0.5rem;
  animation: pulse 1s infinite;
}

.game-status.halftime .status-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.game-status.finished .status-badge {
  background: rgba(107, 114, 128, 0.2);
  color: var(--text-muted);
}

/* Responsivo Agenda */
@media (max-width: 768px) {
  .agenda-game-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .game-time {
    flex-direction: row;
    gap: 0.5rem;
  }
  
  .game-teams {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .team-home, .team-away {
    text-align: center;
  }
  
  .game-score, .game-status {
    text-align: left;
  }
}

/* ============================================
   MÉTRICAS PREDITIVAS AVANÇADAS
   ============================================ */

.predictive-section {
  padding: 0.5rem 0;
}

.predictive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.predictive-card {
  background: linear-gradient(135deg, var(--bg-input), var(--bg-dark));
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s;
}

.predictive-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

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

.predictive-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.predictive-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.predictive-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.predictive-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* League Stats Grid Melhorado */
.league-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.league-stat-card {
  background: var(--bg-input);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.2s;
}

.league-stat-card:hover {
  background: var(--bg-hover);
}

.league-stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.league-stat-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.league-stat-total {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.league-stat-bars {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 50px;
}

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

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

.stat-bar-fill.funil {
  background: linear-gradient(90deg, var(--success), var(--primary));
}

.stat-bar-fill.asian {
  background: linear-gradient(90deg, var(--secondary), var(--purple));
}

.stat-bar-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  width: 20px;
  text-align: right;
}

/* Responsivo Métricas Preditivas */
@media (max-width: 1200px) {
  .predictive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .predictive-grid {
    grid-template-columns: 1fr;
  }
  
  .predictive-card {
    flex-direction: row;
    align-items: center;
  }
  
  .predictive-icon {
    font-size: 1.5rem;
  }
  
  .predictive-value {
    font-size: 1.5rem;
  }
  
  .league-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading Text */
.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}

/* ============================================
   DATA SOURCES INDICATOR
   ============================================ */

#sourcesIndicator {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.source-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
  border-color: var(--success);
}

.source-badge.cached {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
  border-color: var(--warning);
}

.source-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-color: var(--danger);
}

/* Mini badge dentro dos cards */
.source-mini-badge {
  display: inline-block;
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  font-size: 0.55rem;
  font-weight: 700;
  background: var(--bg-dark);
  color: var(--text-muted);
  margin-left: 0.5rem;
}

/* xG Display */
.xg-display {
  font-size: 0.65rem;
  color: var(--purple);
  margin-top: 0.25rem;
  font-weight: 600;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
}

/* Card with xG highlight */
.game-card:has(.xg-display) {
  border-left: 3px solid var(--purple);
}

/* ============================================
   AGENDA STATS BAR
   ============================================ */

.agenda-stats-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.agenda-stats-bar .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.agenda-stats-bar .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.agenda-stats-bar .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.agenda-stats-bar .highlight-red .stat-value {
  color: var(--danger);
}

.agenda-stats-bar .highlight-blue .stat-value {
  color: var(--secondary);
}

/* ============================================
   AGENDA FILTERS MELHORADOS
   ============================================ */

.agenda-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.agenda-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
  flex: 1;
}

.agenda-filters label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.agenda-filters select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.agenda-filters select:focus {
  outline: none;
  border-color: var(--primary);
}

.agenda-filters select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.agenda-filters select option:disabled {
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-dark);
}

/* ============================================
   AGENDA GAME ROW MELHORADO
   ============================================ */

.agenda-game-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  align-items: center;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s;
}

.agenda-game-row:last-child {
  border-bottom: none;
}

.agenda-game-row:hover {
  background: var(--bg-input);
}

.agenda-game-row.live {
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid var(--danger);
}

.agenda-game-row.scheduled {
  border-left: 3px solid var(--secondary);
}

.agenda-game-row.finished {
  opacity: 0.7;
  border-left: 3px solid var(--text-muted);
}

.agenda-game-row.postponed,
.agenda-game-row.suspended {
  opacity: 0.6;
  border-left: 3px solid var(--warning);
}

.game-teams {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.team-home {
  flex: 1;
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-away {
  flex: 1;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-score-inline {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border-radius: 0.25rem;
  min-width: 50px;
  text-align: center;
}

.game-score-inline.has-score {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-input);
}

/* League badges */
.league-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.live-badge {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  animation: pulse 1.5s infinite;
}

/* Responsive Agenda */
@media (max-width: 768px) {
  .agenda-stats-bar {
    gap: 1rem;
    padding: 0.5rem 1rem;
  }
  
  .agenda-stats-bar .stat-value {
    font-size: 1rem;
  }
  
  .agenda-filters {
    flex-direction: column;
  }
  
  .agenda-filters .filter-group {
    min-width: 100%;
  }
  
  .agenda-game-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .game-teams {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .team-home, .team-away {
    text-align: center;
  }
}

/* ============================================
   SOURCE INDICATOR - v8.0 FALLBACK
   ============================================ */

.source-indicator {
  grid-column: 1 / -1;
  background: linear-gradient(90deg, var(--bg-card), var(--bg-dark));
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.source-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

#activeSource {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s;
}

#activeSource.connecting {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--warning);
  color: var(--warning);
  animation: pulse 1s infinite;
}

#activeSource.connected {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

#activeSource.error {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

/* Fallback Info Card */
.fallback-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fallback-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Source badge no card */
.card-header .source-badge {
  font-size: 0.9rem;
  margin-left: auto;
  cursor: help;
}

/* SSE Connection Indicator */
.sse-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border-radius: 0.25rem;
}

.sse-indicator .sse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}

.sse-indicator.connected .sse-dot {
  background: var(--success);
  animation: pulse 2s infinite;
}

.sse-indicator.connecting .sse-dot {
  background: var(--warning);
  animation: blink 0.5s infinite;
}

.sse-indicator.error .sse-dot {
  background: var(--danger);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Data Source Quota Bar */
.quota-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quota-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 80px;
}

.quota-track {
  flex: 1;
  height: 4px;
  background: var(--bg-dark);
  border-radius: 2px;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.quota-fill.warning {
  background: var(--warning);
}

.quota-fill.danger {
  background: var(--danger);
}

.quota-value {
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 50px;
  text-align: right;
}

/* Rate Limit Warning */
.rate-limit-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rate-limit-warning .warning-icon {
  font-size: 1.5rem;
}

.rate-limit-warning .warning-text {
  flex: 1;
}

.rate-limit-warning .warning-title {
  font-weight: 600;
  color: var(--warning);
  font-size: 0.9rem;
}

.rate-limit-warning .warning-message {
  font-size: 0.8rem;
  color: var(--text-muted);
}
