/* === GLOBAL LOVE MODE === */
.love-mode {
  --c-heart: #e91e63;
  --c-soft: #ffc1e3;
  --c-bg: #fff8f9;
  --c-dark: #0f0f23;
  --c-light-text: #5d4c57;
  --c-border: #ff69b4;
  background: var(--c-bg);
  font-family: "Poppins", sans-serif;
  color: var(--c-light-text);
  min-height: 100vh;
  transition: background 0.4s ease, color 0.4s ease;
}

/* === CONTAINER & HEADER === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.love-header h1 {
  font-family: "Dancing Script", cursive;
  font-size: 3.6rem;
  color: var(--c-heart);
  margin: 0 0 0.5rem;
  text-shadow: 0 0 25px rgba(233, 30, 99, 0.25);
  animation: titleGlow 4s ease-in-out infinite;
}

.love-header p {
  font-size: 1.25rem;
  color: #b45d7b;
  margin: 0;
  font-style: italic;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.15);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* === THEME TOGGLE === */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(45deg, #e91e63, #ff4081);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(233, 30, 99, 0.4);
  transition: all 0.4s ease;
}
.theme-toggle:hover {
  transform: rotate(20deg) scale(1.05);
  box-shadow: 0 12px 30px rgba(233, 30, 99, 0.6);
}

/* === MAP === */
#map {
  height: 70vh;
  margin: 2.5rem 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
  border: 3px solid var(--c-border);
  position: relative;
}

/* === LEGEND CARD === */
.legend {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--c-border);
  border-radius: 18px;
  padding: 1rem 1.3rem;
  text-align: left;
  font-style: italic;
  font-size: 0.95rem;
  box-shadow: 0 8px 22px rgba(255, 64, 129, 0.2);
  backdrop-filter: blur(8px);
  color: var(--c-light-text);
  max-width: 250px;
  z-index: 2;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.legend-header h3 { margin: 0; }

.legend-toggle-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--c-heart);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.legend.collapsed .legend-toggle-btn { transform: rotate(-90deg); }

.legend-body {
  max-height: 420px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease;
  margin-top: 0.6rem;
}

.legend.collapsed .legend-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

.legend h3 {
  font-family: "Dancing Script", cursive;
  color: var(--c-heart);
  margin: 0 0 0.6rem;
  text-shadow: 0 0 10px rgba(255, 105, 180, 0.2);
}

.legend .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.dot.past {
  background: #ff69b4;
}
.dot.future {
  background: #00c4ff;
}
.dot.current {
  background: #ffd166;
  box-shadow: 0 0 8px rgba(255, 209, 102, 0.8);
}

/* === FIND ARMAN — bottom-left floating pill, high-contrast === */
.find-arman-btn {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #0091ff 0%, #00c4ff 50%, #4fd8ff 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 8px 24px rgba(0, 145, 255, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.find-arman-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(0, 145, 255, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}
.find-arman-btn:active { transform: scale(0.95); }

.find-arman-icon { font-size: 1.05rem; line-height: 1; }
.find-arman-label { white-space: nowrap; }

/* soft pulsing halo so the button draws the eye without being loud */
.find-arman-ping {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 196, 255, 0.7);
  animation: find-arman-pulse 2.2s ease-out infinite;
  pointer-events: none;
}
@keyframes find-arman-pulse {
  0% { opacity: 0.75; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.14); }
}

@media (max-width: 480px) {
  .find-arman-btn {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}

/* === MUSIC TOGGLE === */
.music-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--c-border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--c-heart);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 64, 129, 0.25);
  transition: transform 0.25s ease, background 0.25s ease;
  z-index: 3;
}
.music-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 1);
}
.music-btn.playing {
  box-shadow: 0 0 22px #ff69b4, 0 0 45px #ff4081;
}

/* === LOVE NOTES (Toast) === */
.love-notes {
  position: fixed;
  bottom: 20px;
  font-family: "Dancing Script", cursive;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: linear-gradient(45deg, #ff4081, #e91e63);
  color: white;
  padding: 0.8rem 1.4rem;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(233, 30, 99, 0.4);
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 10000;
}
.love-notes.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === DARK MODE === */
body.dark {
  background: var(--c-dark);
  color: #fbeaff;
}

body.dark .love-header p {
  color: #ffb3d9;
}
body.dark #map {
  border-color: #ff80ab;
  box-shadow: 0 12px 35px rgba(255, 105, 180, 0.2);
}
body.dark .legend {
  background: rgba(25, 5, 35, 0.85);
  color: #ffd6f0;
  border-color: #ff80ab;
  box-shadow: 0 8px 22px rgba(255, 105, 180, 0.3);
}
body.dark .legend-toggle-btn {
  color: #ffb3d9;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container {
    padding: 1.2rem 1rem;
  }
  .love-header h1 {
    font-size: 2.4rem;
  }
  .love-header p {
    font-size: 1.05rem;
  }
  .header-row {
    justify-content: center;
    text-align: center;
    gap: 0.8rem;
  }
  #map {
    height: 62vh;
    height: 62svh; /* stable viewport unit: avoids jumpiness as mobile browser chrome shows/hides */
    margin: 1.5rem 0;
    border-radius: 20px;
  }
  .legend {
    font-size: 0.9rem;
    max-width: min(78vw, 260px);
    padding: 0.8rem 1rem;
  }
  .legend-toggle-btn {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
  }
  .music-btn {
    width: 48px;
    height: 48px;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 480px) {
  .love-header h1 {
    font-size: 2rem;
  }
  .love-header p {
    font-size: 0.95rem;
  }
  .legend {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    right: 0.6rem;
    max-width: none;
    width: auto;
  }
  .legend.collapsed {
    padding-bottom: 0.6rem;
  }
  #map {
    height: 68vh;
    height: 68svh;
    border-radius: 16px;
  }
}

/* === ANIMATIONS === */
@keyframes titleGlow {
  0%,
  100% {
    text-shadow: 0 0 25px rgba(255, 105, 180, 0.25);
  }
  50% {
    text-shadow: 0 0 45px rgba(255, 64, 129, 0.6);
  }
}
/* Visible, pulsing map pin (existing saved memories) */
.memory-heart {
  width: 42px;
  height: 42px;
  background: radial-gradient(circle at 30% 30%, #ff69b4, #e91e63);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 0 22px rgba(255, 64, 129, 0.6), 0 8px 22px rgba(0, 0, 0, 0.25);
  animation: heartPulse 1.6s ease-in-out infinite;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

@keyframes heartPulse {
  0%,
  100% {
    transform: rotate(-45deg) scale(1);
  }
  50% {
    transform: rotate(-45deg) scale(1.18);
  }
}

/* === CURRENT LOCATION MARKER — bigger, clearer, unmistakably "live" === */
.arman-location-marker {
  width: 34px;
  height: 34px;
  position: relative;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.arman-location-marker .ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(79, 216, 255, 0.45);
  animation: locationPing 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
.arman-location-marker .pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #8ff0ff, #007bff);
  border: 3px solid #fff;
  box-shadow: 0 0 16px rgba(0, 123, 255, 0.75), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.arman-location-marker .pin svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}
.arman-location-marker .live-dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
}
@keyframes locationPing {
  0% {
    transform: scale(0.6);
    opacity: 0.8;
  }
  70% {
    transform: scale(2.6);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.love-btn {
  font-family: "Dancing Script", cursive;
  background: linear-gradient(45deg, #ff4081, #e91e63);
  border: none;
}

/* === GET DIRECTIONS — companion pill to Find Arman === */
.directions-btn {
  position: absolute;
  left: 14px;
  bottom: 70px; /* stacks above Find Arman instead of overlapping it */
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-family: "Dancing Script", cursive;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  color: #ffffff;
  background: linear-gradient(135deg, #ff4081 0%, #e91e63 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  box-shadow:
    0 8px 24px rgba(233, 30, 99, 0.45),
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.directions-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 30px rgba(233, 30, 99, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    inset 0 -1px 1px rgba(0, 0, 0, 0.12);
}
.directions-btn:active { transform: scale(0.95); }

.directions-icon { font-size: 1.05rem; line-height: 1; }
.directions-label { white-space: nowrap; }

@media (max-width: 480px) {
  .directions-btn {
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(62px + env(safe-area-inset-bottom));
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
}