@import url('./variables.css');

/* ================= RESET E CONFIGURAÇÃO GLOBAL ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  background-color: #FFDBD0;
  color: var(--text-dark, #121212);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ================= SIDEBAR (MENU LATERAL) ================= */
.sidebar {
  width: 250px;
  min-width: 250px;
  background-color: var(--accent-blue, #42557a);
  color: #ffffff;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.sidebar h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 0.75rem;
  text-transform: uppercase;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar nav a {
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  display: block;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background-color: var(--primary-red, #b6231f);
  color: #ffffff !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ================= ÁREA PRINCIPAL COM O PADRÃO ================= */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  min-height: 100vh;
  position: relative;
  background-color: #FFDBD0;
}

/* Camada da imagem de fundo com opacidade ajustável (mesma da Home) */
.main-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/img/pattern-carnes-flat.png');
  background-repeat: repeat;
  background-size: 220px;
  opacity: 0.18;
  z-index: 0;
  pointer-events: none;
}

/* ================= SEÇÃO DA ROLETA (ESTILO CS) ================= */
.cs-case-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;

  /* Mesma moldura vermelha do carrossel da Home */
  border: 3px solid var(--primary-red, #b6231f);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 2px 6px rgba(182, 35, 31, 0.2);
}

.live-badge {
  display: inline-block;
  background-color: var(--primary-red, #b6231f);
  color: #ffffff;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

#csRifaTitle {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark, #121212);
  margin-bottom: 1.25rem;
}

/* Container horizontal da roleta */
.cs-roulette-wrapper {
  width: 100%;
  height: 110px;
  background-color: #f8fafc;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Seta central vermelha que aponta para o vencedor */
.cs-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: var(--primary-red, #b6231f);
  z-index: 10;
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(182, 35, 31, 0.5);
}

.cs-roulette-track {
  display: flex;
  align-items: center;
  position: absolute;
  left: 0;
  will-change: transform;
}

/* Card individual dentro da esteira da roleta */
.cs-item {
  min-width: 115px;
  height: 90px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin: 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  padding: 0.5rem;
}

.cs-item-num {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-red, #b6231f);
}

.cs-item-name {
  font-size: 0.75rem;
  color: var(--text-muted, #555555);
  margin-top: 4px;
  max-width: 95px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

/* Botão de Girar Roleta */
.cs-actions {
  display: flex;
  justify-content: center;
}

#btnGirarRoleta {
  background-color: var(--accent-blue, #42557a);
  color: #ffffff;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(66, 85, 122, 0.25);
}

#btnGirarRoleta:hover {
  background-color: #344463;
  transform: translateY(-1px);
}

/* Card de Resultado do Vencedor */
.winner-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: #fef2f2;
  border: 2px dashed var(--primary-red, #b6231f);
  text-align: center;
  border-radius: 12px;
}

.winner-box.hidden {
  display: none;
}

.winner-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary-red, #b6231f);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.winner-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark, #121212);
}

.winner-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #334155;
  margin-top: 0.2rem;
}

.winner-phone {
  font-size: 0.85rem;
  color: var(--text-muted, #555555);
  margin-top: 0.2rem;
}

/* ================= GRID DE PARTICIPANTES POR SORTEIO ================= */
.rifas-columns-section {
  position: relative;
  z-index: 1;
}

.rifas-columns-section > h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark, #121212);
  margin-bottom: 1.5rem;
}

.rifas-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  align-items: stretch;
}

/* Card de cada rifa na listagem inferior (segue exatamente o padrão do .rifa-card da Home) */
.rifa-column-card {
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rifa-column-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-red, #b6231f);
  box-shadow: 0 12px 28px rgba(182, 35, 31, 0.18);
}

.rifa-column-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark, #121212);
  margin-bottom: 0.2rem;
}

.rifa-column-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted, #555555);
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

/* Lista interna de participantes do card */
.participantes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}

.participante-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.participante-nome {
  color: var(--text-dark, #121212);
  font-weight: 600;
}

.participante-num {
  font-weight: 800;
  color: var(--primary-red, #b6231f);
  background: #fee2e2;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ================= SEÇÃO DA TABELA DE GANHADORES ================= */
.ganhadores-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
  border: 3px solid var(--primary-red, #b6231f);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12),
              0 2px 6px rgba(182, 35, 31, 0.2);
}

.ganhadores-section .section-header {
  margin-bottom: 1.25rem;
}

.ganhadores-section h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark, #121212);
  margin-top: 0.4rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.ganhadores-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.ganhadores-table th {
  background-color: #f8fafc;
  color: var(--text-dark, #121212);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.ganhadores-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-weight: 600;
}

.ganhadores-table tr:hover td {
  background-color: #fdf2f2;
}

.badge-num {
  font-weight: 800;
  color: var(--primary-red, #b6231f);
  background: #fee2e2;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}