:root {
  --cream: #fdf6ee;
  --warm: #f5e6d3;
  --blush: #e8b4a0;
  --rose: #c97b63;
  --brown: #7a4a3a;
  --dark: #2d1a14;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Heebo", sans-serif;
  background: linear-gradient(180deg, #fdf6ee 0%, #e8e8d8 100%);
  color: var(--dark);
  overflow-x: hidden;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  transition:
    background 0.4s ease,
    box-shadow 0.4s ease;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(253, 246, 238, 0.95);
}

.nav-logo {
  font-family: "Secular One", sans-serif;
  font-size: 1.5rem;
  color: var(--rose);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--brown);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--rose);
}

.nav-links a.active {
  color: var(--rose);
  font-weight: 700;
  pointer-events: none;
}

.nav-btn {
  background: var(--rose);
  color: white;
  border: none;
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  font-family: "Heebo", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--brown);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--brown);
}

/* ===== MAP PAGE ===== */
#map-page {
  padding-top: 4.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== MAP HEADER ===== */
.map-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}

.map-title {
  font-family: "Secular One", sans-serif;
  font-size: 2rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
}

.map-subtitle {
  color: var(--brown);
  font-size: 0.95rem;
  font-weight: 300;
  margin-bottom: 0.8rem;
}

.map-count {
  display: inline-block;
  background: var(--warm);
  border: 1px solid var(--blush);
  color: var(--rose);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.3rem 1rem;
  border-radius: 50px;
}

/* ===== MAP ===== */
#map {
  flex: 1;
  height: calc(100vh - 220px);
  margin: 0 1.5rem 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(122, 74, 58, 0.15);
  z-index: 1;
  position: relative;
}

/* ===== POPUP ===== */
.leaflet-popup-content-wrapper {
  border-radius: 16px !important;
  font-family: "Heebo", sans-serif !important;
  box-shadow: 0 4px 20px rgba(122, 74, 58, 0.2) !important;
  direction: rtl;
}

.dog-popup {
  text-align: right;
  min-width: 180px;
}

.dog-popup img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}

.dog-popup h3 {
  font-family: "Secular One", sans-serif;
  font-size: 1.1rem;
  color: #2d1a14;
  margin-bottom: 0.2rem;
}

.dog-popup .breed {
  font-size: 0.85rem;
  color: #c97b63;
  margin-bottom: 0.2rem;
}
.dog-popup .location {
  font-size: 0.8rem;
  color: #7a4a3a;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--brown);
}

.empty-state span {
  font-size: 3rem;
}
.empty-state p {
  font-size: 1rem;
  font-weight: 300;
}
.empty-state a {
  background: var(--rose);
  color: white;
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  nav {
    padding: 1rem 1.2rem;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 9998;
    background: rgba(253, 246, 238, 0.85);
    padding: 1rem 1.5rem;
    gap: 1rem;
    border-bottom: 1px solid rgba(232, 180, 160, 0.3);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-12px);
    pointer-events: none;
    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .nav-links.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }

  .nav-btn {
    display: none;
  }
  .hamburger {
    display: block;
  }

  #map {
    margin: 0 0.8rem 0.8rem;
    height: calc(100vh - 240px);
  }
}

/* ===== אנימציית פופאפ ===== */
.leaflet-popup-content-wrapper {
  animation: popupIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popupIn {
  from {
    transform: scale(0.3);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== כפתור חזרה ===== */
.reset-map-btn {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: white;
  border: 1px solid var(--blush);
  color: var(--brown);
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-family: "Heebo", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(122, 74, 58, 0.15);
}

.reset-map-btn:hover {
  border-color: var(--rose);
  color: var(--rose);
}

/* ===== קו תחתון נע בתפריט ===== */
.nav-links a {
  position: relative;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--rose);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
  left: 0;
  right: auto;
}

/* ===== כפתור פועם ===== */
@keyframes pulse-btn {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.nav-btn {
  animation: pulse-btn 2s ease-in-out infinite;
}

/* ===== מצב לילה ===== */
.dark-mode-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9999;
  background: white;
  border: 1px solid var(--blush);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(122, 74, 58, 0.2);
  transition: all 0.2s;
}

.dark-mode-btn:hover {
  background: var(--warm);
}

body.dark {
  --cream: #2d1f18;
  --warm: #3a2820;
  --blush: #7a4a3a;
  --rose: #c97b63;
  --brown: #e8b4a0;
  --dark: #fdf6ee;
  background: linear-gradient(180deg, #2d1f18 0%, #3a2820 100%);
}

body.dark nav {
  background: rgba(45, 31, 24, 0.95);
  border-bottom-color: rgba(122, 74, 58, 0.4);
}

body.dark .step,
body.dark .review-card,
body.dark .why-card,
body.dark .why-card,
body.dark .dog-card,
body.dark .question-card,
body.dark .result-card,
body.dark .matches-list,
body.dark .match-item,
body.dark .chat-header,
body.dark .chat-input,
body.dark .profile-card {
  background: #3a2820;
  color: var(--dark);
}

body.dark .message.received {
  background: #4a3028;
  color: var(--dark);
}

body.dark .option-btn {
  background: #4a3028;
  color: var(--dark);
  border-color: var(--blush);
}
