:root {
  /* Paleta de Cores Modernas */
  --primary: #ff4d6d;
  --primary-dark: #c9184a;
  --primary-light: #ff8fa3;
  --secondary: #590d22;
  
  --bg-page: #fff0f3;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.6);
  
  --text-main: #2d3436;
  --text-sub: #636e72;
  --text-light: #b2bec3;

  --shadow-sm: 0 4px 6px rgba(255, 77, 109, 0.1);
  --shadow-md: 0 10px 30px -10px rgba(255, 77, 109, 0.25);
  --shadow-lg: 0 20px 40px -15px rgba(255, 77, 109, 0.3);
  
  --radius-sm: 12px;
  --radius-md: 24px;
  --radius-lg: 32px;
  
  --font-family: 'Outfit', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Effects */
.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

#particles-bg {
  position: absolute;
  inset: 0;
}

.gradient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: floatBlob 20s infinite alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: #ffccd5;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: #fff0f3;
  animation-delay: -10s;
}

@keyframes floatBlob {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, 50px); }
}

/* Layout Container */
.page-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px 16px 60px;
}

.page {
  width: 100%;
  max-width: 480px; /* Mobile-first width */
  position: relative;
  z-index: 1;
}

/* Icons Generic */
i { vertical-align: middle; }

/* ================= HERO SECTION ================= */
.hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  margin-bottom: 30px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.2), transparent);
  pointer-events: none;
}

.hero-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: rgba(255,255,255,0.2);
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 300;
  line-height: 1.2;
}

.hero h1 span {
  font-weight: 800;
  display: block;
  font-size: 42px;
}

.hero-subtitle {
  margin-top: 16px;
  font-size: 15px;
  opacity: 0.9;
  font-weight: 400;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ================= CARD SYSTEM ================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #ffeef2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.1);
}

.icon-box.secondary { color: #9b59b6; background: #f3e5f5; }
.icon-box.accent { color: #e67e22; background: #fbe9e7; }
.icon-box.warning { color: #e17055; background: #fcece8; }
.icon-box.music-pulse { animation: pulseIcon 2s infinite; }
.icon-box.heart-anim i { animation: beat 1.5s infinite; }

@keyframes beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

@keyframes pulseIcon {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); }
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
}

.card-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-sub);
}

/* ================= TIME GRID ================= */
.time-card {
  background: linear-gradient(to bottom right, #ffffff, #fff0f5);
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.time-box {
  background: rgba(255,255,255,0.5);
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.8);
  transition: transform 0.2s;
}

.time-box:hover {
  transform: scale(1.05);
  background: #fff;
}

.time-number {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 6px;
}

.time-label {
  font-size: 11px;
  color: var(--text-sub);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.subtext {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 16px;
  line-height: 1.4;
  text-align: center;
}

/* ================= SUMMARY STATS ================= */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  margin-bottom: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card .card-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.stat-card .icon-box {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.big-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -1px;
}

.stat-card .subtext {
  margin-top: 6px;
  font-size: 11px;
  text-align: left;
}

.subtext.highlight {
  color: var(--primary);
  font-weight: 500;
}

/* ================= PARTICIPANTS ================= */
.participant-row {
  margin-bottom: 16px;
}

.participant-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.bar {
  background: #fce4ec;
  height: 14px;
  border-radius: 100px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 100px;
  box-shadow: 0 2px 4px rgba(255, 77, 109, 0.2);
  transition: width 1s ease-out;
}

/* ================= CHART ================= */
.chart-wrapper {
  position: relative;
  height: 200px;
  margin-top: 20px;
}

.period-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 12px;
  border-top: 1px dashed rgba(0,0,0,0.05);
  padding-top: 8px;
}

/* ================= LOVE LIST ================= */
.about-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.love-list li {
  background: #fff;
  margin-bottom: 10px;
  padding: 16px;
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-main);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.03);
  line-height: 1.5;
}

.love-list li i {
  color: var(--primary-light);
  font-size: 20px;
  margin-top: 2px;
}

/* ================= TIMELINE ================= */
.timeline {
  border-left: 2px solid #ffd1dc;
  padding-left: 24px;
  margin-left: 10px;
  margin-top: 10px;
}

.timeline-item {
  position: relative;
  margin-bottom: 32px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-item .dot {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 4px solid #fff;
  border-radius: 50%;
  position: absolute;
  left: -33px;
  top: 2px;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.4);
}

.timeline-item .content h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--secondary);
}

.timeline-item .content p {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* ================= MUSIC & MEDIA ================= */
.music-body { text-align: center; }

.music-title {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.music-artist {
  font-size: 14px;
  color: var(--text-sub);
}

.player-container {
  margin-top: 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

#musicPlayer { width: 100%; }

/* ================= SWIPER MEMORIES ================= */
.memory-card {
    width: 100%;
    height: 100%;
    /* Efeito de vidro mais bonito */
    background: rgba(255, 255, 255, 0.15); /* Um pouco mais claro */
    border: 2px solid rgba(255, 255, 255, 0.3); /* Borda mais definida */
    backdrop-filter: blur(12px); /* Mais desfoque no fundo */
    border-radius: 24px; /* Cantos arredondados na moldura */
    
    /* O SEGREDO ESTÁ AQUI: Espaço entre a borda e a foto */
    padding: 15px; 
    box-sizing: border-box;
    
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Garante que nada saia da moldura */
}
.swiper-slide {
    width: 280px !important; /* Um pouco mais largo para acomodar melhor as fotos */
    height: 360px !important;
    border-radius: 24px; /* Arredondamento do card externo */
    /* Sombra suave para dar profundidade ao card inteiro */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.swiper-slide img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.memory-caption {
  padding: 16px 16px 0;
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--secondary);
  text-align: center;
}

.swiper-button-prev, .swiper-button-next {
  color: var(--primary) !important;
  background: rgba(255,255,255,0.8);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.swiper-button-prev:after, .swiper-button-next:after {
  font-size: 18px !important;
  font-weight: bold;
}

.swiper-pagination-bullet-active {
  background: var(--primary) !important;
}

/* ================= FOOTER ================= */
.footer-card {
  text-align: center;
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 40px 20px;
}

.footer-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 16px;
  animation: beat 2s infinite;
}

.footer-card h2 {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--secondary);
}

.footer-card p {
  font-size: 15px;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

/* ================= DESKTOP ADAPTATIONS ================= */
@media (min-width: 768px) {
  .page {
    max-width: 900px;
  }

  .hero {
    padding: 60px 40px;
  }

  .hero h1 { font-size: 48px; }
  .hero h1 span { font-size: 64px; }

  /* Grid Layout for Desktop */
  #result {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    align-items: start;
  }

  /* Spanning elements */
  .time-card { grid-column: span 2; }
  .memories-card { grid-column: span 2; }
  .footer-card { grid-column: span 2; }
  
  /* Adjust Summary Grid inside the main grid */
  .summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .memories-carousel {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* ================= MOBILE ADAPTATIONS ================= */
@media (max-width: 480px) {
  .page-container {
    padding: 10px;
  }
  
  .card {
    padding: 20px 16px;
  }
  
  .hero {
    padding: 30px 20px;
    border-radius: 24px;
  }
  
  .hero h1 span { font-size: 36px; }
}

/* Animação de carregamento da imagem */
.memory-card img {
    opacity: 0;
    transition: opacity 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.memory-card img {
    opacity: 1 !important; /* Garante que aparece */
    width: 100%;
    height: 100%;
    
    /* OPÇÃO 1: 'cover' (Recomendado para ficar mais bonito)
       A foto preenche todo o espaço disponível. Pode cortar um pouquinho 
       das bordas se a foto for muito diferente do formato do card, 
       mas não deixa buracos vazios. */
    object-fit: cover;

    /* OPÇÃO 2: Se você preferir que a foto NUNCA corte, use 'contain'.
       Mas isso vai deixar espaços vazios em cima/embaixo se a foto for quadrada.
       object-fit: contain; 
    */
    
    /* Cantos arredondados NA PRÓPRIA FOTO */
    border-radius: 16px;
    
    /* Uma sombra leve na foto para ela "descolar" do fundo de vidro */
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}