/* ==========================================================================
   Neha's Comfort Haven - Design System
   ========================================================================== */

:root {
  /* Color Palette - Warm, Calming Pastels & Cozy Rose-Gold */
  --bg-gradient-start: #fff1eb;
  --bg-gradient-end: #ace0f9;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.5);
  
  --primary-rose: #ff758f;
  --primary-peach: #ffb5a7;
  --primary-gold: #e5c9c3;
  --accent-gold: #cca43b;
  --accent-lavender: #dec0f1;
  --accent-green: #e2f0d9;
  
  --text-dark: #3a3238;
  --text-muted: #645a61;
  
  --shadow-sm: 0 4px 6px -1px rgba(183, 110, 121, 0.1), 0 2px 4px -1px rgba(183, 110, 121, 0.06);
  --shadow-md: 0 10px 20px -5px rgba(183, 110, 121, 0.15), 0 8px 8px -5px rgba(183, 110, 121, 0.1);
  --shadow-lg: 0 20px 35px -10px rgba(183, 110, 121, 0.2), 0 15px 15px -10px rgba(183, 110, 121, 0.15);
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: 'Fredoka', 'Outfit', sans-serif;
  --font-cute: 'Fredoka', sans-serif;
  --font-handwritten: 'Caveat', cursive;
}

/* ==========================================================================
   Base Styles & Background Particles
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Smooth background floating elements */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  pointer-events: none;
  opacity: 0.35;
  animation: floatUp 15s linear infinite;
  font-size: 1.5rem;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0.8);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(1.2);
    opacity: 0;
  }
}

/* ==========================================================================
   Layout & Framework
   ========================================================================== */

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.haven-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInDown 1s ease-out;
}

.haven-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  font-weight: 700;
  color: #583c4b;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.6);
  margin-bottom: 0.8rem;
}

.haven-header .subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  font-weight: 400;
  max-width: 750px;
  margin: 0 auto 0.5rem auto;
}

.haven-header .instruction {
  font-size: 0.95rem;
  color: #8b7782;
  font-style: italic;
}

/* Grid Layout */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

/* ==========================================================================
   Premium Components: Glassmorphic Cards
   ========================================================================== */

.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.85);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.card-emoji {
  font-size: 2rem;
}

.card h2 {
  font-family: var(--font-sans);
  font-size: 1.45rem;
  font-weight: 700;
  color: #583c4b;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #ff758f 0%, #ff7eb3 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 117, 143, 0.4);
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(255, 117, 143, 0.6);
}

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

.btn-secondary {
  background: white;
  color: #583c4b;
  border: 1px solid rgba(183, 110, 121, 0.3);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #fff8f8;
  border-color: rgba(183, 110, 121, 0.5);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: #583c4b;
  border: 2px dashed rgba(183, 110, 121, 0.4);
}

.btn-outline:hover {
  background: rgba(255, 117, 143, 0.05);
  border-color: rgba(183, 110, 121, 0.7);
  transform: translateY(-2px);
}

.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 45%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 55%
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}

@keyframes shine {
  0% { transform: translate(-100%, -100%) rotate(45deg); }
  100% { transform: translate(100%, 100%) rotate(45deg); }
}

/* ==========================================================================
   Feature Specific Stylings
   ========================================================================== */

/* 1. Bubble Wrap Popper */
.bubble-grid-wrapper {
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(183, 110, 121, 0.2);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bubble-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
  max-width: 320px;
  width: 100%;
}

.bubble {
  aspect-ratio: 1;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 40%, rgba(255, 117, 143, 0.15) 70%, rgba(255, 117, 143, 0.4) 100%);
  border-radius: 50%;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.6), 0 3px 6px rgba(183, 110, 121, 0.2);
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
}

.bubble::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 15%;
  width: 30%;
  height: 30%;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.bubble:active {
  transform: scale(0.9);
}

.bubble.popped {
  background: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 1px rgba(255, 255, 255, 0.5);
  cursor: default;
  pointer-events: none;
}

.bubble.popped::before {
  display: none;
}

/* Pop particle animation */
.pop-effect {
  position: absolute;
  pointer-events: none;
  font-size: 1.2rem;
  animation: popFloat 0.5s ease-out forwards;
}

@keyframes popFloat {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: translateY(-20px) scale(1.3); opacity: 0; }
}

/* 2. Cozy Care Menu */
.menu-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: auto;
}

.menu-item {
  background: white;
  border: 1px solid rgba(183, 110, 121, 0.2);
  border-radius: 18px;
  padding: 1.2rem 0.8rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
}

.menu-item:hover {
  transform: translateY(-4px);
  border-color: var(--primary-rose);
  box-shadow: 0 8px 16px rgba(183, 110, 121, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, rgba(255, 117, 143, 0.03) 100%);
}

.menu-item:hover .item-icon {
  animation: bounceMini 0.5s ease infinite alternate;
}

@keyframes bounceMini {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-6px) scale(1.15); }
}

.menu-item:active {
  transform: scale(0.95);
}

.item-icon {
  font-size: 2.2rem;
}

.item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #583c4b;
  text-align: center;
}

/* Modal / Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(58, 50, 56, 0.45);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.modal-card {
  background: white;
  border-radius: 28px;
  max-width: 500px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalPop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-dark);
}

/* Modal Inside Content Styles */
.menu-reveal {
  text-align: center;
}

.reveal-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
}

/* Steaming effect for coffee */
.steam-container {
  display: flex;
  justify-content: center;
  gap: 6px;
  height: 30px;
  margin-bottom: -10px;
}

.steam-line {
  width: 3px;
  height: 100%;
  background: rgba(183, 110, 121, 0.4);
  border-radius: 50%;
  animation: steamRise 2s infinite ease-in-out;
}

.steam-line:nth-child(2) { animation-delay: 0.4s; }
.steam-line:nth-child(3) { animation-delay: 0.8s; }

@keyframes steamRise {
  0% { transform: translateY(10px) scaleX(1); opacity: 0; filter: blur(1px); }
  50% { transform: translateY(0) scaleX(1.5); opacity: 0.8; filter: blur(2px); }
  100% { transform: translateY(-15px) scaleX(0.5); opacity: 0; filter: blur(3px); }
}

.reveal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #583c4b;
  margin-bottom: 1rem;
}

.reveal-msg {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.reveal-submsg {
  font-family: var(--font-handwritten);
  font-size: 1.55rem;
  color: #ff4d6d;
  margin-top: 0.8rem;
  font-weight: 700;
}

/* 3. Dopamine Card */
.dopamine-display {
  background: white;
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid rgba(183, 110, 121, 0.15);
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.4s ease-out;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dog-image-container {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #fbf8f7;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dog-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dopamine-content {
  text-align: center;
}

.joke-text {
  font-size: 1rem;
  font-weight: 600;
  color: #583c4b;
  margin-bottom: 0.5rem;
}

.romy-message {
  font-family: var(--font-handwritten);
  font-size: 1.55rem;
  color: #ff4d6d;
  font-weight: 700;
}

/* 4. HDFC OOO Generator */
.ooo-display {
  background: #2b2528;
  color: #f5f0f3;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 1.2rem;
  border-radius: 16px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  min-height: 160px;
  display: flex;
  flex-direction: column;
}

.ooo-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.ooo-header .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ooo-header .dot.red { background: #ff5f56; }
.ooo-header .dot.yellow { background: #ffbd2e; }
.ooo-header .dot.green { background: #27c93f; }

.ooo-header .ooo-title {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 0.5rem;
}

.ooo-body {
  white-space: pre-wrap;
  line-height: 1.5;
  flex-grow: 1;
}

.ooo-actions {
  display: flex;
  gap: 1rem;
}

/* 5. Smile Check-in Card (Heartwarming Finale) */
.smile-check-in {
  grid-column: 1 / -1; /* Stretch across all columns */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 240, 243, 0.85) 100%);
  border: 1.5px solid rgba(255, 117, 143, 0.35);
  margin-top: 1.5rem;
}

.smile-question {
  text-align: center;
}

.smile-question h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #583c4b;
  margin-bottom: 1.5rem;
}

.smile-btns {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.smile-btns .btn {
  width: auto;
  min-width: 160px;
}

/* Secret Message Reveal */
.secret-card {
  text-align: center;
  padding: 1rem 0;
  animation: zoomReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes zoomReveal {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.secret-content .heart-icon {
  font-size: 3.5rem;
  color: #ff4d6d;
  margin-bottom: 1rem;
  animation: heartPulse 1.2s infinite ease-in-out;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.secret-content .main-quote {
  font-family: var(--font-handwritten);
  font-size: 2.3rem;
  color: #590d22;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(255, 117, 143, 0.2);
}

.secret-content .sub-quote {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  color: #ff4d6d;
  margin-bottom: 1.5rem;
}

.secret-content .dog-illustration {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: wiggle 2s infinite ease-in-out;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.secret-content .signature {
  font-family: var(--font-handwritten);
  font-size: 1.6rem;
  color: #ff4d6d;
  font-weight: 700;
}

/* Grumpy Card Reveal */
.grumpy-card {
  text-align: center;
  padding: 1rem 0;
  animation: zoomReveal 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.grumpy-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #583c4b;
  margin-bottom: 1rem;
}

.grumpy-content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.chocolate-box {
  font-size: 3rem;
  margin: 1.2rem 0;
  animation: bounce 1.5s infinite;
}

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

.grumpy-note {
  font-family: var(--font-handwritten);
  font-size: 1.65rem;
  color: #7b2cbf;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.btn-small {
  width: auto;
  padding: 0.5rem 1.2rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   Music Panel & Footer
   ========================================================================== */

.music-control-panel {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
}

.music-btn {
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--card-border);
  color: #583c4b;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.music-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.music-btn.playing {
  background: rgba(255, 117, 143, 0.15);
  border-color: rgba(255, 117, 143, 0.4);
  color: #ff4d6d;
}

.haven-footer {
  text-align: center;
  margin-top: auto;
  padding-top: 3rem;
  color: #8b7782;
  font-size: 0.85rem;
}

/* ==========================================================================
   Utility Helpers
   ========================================================================== */

.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeInDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

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

/* Sparkles effect spawn */
.sparkle-spawn {
  position: fixed;
  pointer-events: none;
  font-size: 1.5rem;
  z-index: 999;
  animation: sparkleFloat 1.2s ease-out forwards;
}

@keyframes sparkleFloat {
  0% { transform: translate(-50%, -50%) scale(0.5) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-50%, -100px) scale(1.3) rotate(180deg); opacity: 0; }
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 600px) {
  .main-container {
    padding: 1.5rem 1rem;
  }
  
  .haven-header {
    margin-bottom: 2rem;
  }
  
  .music-control-panel {
    position: relative;
    top: 0;
    right: 0;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .smile-btns {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .smile-btns .btn {
    width: 100%;
  }
  
  .secret-content .main-quote {
    font-size: 1.4rem;
  }
  
  .secret-content .sub-quote {
    font-size: 1.25rem;
  }
}
