/* ==============================================================================
   LUXURY ROUNDED TUSCAN WEDDING INVITATION — STYLESHEET
   Aesthetic: Soft Rounded Luxury, Fine Paper Stationery, Helvetica Body
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Pinyon+Script&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&display=swap');

:root {
  --color-ivory: #FAF6EF;
  --color-warm-paper: #F4EDE1;
  --color-paper-card: #FFFDF9;
  --color-sage: #8F9980;
  --color-olive: #5B6950;
  --color-deep-olive: #2E392B;
  --color-dark-green: #19241B;
  --color-beige: #D8CDB9;
  --color-gold: #856123;
  --color-gold-light: #E2D1B3;
  --color-gold-dark: #684B18;

  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-calligraphy: "Pinyon Script", cursive;
}

/* Global Reset & Base */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--color-ivory);
  color: var(--color-dark-green);
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-color: var(--color-ivory);
  background-image: 
    radial-gradient(ellipse at 50% 0%, #FFFFFF 0%, transparent 60%),
    linear-gradient(to bottom, #FAF6EF 0%, #F5EFE3 50%, #FAF6EF 100%);
  -webkit-font-smoothing: antialiased;
}

/* Typography Overrides */
.font-calligraphy {
  font-family: var(--font-calligraphy);
}

.font-serif {
  font-family: var(--font-serif);
}

.font-sans, body, input, select, textarea, button {
  font-family: var(--font-body);
}

/* Luxury Soft Rounded Shadows */
.shadow-luxury {
  box-shadow: 0 16px 45px -8px rgba(40, 50, 36, 0.07), 0 4px 15px rgba(40, 50, 36, 0.03);
}

.shadow-luxury-hover:hover {
  box-shadow: 0 24px 60px -12px rgba(40, 50, 36, 0.12), 0 8px 25px rgba(40, 50, 36, 0.05);
}

.shadow-glow-gold {
  box-shadow: 0 8px 30px rgba(133, 97, 35, 0.22);
}

.shadow-dock {
  box-shadow: 0 -4px 25px rgba(25, 36, 27, 0.08), 0 12px 35px rgba(25, 36, 27, 0.15);
}

/* ==============================================================================
   INTERACTIVE 3D WEDDING ENVELOPE (COVER SCREEN)
   ============================================================================== */
.invitation-cover {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--color-warm-paper);
  background-image: 
    radial-gradient(circle at center, #FFFFFF 0%, var(--color-warm-paper) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.85s cubic-bezier(0.4, 0, 0.2, 1), transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1rem;
}

.invitation-cover.is-opened {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.envelope-stage {
  position: relative;
  width: 100%;
  max-width: 350px;
  height: 230px;
  perspective: 1200px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .envelope-stage {
    max-width: 400px;
    height: 260px;
  }
}

.envelope-shell {
  position: relative;
  width: 100%;
  height: 100%;
  background: #EFE7D7;
  border-radius: 1rem;
  box-shadow: 0 24px 50px -10px rgba(40, 50, 36, 0.2), 0 8px 22px rgba(40, 50, 36, 0.08);
  border: 1px solid rgba(226, 209, 179, 0.85);
  cursor: pointer;
}

/* The Letter Card inside the envelope */
.envelope-card {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  height: 210px;
  background-color: #FFFFFF !important;
  border-radius: 0.85rem;
  padding: 1.25rem 1rem;
  border: 1px solid #E2D1B3;
  box-shadow: 0 4px 15px rgba(40, 50, 36, 0.08);
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

/* Surat Muncul Pelan-pelan Keluar dari Amplop */
.envelope-opening .envelope-card {
  opacity: 1;
  transform: translateY(-135px);
  z-index: 10;
  box-shadow: 0 22px 50px rgba(40, 50, 36, 0.24);
  transition: transform 1.15s 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s 0.35s ease, z-index 0.1s 0.4s;
}

@media (min-width: 640px) {
  .envelope-card {
    height: 240px;
  }
  .envelope-opening .envelope-card {
    transform: translateY(-160px);
  }
}

/* Envelope Front Pockets (Left, Right, Bottom) */
.envelope-front-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: 1rem;
  overflow: hidden;
}

/* Jagged Torn Paper Edge on Envelope Body (Visible when ripped) */
.envelope-torn-body {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  height: 30px;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s 0.25s ease;
}

.envelope-opening .envelope-torn-body {
  opacity: 1;
}

/* Top Kop Surat Flap (Animates & Rips Away) */
.envelope-top-kop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110px;
  z-index: 5;
  pointer-events: none;
  transform-origin: top left;
}

.envelope-opening .envelope-top-kop {
  animation: kopSuratRipAway 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes kopSuratRipAway {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: translate(5px, -8px) rotate(2.5deg);
    opacity: 0.98;
  }
  50% {
    transform: translate(-16px, -35px) rotate(-6.5deg);
    opacity: 0.85;
  }
  80% {
    transform: translate(38px, -75px) rotate(16deg);
    opacity: 0.4;
  }
  100% {
    transform: translate(75px, -120px) rotate(25deg);
    opacity: 0;
  }
}

/* Fractured Terracotta Wax Seal Stamp */
.fractured-wax-seal {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #D48B6E 0%, #B35E40 60%, #94462B 100%);
  border: 2px solid #E69D80;
  box-shadow: 0 6px 16px rgba(148, 70, 43, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 6;
  overflow: hidden;
  transition: transform 0.45s ease;
}

.fractured-wax-seal:hover {
  transform: translateX(-50%) scale(1.08);
}

.seal-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: transform 0.6s ease, opacity 0.5s ease;
}

.seal-left {
  left: 0;
  justify-content: flex-end;
  padding-right: 4px;
}

.seal-right {
  right: 0;
  justify-content: flex-start;
  padding-left: 4px;
}

.seal-crack-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(148, 70, 43, 0.8);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.envelope-opening .seal-left {
  transform: translate(-28px, -20px) rotate(-30deg);
  opacity: 0;
}

.envelope-opening .seal-right {
  transform: translate(28px, 18px) rotate(30deg);
  opacity: 0;
}

.envelope-opening .seal-crack-line {
  opacity: 1;
}

/* Flying Torn Paper Scraps */
.paper-scrap {
  position: absolute;
  width: 12px;
  height: 7px;
  background: #FAF6EF;
  border: 1px solid #E2D1B3;
  opacity: 0;
  pointer-events: none;
  border-radius: 2px;
}

.scrap-1 { top: 66px; left: 32%; transform: rotate(14deg); }
.scrap-2 { top: 72px; left: 58%; transform: rotate(-24deg); }
.scrap-3 { top: 64px; left: 78%; transform: rotate(32deg); }

.envelope-opening .scrap-1 {
  animation: scrapFly1 0.75s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

.envelope-opening .scrap-2 {
  animation: scrapFly2 0.75s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

.envelope-opening .scrap-3 {
  animation: scrapFly3 0.75s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes scrapFly1 {
  0% { opacity: 1; transform: translate(0, 0) rotate(14deg); }
  100% { opacity: 0; transform: translate(-35px, -50px) rotate(-85deg); }
}

@keyframes scrapFly2 {
  0% { opacity: 1; transform: translate(0, 0) rotate(-24deg); }
  100% { opacity: 0; transform: translate(30px, -55px) rotate(115deg); }
}

@keyframes scrapFly3 {
  0% { opacity: 1; transform: translate(0, 0) rotate(32deg); }
  100% { opacity: 0; transform: translate(50px, -40px) rotate(165deg); }
}

/* Floating Bottom Navigation Dock */
#floatingBottomNav {
  padding-bottom: env(safe-area-inset-bottom, 1rem);
}

#floatingBottomNav > div {
  background: rgba(255, 253, 249, 0.96) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}

#floatingBottomNav.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-dock-item {
  color: var(--color-olive);
  transition: all 0.25s ease;
}

.nav-dock-item:hover,
.nav-dock-item.active {
  color: var(--color-gold);
  background-color: rgba(226, 209, 179, 0.25);
}

/* Music Spinning Animation */
@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.music-icon-spin.is-playing {
  display: inline-block;
  animation: spinDisc 5s linear infinite;
}

/* Attendance Radio Pill Active State */
.attendance-radio-card {
  transition: all 0.25s ease;
}

.attendance-radio-card.is-selected {
  border-color: var(--color-gold) !important;
  background-color: #F8F4EC !important;
  box-shadow: 0 4px 18px rgba(133, 97, 35, 0.18) !important;
}

/* Sepucuk Surat untuk Mempelai (Letters from Loved Ones) */
.letter-card {
  position: relative;
  background-color: #FFFDF9;
  background-image: 
    linear-gradient(to right, rgba(226, 209, 179, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 209, 179, 0.12) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 1.5rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid rgba(226, 209, 179, 0.85);
  box-shadow: 0 8px 25px -4px rgba(40, 50, 36, 0.06), 0 2px 6px rgba(40, 50, 36, 0.02);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease;
}

.letter-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 35px -6px rgba(40, 50, 36, 0.12);
}

/* Custom Scrollbar for Wish Feed */
#wishesList::-webkit-scrollbar,
#wishesFeedList::-webkit-scrollbar {
  width: 5px;
}

#wishesList::-webkit-scrollbar-track,
#wishesFeedList::-webkit-scrollbar-track {
  background: var(--color-ivory);
  border-radius: 10px;
}

#wishesList::-webkit-scrollbar-thumb,
#wishesFeedList::-webkit-scrollbar-thumb {
  background: var(--color-gold-light);
  border-radius: 10px;
}

#wishesList::-webkit-scrollbar-thumb:hover,
#wishesFeedList::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}

/* Global Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--color-ivory);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold-light);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-gold);
}
