/* ========================================
   BASE STYLES — Viajantes Conectados
   Paleta: Navy profundo + Ouro + Branco limpo
   ======================================== */

:root {
  /* ── Paleta principal ── */
  --cor-primaria:          #1a3a5c;
  --cor-primaria-light:    #2a5298;
  --cor-acento:            #d4a847;
  --cor-acento-light:      #f0c96a;
  --cor-acento-bg:         rgba(212, 168, 71, .1);
  --cor-secundaria:        #2d9e6b;
  --cor-perigo:            #c0392b;

  /* ── Superfícies ── */
  --cor-fundo:             #f5f3f0;
  --cor-superficie:        #ffffff;
  --cor-superficie-alt:    #f7f5f2;
  --cor-borda:             #e2ddd8;

  /* ── Texto ── */
  --cor-texto:             #1a1a2e;
  --cor-texto-secundario:  #6b7280;
  --cor-texto-muted:       #9ca3af;

  /* ── Sombras ── */
  --sombra-suave:  0 2px 12px rgba(0, 0, 0, .07);
  --sombra-media:  0 6px 28px rgba(0, 0, 0, .11);
  --sombra-forte:  0 16px 50px rgba(0, 0, 0, .16);
  --sombra-ouro:   0 4px 24px rgba(212, 168, 71, .22);

  /* ── Raios ── */
  --raio:       14px;
  --raio-sm:    8px;
  --raio-pill:  100px;

  /* ── Transição ── */
  --transicao-padrao: all .28s cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--cor-fundo);
  min-height: 100vh;
  color: var(--cor-texto);
  overflow-x: hidden;
}

/* ========================================
   ANIMAÇÕES GLOBAIS
   ======================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.fade-in      { animation: fadeIn      .6s ease-out forwards; }
.slide-in-right { animation: slideInRight .6s ease-out forwards; }
.slide-in-left  { animation: slideInLeft  .6s ease-out forwards; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ========================================
   NAVEGAÇÃO
   ======================================== */

.navbar-custom {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--sombra-suave);
  padding: .9rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transicao-padrao);
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.navbar-custom.scrolled {
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--sombra-media);
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--cor-primaria) !important;
  letter-spacing: -.02em;
  transition: var(--transicao-padrao);
}
.navbar-brand:hover { transform: scale(1.04); }

.nav-link {
  color: var(--cor-texto) !important;
  font-weight: 500;
  margin: 0 .4rem;
  position: relative;
  transition: var(--transicao-padrao);
  font-size: .95rem;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--cor-acento);
  border-radius: 2px;
  transition: width .28s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: var(--cor-primaria) !important; }

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.container-principal {
  background: var(--cor-superficie);
  border-radius: var(--raio);
  box-shadow: var(--sombra-media);
  padding: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
  animation: fadeIn .7s ease-out;
}

/* ========================================
   CARTÕES GLOBAIS
   ======================================== */

.card-viajante {
  border: none;
  border-radius: var(--raio);
  overflow: hidden;
  transition: var(--transicao-padrao);
  box-shadow: var(--sombra-suave);
  height: 100%;
  background: var(--cor-superficie);
}
.card-viajante:hover {
  transform: translateY(-8px);
  box-shadow: var(--sombra-media);
}
.card-viajante img {
  height: 200px;
  object-fit: cover;
  transition: transform .4s ease;
}
.card-viajante:hover img { transform: scale(1.07); }

/* ========================================
   BOTÕES
   ======================================== */

.btn-custom {
  padding: .75rem 1.75rem;
  border-radius: var(--raio-pill);
  font-weight: 600;
  letter-spacing: .06em;
  font-size: .85rem;
  transition: var(--transicao-padrao);
  border: none;
  position: relative;
  overflow: hidden;
  align-items: center;
  text-align: center;
  gap: .5rem;
}
.btn-custom::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  transform: translate(-50%, -50%);
  transition: width .55s ease, height .55s ease;
}
.btn-custom:hover::before { width: 280px; height: 280px; }

.btn-primario {
  background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-primaria-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26, 58, 92, .28);
}
.btn-primario:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(26, 58, 92, .38);
  color: #fff;
}

.btn-secundario {
  background: linear-gradient(135deg, var(--cor-acento) 0%, #dca423 100%);
  color: #f9f9f9;
  box-shadow: var(--sombra-ouro);
}
.btn-secundario:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(212, 168, 71, .45);
  color: #ffffff;
}

.btn-acento {
  background: linear-gradient(135deg, var(--cor-perigo) 0%, #922b21 100%);
  color: #fff;
}

/* Botão gold premium (para uso em destaque) */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--raio-sm);
  font-weight: 700;
  font-size: .9rem;
  background: linear-gradient(135deg, var(--cor-acento), #b8891f);
  color: #ffffffe1;
  border: none;
  box-shadow: var(--sombra-ouro);
  transition: var(--transicao-padrao);
  text-decoration: none;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 168, 71, .42);
  color: #ffffff;
}

/* Botão ghost navy */
.btn-ghost-navy {
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--raio-sm);
  font-weight: 600;
  font-size: .9rem;
  background: transparent;
  color: var(--cor-primaria);
  border: 1.5px solid var(--cor-primaria);
  transition: var(--transicao-padrao);
  text-decoration: none;
}
.btn-ghost-navy:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-2px);
}

/* ========================================
   FORMULÁRIOS
   ======================================== */

.form-control-custom {
  border: 1.5px solid var(--cor-borda);
  border-radius: var(--raio-sm);
  padding: .7rem 1rem;
  font-size: .9rem;
  color: var(--cor-texto);
  background: var(--cor-superficie);
  transition: var(--transicao-padrao);
}
.form-control-custom:focus {
  border-color: var(--cor-primaria-light);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, .12);
  transform: translateY(-1px);
  outline: none;
}

/* Labels */
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: var(--cor-texto);
  margin-bottom: .35rem;
}

/* ========================================
   BADGES / STATUS
   ======================================== */

.badge-status {
  padding: .4rem .9rem;
  border-radius: var(--raio-pill);
  font-weight: 600;
  font-size: .75rem;
  letter-spacing: .04em;
  color: white;
}

/* ========================================
   ALERTAS FIXOS (topo)
   ======================================== */

.alerts-fixed-container {
  position: fixed;
  top: 70px;
  left: 0; right: 0;
  z-index: 1100;
  pointer-events: none;
  display: flex;
  justify-content: center;
  padding: .75rem 1rem;
}
.alerts-fixed-container .container {
  max-width: 960px;
  width: 100%;
  pointer-events: auto;
}

.alert-custom {
  padding: .85rem 1.25rem;
  border-radius: var(--raio-sm);
  font-weight: 500;
  font-size: .9rem;
  box-shadow: var(--sombra-media);
  border-left: 5px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.alert-success {
  background: #d1e7dd;
  border-left-color: #0f5132;
  color: #0f5132;
}
.alert-danger, .alert-error {
  background: #f8d7da;
  border-left-color: #842029;
  color: #842029;
}
.alert-warning {
  background: #fff3cd;
  border-left-color: #856404;
  color: #664d03;
}
.alert-info {
  background: #dbeafe;
  border-left-color: var(--cor-primaria);
  color: var(--cor-primaria);
}

.icon-alert {
  font-size: 1.25rem;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.18));
}

/* ========================================
   MAPA
   ======================================== */

#mapa-container {
  height: 500px;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra-media);
  position: relative;
  border: 1px solid var(--cor-borda);
}
#mapa { width: 100%; height: 100%; }

/* ========================================
   LOADING OVERLAY
   ======================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, .92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transicao-padrao);
}
.loading-overlay.active { opacity: 1; visibility: visible; }

.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--cor-borda);
  border-top-color: var(--cor-primaria);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}

/* ========================================
   CHAT
   ======================================== */

.chat-container {
  height: 600px;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra-media);
  border: 1px solid var(--cor-borda);
}

.chat-mensagens {
  height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--cor-superficie-alt);
}
.chat-mensagens::-webkit-scrollbar { width: 5px; }
.chat-mensagens::-webkit-scrollbar-track { background: transparent; }
.chat-mensagens::-webkit-scrollbar-thumb {
  background: var(--cor-borda);
  border-radius: 4px;
}

.mensagem {
  max-width: 72%;
  margin-bottom: 1rem;
  padding: .7rem 1rem;
  border-radius: var(--raio);
  animation: fadeIn .25s ease-out;
  font-size: .9rem;
  line-height: 1.55;
}
.mensagem-enviada {
  background: linear-gradient(135deg, var(--cor-primaria), var(--cor-primaria-light));
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.mensagem-recebida {
  background: var(--cor-superficie);
  color: var(--cor-texto);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--cor-borda);
}

/* ========================================
   EFEITOS DE FUNDO
   ======================================== */

.background-animado::before {
  content: '';
  position: fixed;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background:
    radial-gradient(circle, rgba(26, 58, 92, .06) 1px, transparent 1px),
    radial-gradient(circle, rgba(212, 168, 71, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: 0 0, 24px 24px;
  animation: float 22s linear infinite;
  z-index: -1;
  pointer-events: none;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

@media (max-width: 991.98px) {
  .container-principal { margin: 1.25rem; padding: 1.5rem; }
}

@media (max-width: 767.98px) {
  .container-principal { margin: .75rem; padding: 1rem; }
  .navbar-brand { font-size: 1.2rem; }
  #mapa-container { height: 280px; }
  .chat-container { height: 420px; }
  .card-viajante img { height: 160px; }
}

/* ========================================
   FOOTER
   ======================================== */

.footer-custom {
  background: var(--cor-primaria);
  color: rgba(255, 255, 255, .7);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .75rem;
}

.footer-description {
  font-size: .88rem;
  color: rgba(255, 255, 255, .55);
  max-width: 480px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.footer-links a {
  color: rgba(255, 255, 255, .55);
  text-decoration: none;
  font-size: .83rem;
  font-weight: 500;
  transition: color .2s ease;
}
.footer-links a:hover { color: var(--cor-acento); }

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.footer-social a {
  color: rgba(255, 255, 255, .45);
  font-size: 1.2rem;
  transition: color .2s ease, transform .2s ease;
  text-decoration: none;
}
.footer-social a:hover {
  color: var(--cor-acento);
  transform: translateY(-2px);
}

.footer-copy {
  font-size: .78rem;
  color: rgba(255, 255, 255, .3);
  margin: 0;
}
