/* ============================================================
 💙 VARAL DOS SONHOS — STYLE.CSS UNIFICADO (Atualizado 2025)
 Plataforma Web para Gestão de Doações e Conexão Solidária
 Desenvolvido por Carina Mendes
--------------------------------------------------------------
 Compatível com:
 ✅ Airtable API (Vercel)
 ✅ EmailJS (formulários)
 ✅ .NET MAUI WebView
--------------------------------------------------------------
 Estrutura:
 1️⃣ Variáveis e tema global
 2️⃣ Reset e base tipográfica
 3️⃣ Header e Footer fixos
 4️⃣ Componentes reutilizáveis
 5️⃣ Páginas (index, cadastro, carrinho, cartinhas, eventos, pontos de coleta, login)
 6️⃣ Cloudinho — mascote interativo
 7️⃣ Responsividade
============================================================ */


/* ============================================================
 1️⃣ VARIÁVEIS GLOBAIS E TEMA
============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Questrial&family=Shadows+Into+Light+Two&display=swap');

:root {
  --azul-claro: #C7E3F5;
  --azul-medio: #4A90E2;
  --azul-escuro: #003366;
  --branco: #FFFFFF;
  --cinza-claro: #F2F6FA;
  --linha: #D7E6F5;
  --dourado: #caa57b;
  --sombra: 0 6px 20px rgba(0, 51, 102, 0.12);
  --radius: 16px;
  --fonte-titulo: 'Shadows Into Light Two', cursive;
  --fonte-texto: 'Questrial', sans-serif;
}


/* ============================================================
 2️⃣ RESET E BASE GLOBAL
============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--fonte-texto);
  color: var(--azul-escuro);
  background: linear-gradient(to bottom, var(--azul-claro) 0%, var(--branco) 85%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
a:hover { color: var(--azul-medio); }

.container { width: min(1180px, 92%); margin: 0 auto; }


/* ============================================================
 3️⃣ HEADER E FOOTER
============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: #fff;
  border-bottom: 1px solid var(--linha);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.08);
  z-index: 1000;
}

.container.nav {
  width: 90%; max-width: 1200px;
  display: flex; justify-content: space-between; align-items: center;
}

.brand-badge {
  background: linear-gradient(135deg, #4a90e2, #6aa8ff);
  color: #fff;
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(74,144,226,0.3);
  transition: transform 0.2s ease;
}
.brand-badge:hover { transform: scale(1.05); }

.menu { display: flex; align-items: center; gap: 20px; }
.menu a { color: var(--azul-escuro); font-weight: 500; font-size: 0.95rem; transition: 0.2s; }
.menu a:hover { color: var(--azul-medio); transform: translateY(-1px); }

.btn, #btnLogout {
  border-radius: 10px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-outline { border: 1px solid var(--azul-medio); color: var(--azul-medio); background: transparent; }
.btn-outline:hover { background: var(--azul-medio); color: #fff; }
#btnLogout:hover { background: var(--azul-medio); color: #fff; }

.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  background: #fff;
  border-top: 1px solid var(--linha);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 -2px 10px rgba(74, 144, 226, 0.05);
  z-index: 900;
}
.footer-grid {
  display: flex; justify-content: space-between; align-items: center;
  width: 90%; max-width: 1200px; font-size: 0.9rem; color: var(--azul-escuro);
}
.footer-social { display: flex; align-items: center; gap: 6px; transition: 0.3s; }
.footer-social:hover { color: var(--azul-medio); transform: scale(1.05); }


/* ============================================================
 4️⃣ COMPONENTES UNIVERSAIS
============================================================ */
.btn-primary {
  background: var(--azul-medio);
  color: white; border: none; padding: 12px;
  border-radius: 12px; font-size: 16px; font-weight: 600;
}
.btn-primary:hover { background: var(--azul-escuro); transform: scale(1.03); }

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--sombra);
  padding: 1.5rem;
  border: 1px solid var(--linha);
}


/* ============================================================
 💌 CARTINHAS — varal com balanço
============================================================ */
.cartinhas-lista {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(240px, 26vw, 280px);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 16px 8px 40px;
}
.cartinhas-lista::-webkit-scrollbar { height: 8px; }
.cartinhas-lista::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.12);
  border-radius: 8px;
}

.card-cartinha {
  position: relative;
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: 16px;
  box-shadow: var(--sombra);
  padding: 14px;
  scroll-snap-align: start;
  transition: transform .3s ease, box-shadow .3s ease;
  transform-origin: top center;
}
.card-cartinha:hover {
  transform: rotate(2deg) translateY(-6px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.15);
}

.prendedor {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}

.carta {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #eaeef7;
  cursor: zoom-in;
  transition: transform .2s ease;
}
.carta:hover { transform: scale(1.02); }

.card-cartinha h3 {
  font-family: var(--fonte-titulo);
  font-size: 1.2rem;
  margin-top: 8px;
  color: var(--azul-escuro);
}
.card-cartinha p { font-size: 0.95rem; color: #333; }

.btn-adotar {
  margin-top: 10px;
  width: 100%;
  border: none;
  background: var(--azul-medio);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
  animation: pulse 2.5s infinite ease-in-out;
}
.btn-adotar:hover {
  background: var(--azul-escuro);
  transform: translateY(-2px);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,144,226,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(74,144,226,0); }
}

/* Modal de zoom */
.zoom-modal { position: fixed; inset: 0; display: none; z-index: 1100; }
.zoom-modal.is-open { display: block; }
.zoom-backdrop {
  position: absolute; inset:0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(2px);
}
.zoom-figure {
  position: relative; max-width: min(720px, 92vw);
  margin: 6vh auto 0;
}
.zoom-figure img { width: 100%; border-radius: 12px; }
.zoom-figure figcaption { margin-top: 8px; color:#fff; text-align:center; }
.zoom-close {
  position: absolute; top:-10px; right:-10px;
  border:none; background:#fff;
  width:36px; height:36px; border-radius:50%;
  cursor:pointer; font-size:1.1rem;
  box-shadow: var(--sombra);
}


/* ============================================================
 ☁️ CLOUDINHO — Mascote Interativo
============================================================ */
#cloudinho {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 8px;
}
.cloudinho-img {
  width: 80px; height: auto;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25));
  animation: flutuarCloud 3s ease-in-out infinite;
  cursor: pointer;
}
@keyframes flutuarCloud {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cloudinho-bubble {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  padding: 14px 16px;
  font-size: 15px;
  color: #333;
  max-width: 280px;
  transform: translateY(10px);
  opacity: 0;
  transition: all .4s ease;
}
.cloudinho-bubble.show {
  opacity: 1;
  transform: translateY(0);
}

#cloudinhoInput {
  margin-top: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #cfd6e3;
  outline: none;
  transition: border .2s ease;
}
#cloudinhoInput:focus { border-color: var(--azul-medio); }

/* ============================================================
 RESPONSIVIDADE
============================================================ */
@media (max-width: 768px) {
  .cartinhas-lista { grid-auto-columns: 78vw; }
  .cloudinho-img { width: 65px; }
}

/* ============================================================
 ☁️ Cloudinho Popup — Confirmação de Adoção
============================================================ */
.cloudinho-popup {
  position: fixed;
  bottom: 100px;
  right: 25px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  padding: 14px 18px;
  opacity: 0;
  transform: translateY(25px);
  transition: all 0.6s ease;
  z-index: 9999;
}

.cloudinho-popup.show {
  opacity: 1;
  transform: translateY(0);
}

.cloudinho-popup-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cloudinho-popup-img {
  width: 65px;
  height: auto;
  animation: flutuar 3s ease-in-out infinite;
}

@keyframes flutuar {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.cloudinho-popup h3 {
  margin: 0;
  color: #0078ff;
  font-size: 1.1rem;
}

.cloudinho-popup p {
  margin: 3px 0 0;
  font-size: 0.9rem;
  color: #333;
}
