/* Importando fontes */
@import url('https://fonts.googleapis.com/css2?family=Jersey+15&family=Kanit:wght@400;600&family=Work+Sans:ital,wght@0,400;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Bebas+Neue&display=swap');

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body com fundo suave amarelo claro */
body {
  font-family: "Bebas Neue", sans-serif;
  background: linear-gradient(135deg, #fff8e1 0%, #fffde7 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  color: #5d1a1a;
}

/* Menu base */
.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: #fff;
  border-bottom: 1.5px solid #ddd;
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(75, 0, 130, 0.15);
  flex-wrap: nowrap;
  transition: padding 0.3s ease;
}

/* Links do menu */
.menu a {
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: #4B0082;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.menu a:hover {
  background-color: rgba(75, 0, 130, 0.12);
  color: #330066;
}

/* Agrupadores */
.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wrapper para os itens do menu */
.menu-items {
  display: flex;
  flex: 1;
  justify-content: space-between;
}

/* Botão do menu mobile */
.menu-toggle {
  display: none;
  font-size: 26px;
  color: #4B0082;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

/* Responsivo: Tablet e abaixo */
@media (max-width: 768px) {
  .menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 20px;
  }

  .menu-toggle {
    display: block;
    margin-bottom: 10px;
  }

  .menu-items {
    flex-direction: column;
    width: 100%;
    display: none;
  }

  .menu-items.active {
    display: flex;
  }

  .menu-left,
  .menu-right {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .menu a {
    width: 100%;
    padding: 12px 20px;
    border-top: 1px solid rgba(75, 0, 130, 0.1);
  }
}

/* Responsivo: Mobile pequeno */
@media (max-width: 480px) {
  .container {
    padding: 30px 20px;
    max-width: 100%;
    margin-top: 90px;
  }

  button {
    width: 100%;
    font-size: 16px;
    padding: 14px;
  }

  .menu {
    padding: 12px 15px;
    flex-wrap: wrap;
  }

  .menu-left a, .menu-right a {
    margin-right: 15px;
    font-size: 14px;
  }
}

/* Container centralizado estilo cartão */
.container {
  margin-top: 80px; /* Espaço para o menu fixo */
  background: #fff3e0;
  padding: 40px 50px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(198, 40, 40, 0.15);
  max-width: 400px;
  width: 100%;
  text-align: center;
  color: #5d1a1a;
  transition: padding 0.3s ease;
}

/* Título estilizado */
.container h1 {
  font-family: 'Jersey 15', cursive;
  font-size: 3rem;
  color: #c62828;
  margin-bottom: 30px;
  letter-spacing: 2px;
  word-break: break-word;
}

/* Botões modernos */
button {
  background: #c62828; /* vermelho */
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 30px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin: 10px 15px 0 15px;
  box-shadow: 0 6px 12px rgba(198, 40, 40, 0.3);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
  white-space: nowrap;
}

button:hover {
  background: #fbc02d; /* amarelo */
  color: #5d1a1a;
  box-shadow: 0 10px 20px rgba(251, 192, 45, 0.5);
}

/* Resultado do sorteio */
#resultado {
  margin-top: 30px;
  font-size: 1.15rem;
  color: #8b1c1c;
  min-height: 60px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}

/* Modal fundo translúcido mais suave */
.modal {
  display: none;
  position: fixed;
  z-index: 1100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(198, 40, 40, 0.4);
  padding: 60px 20px;
  backdrop-filter: blur(4px);
}

/* Conteúdo modal estilizado */
.modal-content {
  background-color: #fff3e0;
  margin: auto;
  padding: 30px 40px;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(198, 40, 40, 0.25);
  max-width: 500px;
  font-size: 1rem;
  color: #5d1a1a;
  position: relative;
  transition: padding 0.3s ease, width 0.3s ease;
}

@media (max-width: 480px) {
  .modal-content {
    padding: 20px 25px;
    width: 90%;
  }
}

/* Botão fechar no canto */
.fechar {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 28px;
  font-weight: 700;
  color: #b71c1c;
  cursor: pointer;
  transition: color 0.3s ease;
}

.fechar:hover {
  color: #fbc02d;
}

/* Histórico container */
#historicoConteudo {
  max-height: 280px;
  overflow-y: auto;
  margin-top: 20px;
  padding-right: 8px;
}

/* Itens do histórico */
.historico-item {
  background: #fff8e1;
  border: 1px solid #fbc02d;
  padding: 12px 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  color: #c62828;
  box-shadow: 0 2px 5px rgba(198, 40, 40, 0.1);
  word-break: break-word;
}

.excluir-btn {
  background-color: #c62828;
  border: none;
  border-radius: 50%;
  color: white;
  width: 28px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  line-height: 1;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.excluir-btn:hover {
  background-color: #8b0000;
}

/* Cabeçalho do modal */
h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  color: #c62828;
  margin-bottom: 15px;
  letter-spacing: 1.5px;
}

/* Scrollbar estilizado para o histórico (apenas para navegadores modernos) */
#historicoConteudo::-webkit-scrollbar {
  width: 6px;
}

#historicoConteudo::-webkit-scrollbar-thumb {
  background-color: #fbc02d;
  border-radius: 10px;
}

/* === Definições de Cores para os Temas === */
:root {
  --bg1: #121212; /* Fundo principal escuro */
  --bg2: #1e1e1e; /* Segundo fundo escuro */
  --bg3: #2a2a2a; /* Terceiro fundo escuro */
  --text1: #f0f0f0; /* Texto claro */
  --accent: #3d85c6; /* Azul para destaque */
  --highlight: #6200ea; /* Cor de destaque suave (roxo) */
  --danger: #ffffff; /* Cor para alertas (branco) */
}

/* === Corpo e fundo geral === */
[data-theme="dark"] body {
  background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
  color: var(--text1);
}

/* === Container Central === */
[data-theme="dark"] .container {
  background: var(--bg2);
  color: var(--text1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 10px; /* Suaviza os cantos */
  padding: 20px;
}

/* === Título === */
[data-theme="dark"] .container h1 {
  color: var(--accent);
}

/* === Botões === */
[data-theme="dark"] button {
  background: var(--accent);
  color: #121212;
  box-shadow: 0 6px 12px rgba(61, 133, 198, 0.4);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] button:hover {
  background: var(--highlight);
  color: #fff;
  box-shadow: 0 10px 20px rgba(187, 134, 252, 0.5);
}

/* === Menu Base === */
[data-theme="dark"] .menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background-color: var(--menu-bg-dark);
  border-bottom: 1.5px solid var(--menu-border-dark);
  z-index: 1000;
  box-shadow: 0 3px 8px rgba(75, 0, 130, 0.5);
  flex-wrap: wrap;
  transition: background-color 0.3s, border-color 0.3s;
}

/* === Links do menu === */
[data-theme="dark"] .menu a {
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--menu-text-dark);
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .menu a:hover {
  background-color: var(--menu-hover-dark);
  color: var(--menu-active-dark);
}

[data-theme="dark"] .menu a.active {
  background-color: var(--menu-active-dark);
  color: var(--menu-text-dark);
}

/* === Agrupadores de Menu === */
[data-theme="dark"] .menu-left,
[data-theme="dark"] .menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Wrapper para os itens do menu */
[data-theme="dark"] .menu-items {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
}

/* === Botão do Menu Mobile === */
[data-theme="dark"] .menu-toggle {
  display: none;
  font-size: 26px;
  color: var(--menu-text-dark);
  background: none;
  border: none;
  cursor: pointer;
}

/* === Responsivo === */
@media (max-width: 768px) {
  [data-theme="dark"] .menu {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 20px;
  }

  [data-theme="dark"] .menu-toggle {
    display: block;
    margin-bottom: 10px;
    color: var(--menu-text-dark);
  }

  [data-theme="dark"] .menu-items {
    flex-direction: column;
    width: 100%;
    display: none;
  }

  [data-theme="dark"] .menu-items.active {
    display: flex;
  }

  [data-theme="dark"] .menu-left,
  [data-theme="dark"] .menu-right {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  [data-theme="dark"] .menu a {
    width: 100%;
    padding: 12px 20px;
    border-top: 1px solid var(--menu-border-dark);
  }
}

/* === Modal === */
[data-theme="dark"] .modal {
  background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-content {
  background-color: var(--bg3);
  color: var(--text1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  padding: 30px 35px;
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  text-align: left;
}

/* Fechar modal */
[data-theme="dark"] .fechar {
  color: var(--danger);
  font-size: 30px;
  cursor: pointer;
  transition: color 0.2s ease;
}

[data-theme="dark"] .fechar:hover {
  color: var(--accent);
}

/* === Histórico === */
[data-theme="dark"] .historico-item {
  background: var(--bg2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .excluir-btn {
  background-color: var(--danger);
}

[data-theme="dark"] .excluir-btn:hover {
  background-color: #e53935;
}

/* === Scrollbar === */
[data-theme="dark"] #historicoConteudo::-webkit-scrollbar-thumb {
  background-color: var(--accent);
}
