@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Amiri:ital,wght@0,400;0,700;1,400&family=Cinzel:wght@400;600;700;900&family=Great+Vibes&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4f46e5;
  --gold-start: #fae8a4;
  --gold-mid: #eab308;
  --gold-end: #a16207;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
}

/* 3D Envelope Styles */
.envelope-wrapper {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.envelope {
  position: relative;
  width: 340px;
  height: 240px;
  background: #fdfaf6;
  border-radius: 8px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.4s ease;
}

@media (min-width: 640px) {
  .envelope {
    width: 420px;
    height: 280px;
  }
}

.envelope:hover {
  transform: translateY(-4px) scale(1.01);
}

/* Envelope Flaps */
.envelope-pocket {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  pointer-events: none;
  z-index: 4;
}

.pocket-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 140px 0 140px 210px;
  border-color: transparent transparent transparent #f5efe6;
  filter: drop-shadow(2px 0 3px rgba(0,0,0,0.05));
}

.pocket-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 140px 210px 140px 0;
  border-color: transparent #ede5d8 transparent transparent;
  filter: drop-shadow(-2px 0 3px rgba(0,0,0,0.05));
}

.pocket-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 210px 160px 210px;
  border-color: transparent transparent #e6dcce transparent;
  filter: drop-shadow(0 -2px 4px rgba(0,0,0,0.08));
}

/* Flap Top (Opens 180deg) */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  border-style: solid;
  border-width: 160px 210px 0 210px;
  border-color: #f1e9dd transparent transparent transparent;
  transform-origin: top center;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.3s;
  z-index: 5;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
}

.envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* Wax Seal Button */
.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  width: 76px;
  height: 76px;
  z-index: 10;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: seal-pulse 2.2s infinite ease-in-out;
}

.wax-seal:hover {
  transform: translate(-50%, -40%) scale(1.1);
}

.envelope.opened .wax-seal {
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.3);
  pointer-events: none;
}

@keyframes seal-pulse {
  0%, 100% {
    filter: drop-shadow(0 6px 12px rgba(220, 38, 38, 0.45));
    transform: translate(-50%, -40%) scale(1);
  }
  50% {
    filter: drop-shadow(0 10px 20px rgba(220, 38, 38, 0.7));
    transform: translate(-50%, -40%) scale(1.07);
  }
}

/* Inside Letter Card */
.envelope-letter {
  position: absolute;
  inset: 10px;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.envelope.opened .envelope-letter {
  transform: translateY(-80px) scale(1.05);
}

/* Fullscreen Invitation Modal / Slide Up */
.invitation-screen {
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.98);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.invitation-screen.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Floating Audio Player */
.floating-music-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s ease;
}

.floating-music-btn.playing {
  animation: vinyl-spin 4s linear infinite;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border-color: transparent;
}

@keyframes vinyl-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Theme Backgrounds */
.theme-islamic {
  background: radial-gradient(circle at top, #064e3b 0%, #022c22 100%);
  color: #f8fafc;
}
.theme-islamic .card-surface {
  background: rgba(6, 78, 59, 0.7);
  border: 1px solid rgba(217, 119, 6, 0.4);
  backdrop-filter: blur(12px);
}

.theme-premium {
  background: radial-gradient(circle at top, #1c1917 0%, #0c0a09 100%);
  color: #f5f5f4;
}
.theme-premium .card-surface {
  background: rgba(28, 25, 23, 0.8);
  border: 1px solid rgba(234, 179, 8, 0.35);
  backdrop-filter: blur(12px);
}

.theme-romantic {
  background: linear-gradient(135deg, #fff1f2 0%, #fce7f3 50%, #fae8ff 100%);
  color: #831843;
}
.theme-romantic .card-surface {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(244, 114, 182, 0.3);
  backdrop-filter: blur(12px);
}

/* Text Shimmers */
.gold-shimmer {
  background: linear-gradient(90deg, #fae8a4 0%, #eab308 50%, #fae8a4 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  to { background-position: 200% center; }
}

/* Countdown Box */
.timer-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: center;
  min-width: 65px;
}
