@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Nunito:wght@400;600;700;800;900&display=swap');

/* ═══════════════════════════════════════
   VARIÁVEIS — IDENTIDADE AMSTEL
═══════════════════════════════════════ */
:root {
  --vermelho:     #C8102E;
  --vermelho-dk:  #A00D24;
  --dourado:      #B8860B;
  --bg:           #FAFAFA;
  --surface:      #FFFFFF;
  --border:       #E8E8E8;
  --text:         #1A1A1A;
  --cinza:        #888888;
  --cinza-claro:  #F4F4F4;
  --verde:        #2D6A2D;
  --danger:       #C0392B;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.12);
  --radius:       12px;
  --radius-lg:    16px;
  --nav-height:   68px;
  --z-nav:        999;
  --z-notif:      3000;
  --z-splash:     9999;
}

/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

a { color: inherit; }
button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* ═══════════════════════════════════════
   SPLASH
═══════════════════════════════════════ */
#splashApp {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(160deg, #1A0008, #6B0018, #C8102E);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-splash);
  transition: opacity 0.4s;
}

/* ═══════════════════════════════════════
   PÁGINAS
═══════════════════════════════════════ */
.page {
  display: none;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

/* Header fixo dentro das páginas */
.page-header {
  background: var(--surface);
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* ═══════════════════════════════════════
   NAV INFERIOR
═══════════════════════════════════════ */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: var(--z-nav);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cinza);
  font-size: 0.68rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  transition: color 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.nav-btn i {
  font-size: 1.4rem;
  line-height: 1;
}

.nav-btn.ativo {
  color: var(--vermelho);
}

.nav-btn.ativo i {
  /* Substitui ícone outline pelo filled */
}

.nav-btn:active {
  transform: scale(0.92);
}

/* ═══════════════════════════════════════
   CARDS DE BAR
═══════════════════════════════════════ */
.bar-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  border-left: 4px solid var(--vermelho);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  position: relative;
  overflow: hidden;
}

.bar-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.bar-card-nome {
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-card-promo {
  font-size: 0.75rem;
  color: var(--vermelho);
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-card-end {
  font-size: 0.72rem;
  color: var(--cinza);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bar-card-dist {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  color: var(--cinza);
  font-weight: 700;
  margin-top: 6px;
  background: var(--cinza-claro);
  padding: 2px 8px;
  border-radius: 10px;
}

.bar-card-visitado {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--verde);
  color: white;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ═══════════════════════════════════════
   BOTÕES
═══════════════════════════════════════ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--vermelho);
  color: white;
  border: none;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.btn-primary:active {
  background: var(--vermelho-dk);
  transform: scale(0.98);
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  background: white;
  color: var(--vermelho);
  border: 2px solid var(--vermelho);
  font-size: 0.9rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}

/* ═══════════════════════════════════════
   FILTROS
═══════════════════════════════════════ */
.filtro-btn {
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--cinza);
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}

.filtro-btn.ativo,
.filtro-btn:active {
  background: var(--vermelho);
  color: white;
  border-color: var(--vermelho);
}

/* ═══════════════════════════════════════
   ESTRELAS DE AVALIAÇÃO
═══════════════════════════════════════ */
.estrela {
  color: var(--dourado);
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════
   ABAS DO RANKING
═══════════════════════════════════════ */
.aba-ranking {
  background: white;
  color: var(--cinza);
  transition: background 0.15s, color 0.15s;
}

.aba-ranking.ativo {
  background: var(--vermelho);
  color: white;
}

/* ═══════════════════════════════════════
   CARD DO RANKING
═══════════════════════════════════════ */
.ranking-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.ranking-pos {
  font-family: 'Bebas Neue', cursive;
  font-size: 1.4rem;
  color: var(--cinza);
  min-width: 32px;
  text-align: center;
}

.ranking-pos.top-1 { color: #FFD700; }
.ranking-pos.top-2 { color: #C0C0C0; }
.ranking-pos.top-3 { color: #CD7F32; }

.ranking-nome {
  flex: 1;
  font-weight: 900;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-nota {
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--vermelho);
  text-align: right;
}

.ranking-sub {
  font-size: 0.7rem;
  color: var(--cinza);
  font-weight: 700;
  text-align: right;
}

/* ═══════════════════════════════════════
   TOAST DE NOTIFICAÇÃO
═══════════════════════════════════════ */
.notif {
  position: fixed;
  bottom: calc(var(--nav-height) + 12px);
  left: 16px;
  right: 16px;
  background: var(--vermelho);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  z-index: var(--z-notif);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.notif.show {
  opacity: 1;
  transform: translateY(0);
}

.notif.erro {
  background: #C0392B;
}

.notif.ok {
  background: var(--verde);
}

/* ═══════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════ */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: var(--cinza);
  text-align: center;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty p {
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0.7;
}

/* ═══════════════════════════════════════
   LEAFLET — POPUP CUSTOMIZADO
═══════════════════════════════════════ */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
}

.leaflet-popup-tip-container {
  display: none;
}

/* ═══════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Esconder scrollbar horizontal dos filtros */
.filtros-scroll::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════
   UTILITÁRIOS
═══════════════════════════════════════ */
.text-vermelho { color: var(--vermelho); }
.text-cinza    { color: var(--cinza); }
.font-heavy    { font-weight: 900; }
.bebas         { font-family: 'Bebas Neue', cursive; }

/* Safe area bottom no conteúdo scrollável */
.scroll-safe {
  padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom, 0px));
}

/* ═══════════════════════════════════════
   RESPONSIVE — só mobile, mas ok em tablet
═══════════════════════════════════════ */
@media (min-width: 480px) {
  body {
    max-width: 440px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.12);
  }
  .nav-bar {
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%);
  }
  .notif {
    max-width: 408px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
  }
  .notif.show {
    transform: translateX(-50%) translateY(0);
  }
}