@import "tailwindcss";

:root {
  --color-primary: #C4566A;
  --color-primary-light: #E8A0A0;
  --color-primary-dark: #8B3A4A;
  --color-gold: #D4A853;
  --color-cream: #FFF8F0;
  --popover: 255 255 255;
  --popover-foreground: 30 41 59;
  --background: 255 255 255;
  --foreground: 30 41 59;
  --muted: 241 245 249;
  --muted-foreground: 100 116 139;
  --border: 226 232 240;
  --input: 226 232 240;
  --ring: 196 86 106;
  --card: 255 255 255;
  --card-foreground: 30 41 59;
  --destructive: 239 68 68;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

/* Envelope animation styles */
.envelope-wrapper {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFF5F5 0%, #FFE8E8 100%);
  z-index: 100;
  transition: opacity 0.6s ease;
}

.envelope-wrapper.opened {
  opacity: 0;
  pointer-events: none;
}

.envelope-container {
  position: relative;
  width: 280px;
  height: 200px;
  cursor: pointer;
  perspective: 1000px;
}

.envelope-body {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #F5E6E8 0%, #E8D0D4 100%);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(196, 86, 106, 0.2);
  overflow: hidden;
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(135deg, #E8D0D4 0%, #D4B8BC 100%);
  transform-origin: top center;
  transition: transform 0.6s ease;
  z-index: 2;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
}

.envelope-container:hover .envelope-flap {
  transform: rotateX(180deg);
}

.letter {
  position: absolute;
  top: 20%;
  left: 10%;
  width: 80%;
  height: 70%;
  background: white;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: transform 0.6s ease 0.3s;
}

.envelope-container:hover .letter {
  transform: translateY(-30px);
}

.letter-title {
  font-size: 14px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.letter-subtitle {
  font-size: 11px;
  color: #999;
}

.open-hint {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--color-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Petal animation */
@keyframes petalFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

.petal {
  position: fixed;
  top: -20px;
  width: 12px;
  height: 12px;
  background: var(--color-primary-light);
  border-radius: 50% 0 50% 50%;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

/* Barrage styles */
.barrage-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.barrage-item {
  position: absolute;
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 14px;
  animation: barrageMove linear forwards;
}

@keyframes barrageMove {
  from { transform: translateX(100vw); }
  to { transform: translateX(-100%); }
}

/* Music button */
.music-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.music-btn.playing {
  animation: spin 3s linear infinite;
}

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

/* Section styles */
.section-title {
  text-align: center;
  font-size: 20px;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 24px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-gold);
  margin: 8px auto 0;
}

/* Card styles */
.wish-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E8D0D4;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  background: white;
}

.form-input:focus {
  border-color: var(--color-primary);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

/* Guest info card */
.guest-card {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFE8E8 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(196, 86, 106, 0.1);
}

/* Navigation dots */
.nav-dots {
  position: fixed;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(196, 86, 106, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.nav-dot.active {
  background: var(--color-primary);
  transform: scale(1.3);
}

/* Scrollbar hide */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
