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

:root {
  --gold:    #c9a84c;
  --gold-lt: #e8c97a;
  --dark:    #0d0d0d;
  --panel:   rgba(0,0,0,.72);
  --text:    #f0ead8;
  --muted:   rgba(240,234,216,.55);
  --radius:  4px;
  --ease:    cubic-bezier(.25,.46,.45,.94);
}

html, body {
  height: 100%;
  background: var(--dark);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  overflow: hidden;
}

/* ── Layout ───────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: visible;
}

/* ── Header ───────────────────────────────────────────── */
#header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(to bottom, rgba(13,13,13,.65), rgba(13,13,13,.3));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo a { text-decoration: none; }

.logo-img {
  height: 42px;
  width: auto;
  display: block;
  mix-blend-mode: screen;   /* fundo preto da imagem vira transparente */
}

select {
  appearance: none;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(201,168,76,.35);
  color: var(--text);
  font-family: 'Lato', sans-serif;
  font-size: .78rem;
  font-weight: 300;
  letter-spacing: .06em;
  padding: 6px 28px 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23c9a84c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: border-color .2s;
}
select:focus { outline: none; border-color: var(--gold); }
select option { background: #1a1a1a; }

/* ── Feed ─────────────────────────────────────────────── */
#feed {
  flex: 1;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: 80px;
  margin-top: 0;
  min-height: 0;
  touch-action: pan-y;
  position: relative;
  z-index: 1;
}
#feed::-webkit-scrollbar { display: none; }

/* ── Card ─────────────────────────────────────────────── */
.card {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 8s var(--ease);
  transform: scale(1.06);
  filter: brightness(.45) saturate(.8);
}
.card:hover .card__bg { transform: scale(1.0); }

.card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,.2) 0%,
    rgba(0,0,0,.55) 90%,
    rgba(0,0,0,.82) 100%
  );
}

/* ── Conteúdo — estilo "reverse" ──────────────────────── */
.card__content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  width: 100%;
  padding: 32px 40px;
  text-align: center;


}

.card__text {
  font-family: "Dosis", sans-serif;
  font-style: italic;
  font-size: clamp(1.7rem, 2.6vw, 1.7rem);
  line-height: 1.4;
  font-weight: 400;
  /* texto claro sobre o painel */
  color: #f5f0e8;
  margin-bottom: 22px;
  quotes: "\201C" "\201D";
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s .2s, transform .55s .2s var(--ease);
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.card__text::before { content: open-quote; color: var(--gold); }
.card__text::after  { content: close-quote; color: var(--gold); }

/* Referência — discreta, dourada */
.card__ref {
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-lt);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s .35s, transform .5s .35s var(--ease);
}

/* Divisão — badge discreto logo abaixo da referência */
.card__div {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(240,234,216,.55);
  border: 1px solid rgba(240,234,216,.18);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s .5s, transform .5s .5s var(--ease);
}

/* Animação de entrada */
.card.visible .card__text,
.card.visible .card__ref,
.card.visible .card__div {
  opacity: 1;
  transform: translateY(0);
}

/* ── Bottom bar (info + ações) ────────────────────────── */
.card__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 96px;
  background: linear-gradient(to bottom, rgba(13,13,13,.25), rgba(13,13,13,.3));
}

/* ── Ações ────────────────────────────────────────────── */
.card__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.btn-action {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  transition: transform .15s, color .15s;
}
.btn-action:hover  { transform: scale(1.15); color: var(--gold); }
.btn-action:active { transform: scale(.95); }

.btn-action svg {
  width: 28px; height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.6));
  transition: fill .2s, stroke .2s;
  opacity: .7;
}
.btn-action.liked svg { fill: #e74c3c; stroke: #e74c3c; opacity: 1; }

/* ── Scroll hint ──────────────────────────────────────── */
.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  animation: bounceY 2s ease-in-out infinite;
  pointer-events: none;
}
.scroll-hint svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; }

@keyframes bounceY {
  0%,100% { transform: translateX(-50%) translateY(0); opacity: .7; }
  50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* ── Loader ────────────────────────────────────────────── */
#loader {
  height: 100vh;
  scroll-snap-align: start;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
#loader.active { display: flex; }

.spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(201,168,76,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(201,168,76,.15);
  border: 1px solid rgba(201,168,76,.4);
  color: var(--gold-lt);
  font-size: .78rem;
  letter-spacing: .08em;
  padding: 10px 20px;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s, transform .3s var(--ease);
  z-index: 100;
  backdrop-filter: blur(8px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Hamburger ────────────────────────────────────────── */
#filter-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  z-index: 1001;
  margin-left: auto;
}
#filter-toggle-btn span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #fff;
  opacity: .5;
  border-radius: 2px;
  transition: all .3s ease-in-out;
  transform-origin: center;
}
#filter-toggle-btn.active span:nth-child(1) { transform: translateY(10.5px) rotate(45deg); }
#filter-toggle-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#filter-toggle-btn.active span:nth-child(3) { transform: translateY(-10.5px) rotate(-45deg); }

/* ── Filter panel overlay ─────────────────────────────── */
#filter-panel-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease;
}
#filter-panel-overlay.open { opacity: 1; visibility: visible; }

#filter-panel-content {
  position: absolute;
  top: 0; right: 0;
  width: 300px;
  max-width: 85%;
  height: 100%;
  background: #1a1a2e;
  color: #fff;
  padding: 25px;
  box-shadow: -5px 0 20px rgba(0,0,0,.5);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 1002;
  overflow-y: auto;
}
#filter-panel-overlay.open #filter-panel-content { transform: translateX(0); }

#filter-panel-content h3 {
  margin-top: 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  border-bottom: 1px solid #444;
  padding-bottom: 15px;
  margin-bottom: 10px;
}

.panel-group { display: flex; flex-direction: column; gap: 8px; }
.panel-group label { font-size: .9rem; color: #ccc; font-weight: bold; }
.panel-group select {
  padding: 12px;
  background: #0f0c29;
  border: 1px solid #444;
  color: #fff;
  border-radius: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  outline: none;
}
.panel-group select:focus { border-color: #e94560; }

.action-buttons {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

.btn-primary {
  padding: 12px;
  background: #e94560;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background .2s;
}
.btn-primary:hover { background: #d63d56; }

.btn-secondary {
  padding: 12px;
  background: transparent;
  color: #ccc;
  border: 1px solid #555;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: all .2s;
}
.btn-secondary:hover { background: #333; color: #fff; border-color: #777; }

/* Desktop: dropdown */
@media (min-width: 768px) {
  #filter-panel-content {
    width: 280px;
    height: auto;
    top: 65px;
    bottom: auto;
    right: 20px;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    position: absolute;
    box-shadow: 0 10px 25px rgba(0,0,0,.5);
    border-radius: 8px;
  }
  #filter-panel-overlay { display: none; }
  #filter-panel-overlay.open { display: block; }
  #filter-panel-overlay.open #filter-panel-content {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

@media (max-width: 600px) {
  .card__content { padding: 24px 20px; }
  .logo { font-size: 1.2rem; }
}

/* ── Painel de info ────────────────────────────────────── */
.card__info {
  flex: 1;
  min-width: 0;
}

.card__info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.card__info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card__info-label {
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240,234,216,.7);
}

.card__info-value {
  font-size: .82rem;
  font-weight: 400;
  color: rgba(240,234,216,.9);
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Captura de imagem (html2canvas) ──────────────────── */
.card__capture-logo {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 4;
  display: none;          /* oculto na navegação normal */
}

.card.capturing .card__capture-logo { display: block; }
.card.capturing .card__actions,
.card.capturing .scroll-hint {
  visibility: hidden;
}