@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 */
.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'); /* Verifique o caminho da sua imagem */
  background-repeat: repeat;
  background-size: 220px;
  opacity: 0.18; /* Ajuste a opacidade se quiser mais forte ou mais fraco */
  z-index: 0;
  pointer-events: none;
}

/* ================= CARROSSEL DE BANNERS (COM MOLDURA) ================= */
.carousel-container {
  width: 100%;
  max-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  background-color: #ffffff;
  position: relative;
  z-index: 1;

  /* Moldura Vermelha do Carrossel */
  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);
}

.carousel-track {
  display: flex;
  width: 100%;
  user-select: none;
}

.slide {
  min-width: 100%;
  max-height: 280px;
}

.slide img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

/* ================= GRID DE RIFAS ================= */
.rifas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

/* ================= CARD DA RIFA (COM MOLDURA) ================= */
.rifa-card {
  background-color: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;

  /* Moldura do Card */
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.rifa-card:hover {
  transform: translateY(-5px);
  /* Destaque vermelho na moldura ao passar o mouse */
  border-color: var(--primary-red, #b6231f);
  box-shadow: 0 12px 28px rgba(182, 35, 31, 0.18);
}

/* Primeira div interna (Conteúdo superior) */
.rifa-card > div:first-child {
  padding: 1.25rem 1.25rem 0.5rem 1.25rem;
  display: flex;
  flex-direction: column;
}

/* MOLDURA DA IMAGEM DENTRO DO CARD */
.rifa-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 1rem;
  
  /* Moldura e cantos arredondados na imagem do card */
  border-radius: 10px;
  border: 2px solid #f0f0f0;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
}

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

.rifa-card p {
  color: var(--text-muted, #555555);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.rifa-card .preco {
  color: var(--primary-red, #b6231f);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Segunda div interna (Barra de Progresso + Botão) */
.rifa-card > div:last-child {
  padding: 0 1.25rem 1.25rem 1.25rem;
  margin-top: auto;
}

/* ================= BARRA DE PROGRESSO ================= */
.progress-bar-container {
  width: 100%;
  height: 10px;
  background-color: #e9ecef;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-red, #b6231f);
  border-radius: 20px;
  transition: width 0.4s ease;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted, #555555);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ================= BOTÃO DE PARTICIPAR ================= */
.btn-participar {
  display: block;
  width: 100%;
  background-color: var(--primary-red, #b6231f);
  color: #ffffff !important;
  text-align: center;
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-participar:hover {
  background-color: var(--primary-red-hover, #981b18);
  transform: translateY(-1px);
}