: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%, #f0ddd5 100%);
  color: var(--dark);
  overflow-x: hidden;
}

/* ===== NAV ===== */
nav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(253, 246, 238, 0.95);
  border-bottom: 1px solid rgba(232, 180, 160, 0.3);
  transition: background 0.4s ease;
}

.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;
  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;
}

.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;
  animation: pulse-btn 2s ease-in-out infinite;
}

.nav-btn:hover {
  background: var(--brown);
}

@keyframes pulse-btn {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--brown);
}

/* ===== MATCHES PAGE ===== */
#matches-page {
  display: flex;
  height: 100vh;
  padding-top: 4.5rem;
}

/* ===== MATCHES LIST ===== */
.matches-list {
  width: 320px;
  min-width: 320px;
  background: white;
  border-left: 1px solid rgba(232, 180, 160, 0.3);
  overflow-y: auto;
  padding: 1.5rem 1rem;
}

.matches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding: 0 0.5rem;
}

.matches-title {
  font-family: "Secular One", sans-serif;
  font-size: 1.3rem;
  color: var(--dark);
}

.clear-all-btn {
  background: none;
  border: 1px solid var(--blush);
  color: var(--brown);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-family: "Heebo", sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
}

.clear-all-btn:hover {
  background: #fde8e8;
  border-color: #e05a5a;
  color: #e05a5a;
}

.match-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border-radius: 16px;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.match-item:hover {
  background: var(--warm);
}

.match-item.active {
  background: var(--warm);
  border: 1px solid var(--blush);
}

.match-item img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.match-item-info h4 {
  font-family: "Secular One", sans-serif;
  font-size: 1rem;
  color: var(--dark);
}

.match-item-info span {
  font-size: 0.8rem;
  color: var(--rose);
}

.meeting-tag {
  display: block;
  font-size: 0.75rem;
  color: var(--rose);
  font-weight: 700;
  margin-top: 0.2rem;
}

.delete-btn {
  margin-right: auto;
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 50%;
}

.delete-btn:hover {
  background: #fde8e8;
  color: #e05a5a;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--brown);
}

.empty-state span {
  font-size: 3rem;
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 300;
}

.empty-state a {
  color: var(--rose);
  font-weight: 700;
  text-decoration: none;
}

/* ===== CHAT ===== */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  overflow: hidden;
}

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--brown);
}

.chat-empty span {
  font-size: 4rem;
}

.chat-empty p {
  font-size: 1rem;
  font-weight: 300;
}

.chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.5rem;
  background: white;
  border-bottom: 1px solid rgba(232, 180, 160, 0.3);
  flex-shrink: 0;
}

.chat-header img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-header h3 {
  font-family: "Secular One", sans-serif;
  font-size: 1.1rem;
  color: var(--dark);
}

.chat-header span {
  font-size: 0.85rem;
  color: var(--rose);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.message {
  max-width: 65%;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.message.sent {
  background: var(--rose);
  color: white;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}

.message.received {
  background: white;
  color: var(--dark);
  align-self: flex-start;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(122, 74, 58, 0.08);
}

.message img {
  width: 180px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.message.voice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.voice-wave span {
  display: block;
  width: 3px;
  background: white;
  border-radius: 3px;
  animation: wave 0.8s ease-in-out infinite;
}

.voice-wave span:nth-child(1) {
  height: 6px;
  animation-delay: 0s;
}

.voice-wave span:nth-child(2) {
  height: 14px;
  animation-delay: 0.1s;
}

.voice-wave span:nth-child(3) {
  height: 10px;
  animation-delay: 0.2s;
}

.voice-wave span:nth-child(4) {
  height: 18px;
  animation-delay: 0.3s;
}

.voice-wave span:nth-child(5) {
  height: 8px;
  animation-delay: 0.4s;
}

@keyframes wave {

  0%,
  100% {
    transform: scaleY(1);
  }

  50% {
    transform: scaleY(0.4);
  }
}

.typing-indicator {
  padding: 0.4rem 1.5rem;
  font-size: 0.85rem;
  color: var(--brown);
  font-weight: 300;
  flex-shrink: 0;
}

.typing-dots span {
  animation: blink 1.2s infinite;
  font-size: 1.2rem;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {

  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

/* ===== CHAT INPUT ===== */
.chat-input {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: white;
  border-top: 1px solid rgba(232, 180, 160, 0.3);
  flex-shrink: 0;
}

.chat-input input {
  flex: 1;
  min-width: 80px;
  padding: 0.7rem 1.2rem;
  border-radius: 50px;
  border: 1px solid var(--blush);
  background: var(--cream);
  font-family: "Heebo", sans-serif;
  font-size: 0.95rem;
  color: var(--dark);
  outline: none;
}

.chat-input input:focus {
  border-color: var(--rose);
}

.chat-input button {
  background: var(--rose);
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 50px;
  font-family: "Heebo", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-input button:hover {
  background: var(--brown);
}

.btn-photo,
.btn-voice,
.btn-cat,
.btn-reaction {
  background: var(--warm);
  border: 1px solid var(--blush);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.btn-photo:hover,
.btn-voice:hover {
  background: var(--blush);
}

.btn-cat:hover {
  background: #fde8e8;
  border-color: #e05a5a;
}

.btn-reaction:hover {
  background: var(--blush);
  transform: scale(1.1);
}

.btn-voice.barking {
  background: var(--rose);
  animation: pulse-voice 0.3s ease infinite;
}

@keyframes pulse-voice {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }
}

/* ===== אנימציית הקלדה ===== */
.chat-header img.typing {
  animation: wiggle 0.3s ease infinite;
}

@keyframes wiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-8deg);
  }

  75% {
    transform: rotate(8deg);
  }
}

/* ===== 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;
  }

  #matches-page {
    flex-direction: column;
    height: calc(100vh - 4.5rem);
    overflow: hidden;
  }

  .matches-list {
    width: 100%;
    min-width: unset;
    height: 180px;
    min-height: 180px;
    border-left: none;
    border-bottom: 1px solid rgba(232, 180, 160, 0.3);
    overflow-y: auto;
    flex-shrink: 0;
  }

  .chat-section {
    flex: 1;
    overflow: hidden;
  }

  .chat-header {
    display: none;
  }

  .chat-input {
    gap: 0.4rem;
    padding: 0.6rem 0.8rem;
  }

  .btn-photo,
  .btn-voice,
  .btn-cat,
  .btn-reaction {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }
}

/* ===== כפתורי פעולה ===== */
.mobile-actions {
  display: none;
  position: relative;
}

.btn-plus {
  background: var(--warm);
  border: 1px solid var(--blush);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-plus:hover {
  background: var(--blush);
}

.actions-popup {
  display: none;
  position: absolute;
  bottom: 55px;
  right: 0;
  background: white;
  border-radius: 16px;
  padding: 0.8rem;
  box-shadow: 0 8px 30px rgba(122, 74, 58, 0.2);
  border: 1px solid var(--blush);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 200px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  transform: translateY(10px);
}

.actions-popup.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.actions-popup button {
  background: var(--warm);
  border: 1px solid var(--blush);
  border-radius: 10px;
  padding: 0.5rem 0.3rem;
  font-family: "Heebo", sans-serif;
  font-size: 0.75rem;
  cursor: pointer;
  text-align: center;
  color: var(--dark);
}

.actions-popup button:hover {
  background: var(--blush);
}

@media (max-width: 600px) {
  .desktop-only {
    display: none;
  }

  .mobile-actions {
    display: block;
  }
}

/* ===== מצב לילה ===== */
.dark-mode-btn {
  position: fixed;
  left: 1rem;
  bottom: 4rem;
  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);
}

/* ===== תגובות מהירות ===== */
.quick-replies-wrapper {
  position: relative;
}

.btn-quick-toggle {
  background: var(--warm);
  border: 1px solid var(--blush);
  color: var(--brown);
  padding: 0.5rem 0.8rem;
  border-radius: 50px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-quick-toggle:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.quick-replies-menu {
  position: absolute;
  bottom: 55px;
  left: 0;
  background: white;
  border-radius: 16px;
  padding: 0.8rem;
  box-shadow: 0 8px 30px rgba(122, 74, 58, 0.2);
  border: 1px solid var(--blush);
  gap: 0.5rem;
  width: 180px;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: none;
}

.quick-replies-menu.open {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.quick-replies-menu button {
  background: var(--warm);
  border: 1px solid var(--blush);
  border-radius: 10px;
  padding: 0.5rem;
  font-family: 'Heebo', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--dark);
  text-align: center;
  transition: background 0.2s;
}

.quick-replies-menu button:hover {
  background: var(--blush);
}