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

/* =======================================
   BASE GLOBAL
======================================= */
:root{
  color-scheme: dark; /* força controles nativos (inputs/scrollbar) em dark quando suportado */
}

body {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 20px;
  background: #111;   /* era #ffffff */
  color: #fff;        /* era #000000 */
}

main.container {
  max-width: 650px;
  margin: 0 auto;
}

/* =======================================
   LOGO RESPONSIVO
======================================= */
.logo-evento {
  display: block;
  margin: 0 auto 20px;
  max-width: 160px;
  width: 100%;
  height: auto;
}

/* =======================================
   BOTÃO DE VOLTAR — ALTO DESIGN FINAL
======================================= */
.btn-voltar {
  display: block;
  width: 90%;
  max-width: 320px;
  margin: 40px auto 0 auto;

  padding: 14px 18px;

  text-align: center;
  text-decoration: none;

  font-weight: 600;
  font-size: 1.15rem;

  color: #fff;
  background: linear-gradient(135deg, #333, #555); /* era #222,#444 */

  border: none;
  border-radius: 12px;

  box-shadow: 0px 4px 10px rgba(255,255,255,0.15); /* era rgba(0,0,0,0.25) */

  transition: 0.2s ease-in-out;
  cursor: pointer;
}

.btn-voltar:hover,
.btn-voltar:focus {
  background: linear-gradient(135deg, #222, #444); /* era #000,#333 */
  transform: scale(1.04);
  box-shadow: 0px 6px 16px rgba(255,255,255,0.25); /* era rgba(0,0,0,0.3) */
  outline: none;
}

/* =======================================
   TÍTULOS
======================================= */
h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
  font-weight: 600;
}

/* =======================================
   TEXTO INTRODUTÓRIO (INDEX)
======================================= */
.intro {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #eee; /* adicionado (antes herdava preto) */
}

/* =======================================
   BOTÕES DE AÇÃO (LER EM VOZ ALTA)
======================================= */
button {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #444; /* era #222 */
  color: #fff;
  cursor: pointer;
  margin: 1rem 0;
}

button:hover,
button:focus {
  background: #666;        /* era #000 */
  outline: 3px solid #fff; /* era #000 */
}

/* =======================================
   LISTA DE RESTAURANTES (INDEX)
======================================= */
.menu-restaurantes ul {
  list-style: none;
  padding: 0;
}

.menu-restaurantes li {
  margin-bottom: 12px;
}

.menu-restaurantes a {
  display: block;
  padding: 14px;
  background: #222;       /* era #f5f5f5 */
  border: 2px solid #fff; /* era #000 */
  border-radius: 8px;
  text-decoration: none;
  color: #fff;            /* era #000 */
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.menu-restaurantes a:hover,
.menu-restaurantes a:focus {
  background: #333; /* era #e0e0e0 */
}

/* =======================================
   LISTA DE PRATOS (CARDÁPIOS)
======================================= */
.lista-pratos {
  list-style: none;
  padding-left: 0;
}

.lista-pratos li {
  background: #222;            /* era #f5f5f5 */
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 5px solid #fff; /* era #000 */
}

.lista-pratos strong {
  font-size: 1.05rem;
}

.descricao {
  color: #bbb; /* era #444 */
  font-size: 0.95rem;
}

/* =======================================
   RESPONSIVIDADE
======================================= */
@media (min-width: 700px) {
  h1 {
    font-size: 2.2rem;
  }

  nav a,
  button,
  .btn-voltar {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }

  .lista-pratos li {
    padding: 18px;
  }
}

/* =======================================
   DARK MODE AUTOMÁTICO (DESATIVADO)
======================================= */
/*
@media (prefers-color-scheme: dark) {
  body {
    background: #111;
    color: #fff;
  }

  .intro {
    color: #eee;
  }

  .btn-voltar {
    background: linear-gradient(135deg, #333, #555);
    color: #fff;
    box-shadow: 0px 4px 10px rgba(255,255,255,0.15);
  }

  .btn-voltar:hover,
  .btn-voltar:focus {
    background: linear-gradient(135deg, #222, #444);
    box-shadow: 0px 6px 16px rgba(255,255,255,0.25);
  }

  .menu-restaurantes a {
    background: #222;
    border-color: #fff;
    color: #fff;
  }

  .menu-restaurantes a:hover,
  .menu-restaurantes a:focus {
    background: #333;
  }

  button {
    background: #444;
    color: #fff;
  }

  button:hover,
  button:focus {
    background: #666;
    outline: 3px solid #fff;
  }

  .lista-pratos li {
    background: #222;
    border-left-color: #fff;
  }

  .descricao {
    color: #bbb;
  }
}
*/

/* Destaque no prato selecionado */
.prato-selecionado {
  border-left-color: #2fa3ff !important; /* era #007bff */
  background: #1a2433 !important;        /* era #e9f1ff */
  transition: 0.2s ease-in-out;
}

/* Dark mode (DESATIVADO — já é padrão) */
/*
@media (prefers-color-scheme: dark) {
  .prato-selecionado {
    background: #1a2433 !important;
    border-left-color: #2fa3ff !important;
  }
}
*/

/* =========================
   ADMIN - FORM / LAYOUT
   ========================= */

.form {
  margin: 16px 0;
}

.form-row {
  margin: 12px 0;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  outline: none;
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.help {
  text-align: left;
  opacity: 0.9;
  font-size: 14px;
  margin: 8px 0;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.actions .btn,
.btn {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background: rgba(255,255,255,0.18);
}

.btn-danger {
  background: rgba(255,0,0,0.15);
  border-color: rgba(255,0,0,0.25);
}

.btn-danger:hover {
  background: rgba(255,0,0,0.22);
}

.btn-secondary {
  background: rgba(255,255,255,0.08);
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  margin-left: 8px;
  opacity: 0.85;
  border: 1px solid rgba(255,255,255,0.14);
}

.badge-off {
  opacity: 0.7;
}

.hr {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 18px 0;
  border: 0;
}

/* Drag & drop (Sortable) */
.sortable-handle {
  cursor: grab;
}

.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  opacity: 0.9;
}

/* =========================
   ADMIN - Melhorias Eventos
   ========================= */

.field {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.field-label {
  text-align: left;
  font-size: 14px;
  opacity: 0.9;
}

.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.btn-sm {
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1;
}

.card-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.card-subtle {
  opacity: 0.9;
  font-size: 14px;
}

@media (max-width: 520px) {
  .field {
    grid-template-columns: 1fr;
  }
  .field-label {
    margin-bottom: 2px;
  }
}

/* =========================
   ADMIN - Eventos (Accordion + Toast + Drag)
   ========================= */

.event-list { margin-top: 10px; }

.event-row {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  margin: 12px 0;
}

.event-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.event-title {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.event-title strong { font-size: 18px; }

.event-year {
  opacity: 0.85;
  font-size: 14px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.10);
  color: #fff;
  cursor: pointer;
}

.icon-btn:hover { background: rgba(255,255,255,0.16); }

.event-details {
  display: none;
  margin-top: 12px;
}

.event-row.is-open .event-details { display: block; }

.event-drag-handle {
  cursor: grab;
  user-select: none;
}

/* Toast */
.toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 9999;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.75);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  max-width: 360px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* botões menores (já existe btn-sm, mas reforça alinhamento em linha) */
.actions-row { gap: 8px; }
.btn-sm { padding: 8px 10px; border-radius: 10px; font-size: 13px; }


/* =========================
   ADMIN - Eventos (Expandable rows)
   Corrige botão pequeno mesmo com CSS global de button
   ========================= */

.event-list { margin-top: 10px; }

.event-row {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  margin: 12px 0;
}

.event-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.event-title {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.event-title strong { font-size: 18px; }

.event-year {
  opacity: 0.85;
  font-size: 14px;
}

.event-details {
  display: none;
  margin-top: 12px;
}

.event-row.is-open .event-details { display: block; }

/* Handle do drag apenas no título */
.event-drag-handle {
  cursor: grab;
  user-select: none;
}

/* Botão pequeno de expandir (força override do CSS global) */
.event-toggle {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  margin: 0 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(255,255,255,0.10) !important;
  color: #fff !important;

  cursor: pointer !important;
  text-decoration: none !important;
}

.event-toggle:hover { background: rgba(255,255,255,0.16) !important; }

.hr {
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 18px 0;
  border: 0;
}

/* Toast */
.toast {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 9999;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.75);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  max-width: 360px;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* Botões menores em linha */
.actions-row { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:12px; }
.btn-sm { padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1; }


/* =========================
   ADMIN - Botões compactos (Eventos)
   ========================= */

/* Linha de ações: tudo em uma linha */
.actions-row {
  display: flex !important;
  flex-wrap: nowrap !important; /* NÃO quebra linha */
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

/* Botões realmente pequenos */
.actions-row .btn,
.actions-row .btn-sm {
  padding: 6px 10px !important;
  height: 34px !important;
  min-height: 34px !important;
  line-height: 1 !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  white-space: nowrap; /* não quebra texto */
}

/* Botão salvar não ficar gigante */
.actions-row .btn[type="submit"] {
  flex: 0 0 auto !important;
}

/* Preview ainda menor */
.actions-row a.btn {
  padding: 6px 10px !important;
}

/* Excluir mais discreto (menos altura visual) */
.actions-row .btn-danger {
  background: rgba(180,0,0,0.35) !important;
}
/* =========================
   FIX BOTÃO SALVAR - EVENTOS
   Escopo isolado (não afeta outras páginas)
   ========================= */

.event-details .actions-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px;
  align-items: center;
}

/* TODOS os botões da linha */
.event-details .actions-row .btn {
  width: auto !important;        /* remove width:100% herdado */
  min-width: auto !important;
  max-width: none !important;

  height: 34px !important;
  padding: 6px 12px !important;

  font-size: 13px !important;
  line-height: 1 !important;
  border-radius: 8px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  white-space: nowrap;
}

/* Garantia extra só para o botão Salvar */
.event-details .actions-row button[type="submit"] {
  flex: 0 0 auto !important;
  width: auto !important;
}


/* === AÇÕES DOS RESTAURANTES (EVENTO) === */
.actions-row{
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.actions-row form{
  margin: 0;
}

.actions-row button{
  width: 190px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

/* Botões */
.btn-secondary{
  background: #444;
  border: none;
  color: #fff;
}

.btn-danger{
  background: #b00020;
  border: none;
  color: #fff;
}

/* === MODAL DE CONFIRMAÇÃO === */
.modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box{
  background: #111;
  color: #fff;
  padding: 18px;
  border-radius: 12px;
  width: min(520px, 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,.55);
}

.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* =======================================================================
   EVENTO_RESTAURANTE.PHP — AÇÕES E MODAL (isolado para não quebrar outras telas)
   Cole este bloco no FINAL do style.css
   ======================================================================= */

/* Linha de botões "Publicar/Despublicar" e "Desvincular" */
.actions-row{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap; /* em telas pequenas quebra sem bagunçar */
}

.actions-row form{
  margin: 0;
}

/* Botões da linha: tamanho consistente */
.actions-row button{
  box-sizing: border-box;
  height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  width: 200px;       /* deixa proporcional */
  max-width: 100%;
  border: 2px solid #fff; /* borda branca como você pediu */
}

/* Variações de botão usadas só nesta tela */
.actions-row .btn-secondary{
  background: #444;
  color: #fff;
}

.actions-row .btn-danger{
  background: #6d0f18;
  color: #fff;
}

/* =======================
   MODAL DE CONFIRMAÇÃO
   ======================= */

.modal-overlay{
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  padding: 16px;
  background: rgba(0,0,0,.75);

  display: none;              /* fechado por padrão */
  align-items: center;        /* centraliza vertical */
  justify-content: center;    /* centraliza horizontal */

  z-index: 99999;
}

.modal-overlay.is-open{
  display: flex !important;   /* abre e garante centralização */
}

.modal-box{
  width: min(560px, 100%);
  background: #111;
  color: #fff;

  border: 2px solid #fff;     /* borda branca */
  border-radius: 14px;

  padding: 18px 18px 16px;
  box-shadow: 0 18px 60px rgba(0,0,0,.65);
}

.modal-box p{
  margin: 0 0 14px 0;
  font-size: 16px;
  line-height: 1.35;
}

/* Botões do modal */
.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-actions button{
  box-sizing: border-box;
  height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  width: 170px;
  max-width: 100%;
  border: 2px solid #fff; /* borda branca */
}
/* Centralização completa dos botões nos cards */
.lista-pratos li .actions-row{
  display: flex;
  justify-content: center;   /* centro horizontal */
  align-items: center;       /* centro vertical */
  gap: 16px;
  margin-top: 14px;
}
/* FORÇA centralização dos botões dentro de cada item "Vinculados" */
ul.lista-pratos > li .actions-row{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
}

/* Garante que o form não puxe largura/posicionamento estranho */
ul.lista-pratos > li .actions-row form{
  width: auto !important;
}

/* Opcional: mantém os botões com o mesmo tamanho e centralizados */
ul.lista-pratos > li .actions-row button{
  width: 200px !important;
}
/* Se o LI estiver em flex/coluna e estiver desalinhando, força o bloco de ações ocupar a linha toda */
ul.lista-pratos > li .actions-row{
  flex: 0 0 100% !important;
}
/* se o LI tiver text-align:left, força apenas a área de botões a centralizar */
ul.lista-pratos > li .actions-row{
  text-align: center;
}