/* src/css/welcome.css - Photo Card Overhaul */

/* Import Fonts */
@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap");

/* ─── Tweak Welcome Section ────────────────────────────── */
.welcome {
  width: 100%;
  max-width: 455px; /* Restored mobile-first constraint */
  height: 100vh;
  height: 100svh;
  
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  
  background-color: var(--main-bg-color, #e8e8e8);
  /* Dihapus: Batik samar di area putih */
  
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
  padding: 0; /* Removing padding effectively makes card edges touch screen limit */
  box-sizing: border-box;
}

.welcome.swiped {
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.welcome.hide {
  display: none;
}

/* ─── Card ─────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 100%; /* Override max-width to fill screen */
  height: 100%;    /* Fill welcome height */
  background: rgba(255, 255, 255, 0.92); /* Base background behind inner elements */
  border-radius: 0; /* Remove border-radius to fill corner to corner */
  overflow: hidden;
  box-shadow: none; /* No shadow needed if filling the screen */
  position: relative;
  font-family: var(--font-utama, 'Josefin Sans', sans-serif);
  display: flex;
  flex-direction: column;
}

/* ─── Top section ───────────────────────────────────────── */
.card__top {
  position: relative;
  padding: 16px 16px 0 16px; /* Dikurangi sedikit agar lebih lega untuk bagian bawah */
  display: flex;
  flex: 1; /* allow auto grow to push bottom section down */
  min-height: 0; /* needed for nested scrolling or flex shrinking */
  gap: 10px;
  background: var(--card-bg-color, #ffffff); /* Diubah jadi var() agar mengikuti tema dan tidak bentrok dengan teks */
}

/* Left column: badges + vertical text */
.card__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 24px;
  flex-shrink: 0;
  width: 50px;
}

/* Pill badge – default: vertikal */
.badge {
  border: 2px solid var(--heading-text-color, #1a1a1a); /* Diubah jadi var() agar mengikuti tema */
  border-radius: 999px;
  padding: 34px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--heading-text-color, #1a1a1a); /* Diubah jadi var() agar mengikuti tema */
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  line-height: 1;
}

/* Badge PHOTO – horizontal pill */
.badge--horizontal {
  writing-mode: horizontal-tb;
  transform: translateY(14px) translateX(10px); /* Diturunkan sedikit dari 10px ke 14px */
  padding: 8px 16px; /* Padding dikurangi sedikit agar proporsional */
}

/* Copyright symbol */
.copy-symbol {
  font-size: 32px; /* Dikecilkan sedikit dari 44px */
  color: var(--heading-text-color, #1a1a1a); /* Diubah jadi var() agar mengikuti tema */
  font-weight: 300; /* Diubah dari 400 ke 300 agar jauh lebih tipis terang (light) */
  line-height: 1;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif; /* Pastikan menggunakan font yang support ketebalan tipis */
}

/* Vertical FLAVOR text */
.vertical-text {
  font-size: 26px; /* Increased from 22px to be a bit larger */
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--heading-text-color, #1a1a1a); /* Diubah jadi var() agar mengikuti tema */
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg) translateY(-10px); /* Kembali ke arah positif untuk menaikkan teks ke atas layar */
  line-height: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap; /* Prevent breaking into two lines */
}

/* Animasi 3 Titik "The Wedding Of..." */
.anim-dots {
  display: inline-block;
  margin-top: 10px; /* Jarak antara teks "THE WEDDING OF" dengan titik (karena rotated, margin-top / bottom terbalik secara visual, gunakan top untuk mendorong ke "bawah" secara penulisan) */
}

.anim-dots span {
  animation: blinkDots 4s infinite forwards; /* Diperlambat SANGAT signifikan, dari 2.5s ke 4 detik utuh */
  opacity: 0;
  display: inline-block;
  font-size: 38px; /* Diberbesar lagi dari 32px ke 38px */
  line-height: 0.5; /* Proporsi font size yang besar */
  margin: 0 6px; /* Memberi jarak lebh luas dari 4px ke 6px antar titik */
}

.anim-dots span:nth-child(1) {
  animation-delay: 0s;
}
.anim-dots span:nth-child(2) {
  animation-delay: 0.6s; /* Jeda diperlebar ke 0.6s */
}
.anim-dots span:nth-child(3) {
  animation-delay: 1.2s; /* Jeda diperlebar ke 1.2s */
}
.anim-dots span:nth-child(4) {
  animation-delay: 1.8s; /* Jeda diperlebar ke 1.8s */
}

@keyframes blinkDots {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* Right column: photo */
.card__photo-wrap {
  flex: 1;
  position: relative;
  border-radius: 7px 90px 7px 90px; /* Dikembalikan ke bentuk unik aslinya */
  border: 1px solid var(--heading-text-color, #1a1a1a); /* Border navy tipis */
  overflow: hidden;
  height: 100%; /* forces photo wrapper to take full height of top section */
  box-shadow: -4px 8px 24px rgba(0, 0, 0, 0.15); /* Bayangan lembut namun kuat agar foto terlihat menonjol ke depan */
  min-height: 0; /* Important for flex child to shrink if needed */
}

.card__photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* ─── Bottom section ────────────────────────────────────── */
.card__bottom {
  background: 
    linear-gradient(
        rgba(122, 17, 17, 0.85) 0%, 
        rgba(122, 17, 17, 0.85) 100%
    ),
    url('../../../themes/modern_minang/img/bg_songket.png') !important; /* Adding batik pattern */
  background-size: cover !important;
  background-repeat: no-repeat, no-repeat !important;
  border-radius: 90px 0 0 0 !important; /* Diperhalus lengkungannya karena padding berubah */
  border-top: 3px solid var(--accent-color, #d4af37) !important;
  border-left: 3px solid var(--accent-color, #d4af37) !important;
  margin-top: 15px; /* Ditambah agar ada jarak lebih jelas dengan elemen foto di atasnya */
  padding: 24px 26px 20px 26px; /* Dilonggarkan sedikit di bagian atas dan samping */
  color: #fff;
  flex-shrink: 0; /* Prevent bottom section from squishing */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.bottom__content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Super Title (WEDDING INVITATION) */
.bottom__super-title {
  font-size: 10px; /* Font disesuaikan */
  font-weight: 500;
  letter-spacing: 0.25em;
  color: #a3b1c6; /* Abu-abu kebiruan terang */
  text-transform: uppercase;
  margin-bottom: 6px; /* Dirapatkan */
}

/* Ornamen Pembagi */
.bottom__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 12px; /* Dilonggarkan sedikit jarak rnamen ke judul */
  width: 70%;
}
.bottom__divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
}
.bottom__divider i {
  color: var(--accent-color, #d4af37); /* Pakai aksen emas/aksen utama */
  font-size: 10px;
}

/* Judul (Romeo & Juliet) */
.bottom__headline {
  font-size: 25px; /* Sedikit dikecilkan agar hemat ruang vertikal */
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 12px; /* Sisa ruang dikurangi */
}

.couple-name-card {
  font-family: var(--font-utama, 'Playfair Display', serif);
  font-style: italic;
  font-weight: 700;
}

/* Bagian Tamu */
.bottom__guest-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px; /* Margin bawah ke slider sangat dikurangi */
}

.bottom__subtitle {
  font-size: 13px; /* Dikecilkan 1px */
  font-weight: 300;
  color: #ccc;
  margin-bottom: 2px; /* Dirapatkan ke kotak tamu */
  font-style: italic;
}

.guest-name-box {
  padding: 4px 18px; /* Box lebih pipih/kecil */
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 30px;
  background: rgba(255,255,255,0.05); /* Sedikit efek kaca */
}

span.guest-name {
  font-family: var(--font-utama, "Playfair Display", serif);
  font-style: normal;
  font-size: 15px; /* Dikecilkan 1px */
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.05em;
}

/* Action buttons row */
.bottom__actions {
  display: flex;
  justify-content: center;
  margin-top: 0px; /* Di-nol-kan agar slider lebih naik lagi mendekati guest name */
  width: 100%;
}

/* Slider CSS */
.action-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
}

.slider-container {
  width: 100%;
  max-width: 300px;
  height: 55px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.slider-container.disabled {
  opacity: 0; 
  visibility: hidden; 
  pointer-events: none; 
}

.slider-text {
  position: absolute;
  width: 100%;
  text-align: center;
  padding-left: 25px; /* Menggeser teks sedikit ke kanan untuk menyeimbangkan dengan posisi knob */
  box-sizing: border-box;
  font-family: var(--font-utama, 'Josefin Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;

  background: linear-gradient(
    to right,
    rgba(255,255,255,0.4) 0%,
    #ffffff 50%,
    rgba(255,255,255,0.4) 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2.5s linear infinite;
}

.slider-knob {
  width: 45px;
  height: 45px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: #1a1a1a; 
  font-size: 1.4rem;
  transition: transform 0.1s linear;
  will-change: transform;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.slider-knob i {
  color: #1a1a1a !important;
}

.slider-knob:active {
  cursor: grabbing;
  transform: translateY(-50%) scale(0.95);
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

.animate-up-3 {
  animation: fade-in-up 0.8s ease-out 0.6s forwards;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Responsive tweaks ───────────────────────── */
@media (max-height: 800px) {
  /* Beri ruang bawah pada top section agar foto tidak terturup card bawah */
  .card__top {
    padding-bottom: 20px; 
  }

  .card__photo-wrap {
    height: 100%; /* Dikembalikan agar tidak tumpah dan memakan tinggi berlebihan */
  }
  
  /* Shrink Left Sidebar untuk layar standar/kecil */
  .card__left {
    width: 40px;
    gap: 8px;
    padding-bottom: 15px;
  }
  .badge {
    padding: 24px 6px;
    font-size: 11px;
  }
  .badge--horizontal {
    padding: 6px 12px;
    transform: translateY(0) translateX(5px); /* Dinaikkan kembali agar tidak tertutup */
  }
  .copy-symbol {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
  .vertical-text {
    font-size: 20px;
    transform: rotate(180deg) translateY(0); /* Dinetralkan agar tidak lari ke bawah batas */
  }
  .anim-dots span {
    font-size: 24px;
    margin: 0 4px;
  }

  /* Shrink Bottom Card */
  .card__bottom {
    padding: 18px 20px 28px 20px; /* Tambah padding bawah untuk ruang slider dan browser ui */
    margin-top: 10px; /* Pastikan selalu ada margin positif untuk menolak elemen foto di atasnya */
    border-radius: 90px 0 0 0;
  }
  .bottom__super-title {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .bottom__divider {
    margin-bottom: 6px;
  }
  .bottom__headline {
    font-size: 22px;
    margin-bottom: 12px;
  }
  .bottom__guest-section {
    margin-bottom: 8px;
  }
  .bottom__subtitle {
    font-size: 12px;
    margin-bottom: 4px;
  }
  .guest-name-box {
    padding: 4px 16px;
  }
  span.guest-name {
    font-size: 14px;
  }
  .bottom__actions {
    margin-top: 4px;
  }
  .slider-container {
    height: 48px;
    max-width: 250px;
  }
  .slider-knob {
    width: 38px;
    height: 38px;
  }
  .slider-text {
    font-size: 0.85rem;
  }
}
