/* ==================== RED LUXURY WHATSAPP THEME ==================== */
:root {
  --bg-deep: #0b141a;
  /* WhatsApp Dark BG equivalent */
  --bg-panel: #202c33;
  --crimson: #9f1239;
  --rose: #e11d48;
  --gold: #d4af37;
  --bubble-sent: #be123c;
  /* Red Sent Bubble */
  --bubble-received: #202c33;
  /* Dark Received Bubble */
  --text-main: #e9edef;
  --text-muted: #8696a0;

  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);

  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

html,
body {
  background: black;
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  position: fixed;
  /* Stop layout shifts */
  width: 100%;
  overscroll-behavior: none;
  /* Prevent iOS bounce */
}

/* ==================== LIVE BACKGROUND ==================== */
.ambient-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at top right, #3f0909 0%, #000000 60%);
}

#floatingHearts {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* Hearts animation */
.floating-heart {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0;
  animation: floatUp 15s linear forwards;
  z-index: 5;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0;
  }
}

/* ==================== SECTIONS ==================== */
.section {
  position: absolute;
  inset: 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  filter: blur(20px);
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 1.2s cubic-bezier(0.4, 0, 0.2, 1),
              filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  background: transparent !important;
  /* Allow scrolling for vertically tall content */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.section.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0px);
  pointer-events: auto;
  z-index: 20;
}

.landing-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: transparent !important;
  z-index: 30;
}

/* ==================== LANDING ==================== */
.landing-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.animate-reveal {
  animation: fadeUp 0.8s ease forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== AUDIO PLAYER (Clean) ==================== */
.audio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
}

.album-art-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  margin-bottom: 2rem;
}

.album-art {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 12px solid #111;
  box-shadow: 0 0 50px rgba(225, 29, 72, 0.5);
  overflow: hidden;
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  animation: spin 15s linear infinite paused;
  background: #000;
}

/* The vinyl record hole - must be ON TOP */
.album-art::after {
  content: '';
  position: absolute;
  width: 45px;
  height: 45px;
  background: #050507;
  border-radius: 50%;
  border: 4px solid rgba(212, 175, 55, 0.6);
  z-index: 10;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1 !important;
  visibility: visible !important;
}

.album-art.playing {
  animation-play-state: running;
}

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

/* Floating Side-by-Side Controls */
.floating-controls-container {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 200;
  padding: 10px 20px;
  /* Only show when parent section is active */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.section.active .floating-controls-container {
  opacity: 1;
  pointer-events: auto;
}

.btn-play-lg {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--rose);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(225, 29, 72, 0.4);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-play-lg:active {
  transform: scale(0.95);
}

.btn-chat-lively {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  color: black;
  font-weight: bold;
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s;
}

.btn-chat-lively:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

.btn-chat-lively:active {
  transform: scale(0.95);
}

@keyframes breathingGlow {

  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.4));
  }

  50% {
    opacity: 0.4;
    filter: drop-shadow(0 0 15px rgba(212, 175, 55, 0.8));
  }
}

.btn-chat-lively .material-symbols-outlined {
  animation: breathingGlow 3s ease-in-out infinite;
}

/* ==================== DEDICATED FULL-SCREEN CHAT ==================== */
.chat-section {
  padding: 0 !important;
  background: var(--bg-deep);
  z-index: 50;
  /* Override section default styles */
  justify-content: flex-start;
  align-items: stretch;
  /* IMPORTANT: Disable section scrolling for chat, use internal scrolling */
  overflow: hidden !important;
  height: 100vh;
  height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.chat-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: none;
  position: relative;
  overflow: hidden;
}

.chat-header {
  background: rgba(159, 18, 57, 1);
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  z-index: 60;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Momentum scroll */
  padding: 20px 5%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  touch-action: pan-y;
  /* Prevent horizontal layout shifts */
}

.msg-bubble {
  max-width: 80%;
  padding: 6px 7px 8px 9px;
  border-radius: 7.5px;
  position: relative;
  font-size: 14.2px;
  line-height: 19px;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.msg-received {
  align-self: flex-start;
  background: rgba(225, 29, 72, 0.15);
  color: #e9edef;
  border-top-left-radius: 0;
}

.msg-received::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 8px solid rgba(225, 29, 72, 0.15);
  border-left: 8px solid transparent;
}

.msg-sent {
  align-self: flex-end;
  background: var(--bubble-sent);
  color: white;
  border-top-right-radius: 0;
}

.msg-sent::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 8px solid var(--bubble-sent);
  border-right: 8px solid transparent;
}

.time-stamp {
  float: right;
  margin-left: 10px;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.6;
  display: flex;
  gap: 4px;
}

.input-area {
  background: #202c33;
  padding: 8px 10px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.chat-input {
  flex: 1;
  background: #2a3942;
  border: none;
  border-radius: 20px;
  padding: 9px 12px;
  color: #d1d7db;
  font-size: 16px;
  /* 16px prevents iOS zoom on focus */
  outline: none;
}

.btn-send {
  background: var(--rose);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@keyframes bounceLively {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/* Utils */
.hidden {
  display: none !important;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Mini Record in Chat Header */
.mini-record-container {
  padding: 5px;
  cursor: pointer;
  transition: transform 0.2s;
}

.mini-record-container:active {
  transform: scale(0.9);
}

.mini-record {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #111;
  box-shadow: 0 0 10px rgba(225, 29, 72, 0.4);
  overflow: hidden;
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  animation: spin 8s linear infinite paused;
  background: #000;
}

.mini-record::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  background: #050507;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.5);
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.mini-record img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}

.mini-record.playing {
  animation-play-state: running;
}

/* ==================== LETTER ANIMATION ==================== */
@keyframes letterSlideUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0) rotate(var(--rotation, 0deg)) scale(0.2);
    filter: blur(15px) brightness(0.5);
  }
  
  10% {
    opacity: 0.6;
    transform: translateX(-50%) translateY(-50px) rotate(var(--rotation, 0deg)) scale(0.7);
    filter: blur(6px) brightness(1.2);
  }
  
  20% {
    opacity: 1;
    transform: translateX(-50%) translateY(-100px) rotate(var(--rotation, 0deg)) scale(1);
    filter: blur(3px) brightness(1.5);
  }
  
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-300px) rotate(var(--rotation, 0deg)) scale(1);
    filter: blur(3px) brightness(1.3);
  }
  
  65% {
    opacity: 0.95;
    transform: translateX(-50%) translateY(-450px) rotate(var(--rotation, 0deg)) scale(0.98);
    filter: blur(4px) brightness(1.2);
  }
  
  75% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(-550px) rotate(var(--rotation, 0deg)) scale(0.95);
    filter: blur(5px) brightness(1);
  }
  
  82% {
    opacity: 0.6;
    transform: translateX(-50%) translateY(-650px) rotate(var(--rotation, 0deg)) scale(0.9);
    filter: blur(7px) brightness(0.9);
  }
  
  88% {
    opacity: 0.5;
    transform: translateX(-50%) translateY(-750px) rotate(var(--rotation, 0deg)) scale(0.85);
    filter: blur(9px) brightness(1.2);
  }
  
  92% {
    opacity: 0.4;
    transform: translateX(-50%) translateY(-820px) rotate(var(--rotation, 0deg)) scale(1.2);
    filter: blur(5px) brightness(2);
  }
  
  96% {
    opacity: 0.2;
    transform: translateX(-50%) translateY(-900px) rotate(var(--rotation, 0deg)) scale(2.5);
    filter: blur(20px) brightness(3);
  }
  
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-1000px) rotate(var(--rotation, 0deg)) scale(4);
    filter: blur(40px) brightness(0);
  }
}

.animated-letter {
  font-family: 'Playfair Display', serif;
  background: linear-gradient(135deg, #e11d48, #ec4899, #f472b6, #fbbf24);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(225, 29, 72, 0.6),
               0 0 100px rgba(236, 72, 153, 0.4),
               0 0 140px rgba(244, 114, 182, 0.2);
  filter: drop-shadow(0 0 40px rgba(225, 29, 72, 0.5));
  animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}