/* Cute design system, themes, layout, and animations for Pregnancy Countdown */

:root {
  /* Default/Rose Theme Variables */
  --bg-gradient: linear-gradient(135deg, #FFE5EC 0%, #FFF0F5 50%, #E8F0FE 100%);
  --primary-color: #FF8DA1;
  --primary-hover: #FF6B86;
  --secondary-color: #9F86C0;
  --secondary-hover: #8F72B5;
  --accent-color: #FFC4D6;
  --text-main: #4A3E56;
  --text-muted: #7E6C90;
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-bg-glass: rgba(255, 255, 255, 0.82);
  --card-border: rgba(255, 255, 255, 0.4);
  --card-shadow: 0 12px 32px rgba(159, 134, 192, 0.12);
  --font-header: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --washi-tape-color: rgba(255, 196, 214, 0.7);
  --polaroid-shadow: 0 10px 25px rgba(74, 62, 86, 0.15);
}

/* Theme overrides */
body.theme-blue {
  --bg-gradient: linear-gradient(135deg, #E0F2FE 0%, #F0FDFA 50%, #ECFDF5 100%);
  --primary-color: #38BDF8;
  --primary-hover: #0EA5E9;
  --secondary-color: #0D9488;
  --secondary-hover: #0F766E;
  --accent-color: #BAE6FD;
  --text-main: #1E293B;
  --text-muted: #475569;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-bg-glass: rgba(240, 253, 250, 0.82);
  --card-border: rgba(255, 255, 255, 0.5);
  --card-shadow: 0 12px 32px rgba(14, 165, 233, 0.08);
  --washi-tape-color: rgba(186, 230, 253, 0.7);
  --polaroid-shadow: 0 10px 25px rgba(30, 41, 59, 0.12);
}

body.theme-cream {
  --bg-gradient: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 50%, #FAF7F0 100%);
  --primary-color: #D97706;
  --primary-hover: #B45309;
  --secondary-color: #65A30D;
  --secondary-hover: #4D7C0F;
  --accent-color: #FDE68A;
  --text-main: #451A03;
  --text-muted: #78350F;
  --card-bg: rgba(255, 255, 255, 0.75);
  --card-bg-glass: rgba(255, 251, 235, 0.82);
  --card-border: rgba(255, 255, 255, 0.6);
  --card-shadow: 0 12px 32px rgba(217, 119, 6, 0.08);
  --washi-tape-color: rgba(253, 230, 138, 0.7);
  --polaroid-shadow: 0 10px 25px rgba(69, 26, 3, 0.1);
}

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

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  transition: background 0.8s ease;
}

/* Floating Animations in Background */
.decorations-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-bubble {
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.1) 70%);
  border-radius: 50%;
  animation: floatUp 15s linear infinite;
  bottom: -100px;
}

.bg-heart {
  position: absolute;
  color: var(--primary-color);
  opacity: 0.15;
  font-size: 1.5rem;
  animation: floatDrift 18s ease-in-out infinite;
  bottom: -50px;
}

/* Mouse Sparkle Trails */
.mouse-particle {
  position: absolute;
  pointer-events: none;
  z-index: 999;
  font-size: 14px;
  animation: fadeParticle 0.8s ease-out forwards;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header styling */
.app-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 1s ease-out;
}

.header-heart-icon {
  font-size: 2.8rem;
  margin-bottom: 10px;
  display: inline-block;
  animation: heartBeat 2s infinite;
}

.app-header h1 {
  font-family: var(--font-header);
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(74, 62, 86, 0.05);
}

.app-header .subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  font-weight: 500;
}

#eddDisplayDate {
  font-weight: 700;
  color: var(--primary-color);
}

/* Greeting Banner */
.baby-greeting-banner {
  display: inline-block;
  background: rgba(255, 255, 255, 0.85);
  border: 2.5px dashed var(--primary-color);
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-header);
  color: var(--secondary-color);
  font-size: 1.05rem;
  margin-top: 15px;
  box-shadow: 0 4px 15px rgba(255, 141, 161, 0.08);
  animation: floatWiggle 4s ease-in-out infinite;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  flex-grow: 1;
  margin-bottom: 40px;
}

.left-column, .center-column {
  grid-column: span 1;
}


.card-section {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Cards Base */
.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.5s ease;
  margin-bottom: 24px;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(159, 134, 192, 0.18);
}

.card-title {
  font-family: var(--font-header);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--secondary-color);
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.9);
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -8px;
  margin-bottom: 20px;
}

/* Polaroid Container Styles (Swinging Polaroid) */
.polaroid-frame {
  background: #ffffff;
  padding: 16px 16px 50px 16px;
  border-radius: 4px;
  box-shadow: var(--polaroid-shadow);
  max-width: 320px;
  width: 100%;
  transform-origin: top center;
  animation: swingPolaroid 8s ease-in-out infinite;
  position: relative;
  cursor: default;
}

.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.03) !important;
  box-shadow: 0 16px 35px rgba(74, 62, 86, 0.25);
  animation-play-state: paused;
}

.washi-tape {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(2deg);
  width: 110px;
  height: 24px;
  background: var(--washi-tape-color);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  clip-path: polygon(5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%, 0% 50%);
  z-index: 2;
}

.photo-wrapper {
  position: relative;
  width: 100%;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  border-radius: 2px;
  height: auto;
}

.photo-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.photo-wrapper:hover img {
  transform: scale(1.05);
}



.polaroid-caption {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-header);
  font-size: 1.1rem;
  color: #555;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  position: relative;
}

.polaroid-caption p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.edit-caption-btn {
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.2s ease;
}

.polaroid-frame:hover .edit-caption-btn {
  opacity: 1;
}

/* Scrapbook Love Notes */
.love-notes-card {
  display: flex;
  flex-direction: column;
}

.love-notes-input {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.love-notes-input input {
  flex: 1;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

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

.love-notes-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.love-notes-list::-webkit-scrollbar {
  width: 4px;
}

.love-notes-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.love-note-sticker {
  border: 1px solid rgba(0,0,0,0.03);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(74, 62, 86, 0.05);
  position: relative;
  font-family: var(--font-body);
  line-height: 1.4;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.love-note-sticker:hover {
  transform: scale(1.03) rotate(0deg) !important;
  box-shadow: 0 8px 18px rgba(74, 62, 86, 0.1);
  z-index: 10;
}

.love-note-sticker:nth-child(odd) {
  transform: rotate(-1.5deg);
  background: #FFFEE0; /* Soft Pastel Yellow */
}

.love-note-sticker:nth-child(even) {
  transform: rotate(1.5deg);
  background: #E8F8FF; /* Soft Pastel Blue */
}

.love-note-sticker:nth-child(3n) {
  background: #FFEBF0; /* Soft Pastel Pink */
}

.love-note-delete {
  position: absolute;
  top: 6px;
  right: 8px;
  cursor: pointer;
  font-weight: bold;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.4;
  transition: opacity 0.2s, color 0.2s;
}

.love-note-sticker:hover .love-note-delete {
  opacity: 1;
}

.love-note-delete:hover {
  color: #ef4444;
}

.love-note-date {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: right;
}

/* Countdown widgets styling */
.countdown-timer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 20px 0;
}

.timer-segment {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 2px dashed var(--primary-color);
  border-radius: 20px 20px 16px 16px;
  padding: 12px 6px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(74, 62, 86, 0.04);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timer-segment:hover {
  transform: scale(1.08) translateY(-2px);
}

.timer-val {
  display: block;
  font-family: var(--font-header);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.1;
  margin-bottom: 2px;
}

.timer-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Progress bar */
.progress-bar-outer {
  background: rgba(255, 255, 255, 0.5);
  height: 22px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  margin-top: 15px;
}

.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 12px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(255, 141, 161, 0.2);
  animation: barGlow 3s infinite ease-in-out;
}

.progress-percentage-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Milestone Section styling */
.gestational-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.gestational-weeks {
  font-family: var(--font-header);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  color: var(--secondary-color);
}

.baby-size-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fruit-icon-wrapper {
  font-size: 3rem;
  width: 70px;
  height: 70px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(74, 62, 86, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  animation: floatWiggle 4s ease-in-out infinite;
}

.size-details h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.highlight-text {
  color: var(--primary-color);
  font-weight: 700;
}

.size-specs {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.milestone-desc {
  background: #ffffff;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(74, 62, 86, 0.03);
  border: 1px solid rgba(0,0,0,0.02);
}

.milestone-desc h4 {
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--secondary-color);
}

.milestone-desc p {
  font-size: 0.9rem;
  color: var(--text-main);
}

/* Kick Counter Styles */
.kick-counter-card {
  text-align: center;
}

.kick-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 15px 0;
}

.kick-count-large {
  font-family: var(--font-header);
  font-size: 4.5rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  text-shadow: 0 4px 10px rgba(255, 141, 161, 0.25);
  transition: transform 0.1s ease;
}

.kick-count-large.bounce {
  transform: scale(1.25);
}

.kick-timer {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255,255,255,0.7);
  padding: 4px 12px;
  border-radius: 20px;
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.9);
}

.kick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-kick {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  position: relative;
  overflow: hidden;
}

.kick-history {
  border-top: 1px dashed var(--card-border);
  padding-top: 15px;
  text-align: left;
}

.kick-history h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 700;
}

.history-list {
  list-style: none;
  max-height: 100px;
  overflow-y: auto;
  font-size: 0.8rem;
  padding-right: 4px;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.history-list li {
  padding: 6px 8px;
  background: rgba(255,255,255,0.4);
  border-radius: 8px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  border-left: 3.5px solid var(--primary-color);
}

.empty-msg {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  border: none !important;
  background: transparent !important;
}

/* Floating heart for active click effects */
.floating-heart {
  position: absolute;
  color: #FF5A79;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 10;
  animation: flyUpAndFade 1.2s ease-out forwards;
}

/* Names Board styling */
.names-card {
  display: flex;
  flex-direction: column;
}

.tabs-header {
  display: flex;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 4px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(74, 62, 86, 0.05);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group input {
  flex: 1;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.8);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  transition: border 0.2s;
}

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

.btn-add {
  background: var(--primary-color);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 1.4rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.btn-add:hover {
  background: var(--primary-hover);
}

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

.name-list {
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 4px;
}

.name-list::-webkit-scrollbar {
  width: 4px;
}

.name-list::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.name-chip {
  background: #ffffff;
  border: 1.5px dashed rgba(159, 134, 192, 0.3);
  border-radius: 50px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(74, 62, 86, 0.02);
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.name-chip:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--primary-color);
  box-shadow: 0 6px 12px rgba(159, 134, 192, 0.1);
}

.name-chip-delete {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: bold;
  transition: color 0.15s;
}

.name-chip-delete:hover {
  color: #ef4444;
}

/* Button UI Components */
.btn {
  border: none;
  border-radius: 16px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
}

.btn:hover {
  transform: scale(1.05) translateY(-2px);
}

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

.btn-primary {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(255, 141, 161, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(255, 141, 161, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(74, 62, 86, 0.05);
}

.btn-accent {
  background: var(--secondary-color);
  color: #fff;
  box-shadow: 0 4px 15px rgba(159, 134, 192, 0.25);
}

.btn-accent:hover {
  background: var(--secondary-hover);
  box-shadow: 0 6px 20px rgba(159, 134, 192, 0.35);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.btn-group {
  display: flex;
  gap: 8px;
}

.btn-group .btn {
  flex: 1;
}

/* Footer Section styling */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px dashed var(--card-border);
  margin-top: auto;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-credit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: right;
}

.btn-audio-toggle {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  padding: 8px 16px;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  box-shadow: var(--card-shadow);
}

.btn-audio-toggle:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

.music-note-icon {
  display: inline-block;
}

.btn-audio-toggle.active .music-note-icon {
  animation: noteRotate 2s linear infinite;
  color: var(--primary-color);
}

/* Footer Theme Switcher */
.footer-theme-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  padding: 6px 14px;
  border-radius: 50px;
  box-shadow: var(--card-shadow);
}

.theme-switcher-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.theme-pills {
  display: flex;
  gap: 6px;
}

.theme-pill {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, border-color 0.2s;
}

.theme-pill:hover {
  transform: scale(1.2);
}

.theme-pill.active {
  transform: scale(1.25);
  border-color: var(--primary-color);
}

.theme-pill[data-theme="default"] {
  background: linear-gradient(135deg, #FFE5EC, #9F86C0);
}

.theme-pill[data-theme="blue"] {
  background: linear-gradient(135deg, #BAE6FD, #0D9488);
}

.theme-pill[data-theme="cream"] {
  background: linear-gradient(135deg, #FDE68A, #65A30D);
}

/* Modals Backdrop (Modal Overlay) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(74, 62, 86, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  width: 90%;
  max-width: 480px;
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(74, 62, 86, 0.25);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.mini-modal {
  max-width: 380px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-family: var(--font-header);
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text-main);
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-group input {
  border: 1.5px solid rgba(74, 62, 86, 0.15);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.modal-footer .btn {
  padding: 10px 22px;
}

/* Keyframes Animations */
@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-120vh) rotate(360deg);
    opacity: 0;
  }
}

@keyframes floatDrift {
  0%, 100% {
    transform: translateY(0) translateX(0) rotate(0deg);
  }
  25% {
    transform: translateY(-30vh) translateX(30px) rotate(15deg);
  }
  50% {
    transform: translateY(-60vh) translateX(-20px) rotate(-10deg);
  }
  75% {
    transform: translateY(-90vh) translateX(15px) rotate(10deg);
  }
}

@keyframes flyUpAndFade {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  15% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    transform: translateY(-100px) translateX(var(--drift, 20px)) scale(0.8);
    opacity: 0;
  }
}

@keyframes fadeParticle {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-30px) scale(0.3) rotate(45deg);
    opacity: 0;
  }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.5deg); }
}

@keyframes swingPolaroid {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(1.5deg); }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 141, 161, 0.4); }
  50% { box-shadow: 0 0 25px rgba(159, 134, 192, 0.7); }
}

@keyframes barGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255,141,161,0.5)); }
  50% { filter: drop-shadow(0 0 6px rgba(255,141,161,0.9)); }
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

@keyframes floatWiggle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
}

@keyframes noteRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  
  .left-column, .center-column, .right-column {
    grid-column: span 1 !important;
  }
  
  .card-section {
    order: -1; /* Ultrasound photo frame stays at the top on mobile */
  }
  
  .app-header h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: 15px 10px;
  }
  
  .app-header {
    margin-bottom: 25px;
  }

  .app-header h1 {
    font-size: 1.8rem;
  }

  .countdown-timer {
    gap: 6px;
  }

  .timer-segment {
    padding: 8px 4px;
  }

  .timer-val {
    font-size: 1.5rem;
  }

  .timer-label {
    font-size: 0.65rem;
  }
  
  .app-footer {
    flex-direction: column;
    gap: 15px;
    padding-top: 15px;
  }
  
  .footer-credit {
    text-align: center;
  }
}

/* Baby Gallery Styles */
.baby-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

/* Fetal Heartbeat Counter Card */
.heartbeat-counter-card {
  text-align: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.heartbeat-stats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
}

.heart-pulse-container {
  font-size: 3.5rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.heart-emoji-pulse {
  display: inline-block;
  transform-origin: center;
}

.heartbeat-value {
  font-family: var(--font-header);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: 0 2px 10px rgba(255, 141, 161, 0.2);
  letter-spacing: 0.5px;
  margin: 10px 0;
}

.heart-rate-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  background: var(--accent-color);
  padding: 6px 18px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(255, 196, 214, 0.15);
  margin-top: 5px;
}

.heartbeat-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 10px;
}

/* Heartbeat thump visual scaling */
@keyframes thump {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  45% { transform: scale(1.1); }
  65% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.heartbeat-thump {
  animation: thump 0.38s ease-in-out;
}

/* SVG Hanging Rope Style */
.hanging-rope {
  width: 140px;
  height: 50px;
  margin-bottom: -12px;
  z-index: 2;
  display: none; /* hidden on mobile stacked layout */
  transform-origin: top center;
}

@media (min-width: 1200px) {
  .hanging-rope {
    display: block; /* only show when layout is split side-by-side */
  }
}

.baby-cover-banner {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 10px auto 28px auto;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(159, 134, 192, 0.15);
  border: 6px solid #ffffff;
  background: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: auto;
  transform-origin: top center;
  animation: swingCover 10s ease-in-out infinite alternate;
}

@keyframes swingCover {
  0% { transform: rotate(-1.5deg); }
  100% { transform: rotate(1.2deg); }
}

.cover-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.baby-cover-banner:hover {
  transform: rotate(0deg) scale(1.02) !important;
  animation-play-state: paused;
  box-shadow: 0 20px 48px rgba(159, 134, 192, 0.22);
}

.baby-cover-banner:hover .cover-image {
  transform: scale(1.04);
}

.cover-washi-tape {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  background: var(--washi-tape-color);
  backdrop-filter: blur(4px);
  padding: 8px 24px;
  border-radius: 4px;
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  border-left: 2px dashed rgba(255,255,255,0.5);
  border-right: 2px dashed rgba(255,255,255,0.5);
  white-space: nowrap;
  pointer-events: none;
  z-index: 5;
}

/* Heartbeat pulsation for kick counters and card scale */
@keyframes heartbeatPulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.18); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

.heartbeat-active {
  animation: heartbeatPulse 0.8s ease-in-out !important;
}

/* Split Layout for Desktop and Mobile Fallback */
.main-split-layout {
  display: block;
  width: 100%;
}

.left-hero-side {
  width: 100%;
  margin-bottom: 24px;
}

.right-content-side {
  width: 100%;
}

@media (min-width: 1200px) {
  .main-split-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .left-hero-side {
    flex: 0 0 35%; /* Left Hero Side is 35% */
    position: sticky;
    top: 24px;
    height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
  }
  
  .left-hero-side .baby-cover-banner {
    flex: 1;
    margin: 0;
    height: 100%;
    max-height: none;
    border: 8px solid #ffffff;
    border-radius: 40px;
  }

  .left-hero-side .cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover crop is perfect for vertical side-by-side space! */
  }
  
  .right-content-side {
    flex: 0 0 65%; /* Right Content Side is 65% */
    max-width: 65%;
  }

}


