/* ============================================
   Sorte Certa - Loterias Caixa
   Tema escuro e claro
   ============================================ */

:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2750;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --accent-gold: #ffd700;
  --accent-red: #e94560;
  --accent-blue: #00d2ff;
  --accent-green: #00e676;
  --accent-purple: #b388ff;
  --accent-orange: #ff9100;
  --border-color: #2a2a4a;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --navbar-bg: #0a0a15;
  --footer-bg: #0a0a15;
}

[data-bs-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f0f0;
  --text-primary: #1a1a2e;
  --text-secondary: #555;
  --border-color: #ddd;
  --shadow: 0 4px 20px rgba(0,0,0,0.1);
  --navbar-bg: #1a1a2e;
  --footer-bg: #1a1a2e;
}

* { transition: background-color 0.3s, color 0.3s, border-color 0.3s; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar { background: var(--navbar-bg) !important; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.footer { background: var(--footer-bg) !important; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.card-header {
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

/* Lottery Cards */
.loteria-card {
  cursor: pointer;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
}
.loteria-card .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.loteria-card .name { font-size: 1.1rem; font-weight: 700; margin-bottom: 5px; }
.loteria-card .info { font-size: 0.85rem; color: var(--text-secondary); }
.loteria-card .badge-concurso {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Mega-Sena: green */
.loteria-card.megasena { border-left: 4px solid #00e676; }
.loteria-card.megasena .icon { color: #00e676; }
/* Lotofácil: purple */
.loteria-card.lotofacil { border-left: 4px solid #b388ff; }
.loteria-card.lotofacil .icon { color: #b388ff; }
/* Quina: blue */
.loteria-card.quina { border-left: 4px solid #00d2ff; }
.loteria-card.quina .icon { color: #00d2ff; }
/* Lotomania: orange */
.loteria-card.lotomania { border-left: 4px solid #ff9100; }
.loteria-card.lotomania .icon { color: #ff9100; }
/* Timemania: red */
.loteria-card.timemania { border-left: 4px solid #e94560; }
.loteria-card.timemania .icon { color: #e94560; }
/* Dupla Sena: gold */
.loteria-card.duplasena { border-left: 4px solid #ffd700; }
.loteria-card.duplasena .icon { color: #ffd700; }
/* Dia de Sorte: pink */
.loteria-card.diadesorte { border-left: 4px solid #ff80ab; }
.loteria-card.diadesorte .icon { color: #ff80ab; }
/* Super Sete: teal */
.loteria-card.supersete { border-left: 4px solid #1de9b6; }
.loteria-card.supersete .icon { color: #1de9b6; }
/* +Milionária: dark gold */
.loteria-card.maismilionaria { border-left: 4px solid #ffab00; }
.loteria-card.maismilionaria .icon { color: #ffab00; }
/* Federal: grey */
.loteria-card.federal { border-left: 4px solid #90a4ae; }
.loteria-card.federal .icon { color: #90a4ae; }

/* Ball numbers */
.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 3px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.ball:hover { transform: scale(1.15); }
.ball-megasena { background: linear-gradient(135deg, #00e676, #00c853); }
.ball-lotofacil { background: linear-gradient(135deg, #b388ff, #7c4dff); }
.ball-quina { background: linear-gradient(135deg, #00d2ff, #0091ea); }
.ball-lotomania { background: linear-gradient(135deg, #ff9100, #ff6d00); }
.ball-timemania { background: linear-gradient(135deg, #e94560, #c62828); }
.ball-duplasena { background: linear-gradient(135deg, #ffd700, #ffab00); }
.ball-diadesorte { background: linear-gradient(135deg, #ff80ab, #f50057); }
.ball-supersete { background: linear-gradient(135deg, #1de9b6, #00bfa5); }
.ball-maismilionaria { background: linear-gradient(135deg, #ffab00, #ff6f00); }
.ball-federal { background: linear-gradient(135deg, #90a4ae, #607d8b); }
.ball-trevo { background: linear-gradient(135deg, #ffd700, #ff6f00); width: 36px; height: 36px; font-size: 0.8rem; }

/* Stats section */
.stat-box {
  text-align: center;
  padding: 15px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
.stat-box .value { font-size: 1.8rem; font-weight: 700; }
.stat-box .label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* Tables */
.table { color: var(--text-primary); }
.table thead th { border-bottom-color: var(--border-color); color: var(--accent-gold); font-weight: 600; }
.table td { border-color: var(--border-color); vertical-align: middle; }

/* Charts container */
.chart-container { position: relative; height: 300px; width: 100%; }

/* Prize table styling */
.premio-ganhador { color: var(--accent-green); font-weight: 600; }
.premio-zero { color: var(--accent-red); }

/* Generator numbers */
.numero-sel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 4px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s;
}
.numero-sel:hover { border-color: var(--accent-gold); transform: scale(1.1); }
.numero-sel.selected { border-color: var(--accent-gold); background: var(--accent-gold); color: #000; }

/* Loading spinner */
.loading-spinner { display: flex; justify-content: center; align-items: center; min-height: 300px; }

/* Auth forms */
.auth-container { max-width: 400px; margin: 0 auto; padding: 20px; }

/* Responsive */
@media (max-width: 768px) {
  .ball { width: 36px; height: 36px; font-size: 0.8rem; margin: 2px; }
  .loteria-card { min-height: 120px; padding: 15px; }
  .stat-box .value { font-size: 1.4rem; }
  .chart-container { height: 250px; }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.3s ease-out; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pulse { animation: pulse 2s infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* Admin */
.admin-sidebar { background: var(--bg-card); border-radius: 12px; padding: 20px; }
.admin-content { min-height: 400px; }

/* Notification toast */
.toast-container { position: fixed; top: 70px; right: 20px; z-index: 9999; }

/* Sorteio animation */
.sorteio-animado { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 20px; }
.sorteio-animado .ball {
  animation: fadeIn 0.5s ease-out both;
}
.sorteio-animado .ball:nth-child(1) { animation-delay: 0s; }
.sorteio-animado .ball:nth-child(2) { animation-delay: 0.2s; }
.sorteio-animado .ball:nth-child(3) { animation-delay: 0.4s; }
.sorteio-animado .ball:nth-child(4) { animation-delay: 0.6s; }
.sorteio-animado .ball:nth-child(5) { animation-delay: 0.8s; }
.sorteio-animado .ball:nth-child(6) { animation-delay: 1s; }
.sorteio-animado .ball:nth-child(7) { animation-delay: 1.2s; }
.sorteio-animado .ball:nth-child(8) { animation-delay: 1.4s; }
