/* ═══════════════════════════════════════════════════════
   HOME PAGE STYLES
   File: static/css/home.css
   Load order in base.html: AFTER style.css, BEFORE responsive.css
═══════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════
   1. CHOICES.JS — SEARCHABLE DROPDOWN
═══════════════════════════════════════════════════════ */

.search-field { overflow: visible !important; position: relative; }
.search-field-full { overflow: visible !important; }
.hero-search-card { overflow: visible !important; }
.search-grid { overflow: visible !important; }

.choices {
  margin: 0 !important;
  position: relative !important;
  z-index: 100 !important;
  width: 100% !important;
}

.choices__inner {
  background: #ffffff !important;
  border: 1.5px solid #e0e0e0 !important;
  border-radius: 10px !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.choices.is-open .choices__inner,
.choices__inner:focus-within {
  border-color: #DD0854 !important;
  box-shadow: 0 0 0 3px rgba(221, 8, 84, 0.12) !important;
}

.choices__input {
  background-color: #ffffff !important;
  border: none !important;
  border-radius: 0 !important;
  color: #333333 !important;
  font-size: 14px !important;
  font-family: 'DM Sans', sans-serif !important;
  padding: 6px 8px 6px 8px !important;
  margin: 0 !important;
  width: 100% !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
}

.choices__input:focus {
  outline: none !important;
  box-shadow: none !important;
}

.choices__input::placeholder {
  color: #999999 !important;
}

.choices__list--dropdown {
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 99999 !important;
  background: #ffffff !important;
  border: 1.5px solid #e0e0e0 !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15) !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin: 0 !important;
  padding: 4px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.choices__list {
  background-color: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

.choices__option {
  padding: 8px 16px !important;
  color: #333333 !important;
  font-size: 13px !important;
  font-family: 'DM Sans', sans-serif !important;
  background-color: transparent !important;
  border: none !important;
  cursor: pointer !important;
  transition: background-color 0.1s ease !important;
  line-height: 1.3 !important;
}

.choices__option:hover,
.choices__option.is-highlighted {
  background-color: #DD0854 !important;
  color: #ffffff !important;
}

.choices__option.is-selected {
  background-color: #DD0854 !important;
  color: #ffffff !important;
}

.choices__item {
  background-color: transparent !important;
  border: none !important;
  color: #333333 !important;
  padding: 4px 16px !important;
  font-size: 14px !important;
  font-family: 'DM Sans', sans-serif !important;
  line-height: 1.4 !important;
}

.choices__list--dropdown .choices__item {
  background: #ffffff !important;
  color: #333333 !important;
  padding: 10px 16px !important;
  font-size: 14px !important;
}

.choices__list--dropdown .choices__item.is-highlighted {
  background: #DD0854 !important;
  color: #ffffff !important;
}

.choices__button {
  display: inline-block !important;
  background-color: transparent !important;
  border: none !important;
  border-left: 1px solid rgba(0,0,0,.1) !important;
  color: #333333 !important;
  font-size: 14px !important;
  cursor: pointer !important;
  padding: 0 8px !important;
  opacity: 0.5 !important;
}

.choices__button:hover {
  opacity: 1 !important;
  color: #DD0854 !important;
}

.choices__list--dropdown::-webkit-scrollbar { width: 6px !important; }
.choices__list--dropdown::-webkit-scrollbar-track { background: #f5f5f5 !important; }
.choices__list--dropdown::-webkit-scrollbar-thumb { background: #cccccc !important; border-radius: 3px !important; }
.choices__list--dropdown::-webkit-scrollbar-thumb:hover { background: #999999 !important; }

/* Force hide native select — Choices.js renders its own UI */
.choices-country,
.choices .choices__input[hidden],
select.choices-country {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Ensure Choices widget sits on top and is clickable */
.choices {
  position: relative !important;
  z-index: 50 !important;
  pointer-events: all !important;
}

.choices__inner {
  cursor: pointer !important;
  pointer-events: all !important;
}


/* ═══════════════════════════════════════════════════════
   2. REVIEW CARDS
═══════════════════════════════════════════════════════ */

.review-card-modern {
  background: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.review-card-modern:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.review-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.review-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #DD0854 0%, #7B3FF2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(221, 8, 84, 0.2);
}

.review-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.review-name {
  font-size: 16px;
  font-weight: 700;
  color: #303030;
  margin: 0;
  line-height: 1.3;
}

.review-date {
  font-size: 13px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-date::before {
  content: "📅";
  font-size: 12px;
}

.review-stars {
  display: flex;
  gap: 4px;
  font-size: 16px;
  color: #DD0854;
  margin: 6px 0 0 0;
}

.review-stars i { display: inline-block; }

.review-location {
  font-size: 13px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.review-location::before {
  content: "🌍";
  font-size: 14px;
}

.review-text {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin: 8px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.review-images img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.review-images img:hover { transform: scale(1.05); }

.review-images-carousel {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
  position: relative;
}

.review-images-carousel img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  border-radius: 12px;
}

.review-images-carousel img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.review-images-carousel img:nth-child(n+3) { display: none; }

.image-count-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 14px;
  border-radius: 0 12px 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.image-count-badge:hover { background: rgba(0, 0, 0, 0.9); }


/* ═══════════════════════════════════════════════════════
   3. REVIEW CAROUSEL
═══════════════════════════════════════════════════════ */

.reviews-carousel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.reviews-carousel-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.reviews-carousel {
  display: flex;
  gap: 24px;
  scroll-behavior: smooth;
  overflow-x: auto;
  padding: 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  overflow-y: hidden;
}

.reviews-carousel::-webkit-scrollbar { display: none; }

.carousel-btn-prev,
.carousel-btn-next { flex-shrink: 0; }

.review-card-carousel {
  flex: 0 0 calc(28.57% - 17px);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.review-card-carousel:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

.carousel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #f0f0f0;
  color: #303030;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.carousel-btn:hover {
  background: #DD0854;
  border-color: #DD0854;
  color: #ffffff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(221, 8, 84, 0.3);
}

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

.carousel-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e0e0e0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #DD0854;
  width: 28px;
  border-radius: 5px;
}


/* ═══════════════════════════════════════════════════════
   4. HERO — MOBILE FIX
   Fixes: background image elongation, layout, text colors
═══════════════════════════════════════════════════════ */

/* Desktop: show form inside hero, hide mobile float */
.hero-form-float { display: none; }
.hero-form-desktop { display: block; margin-left: 40px; }

@media (max-width: 768px) {

  /* Hide desktop form inside hero, show float form below */
  .hero-form-desktop { display: none !important; }
  .hero-form-float {
    display: block !important;
    margin-top: 24px;
    position: relative;
    z-index: 10;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    padding: 0 16px 32px !important;
    box-sizing: border-box !important;
  }

  .hero-form-float .container {
    all: unset !important;
    display: block !important;
    width: 100% !important;
  }

  .hero-form-float .hero-search-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 24px rgba(0,0,0,.12) !important;
    display: block !important;
  }

  /* Remove forced full-screen height that causes elongation */
  .hero {
    min-height: auto;
    padding: 40px 0 32px !important;
  }

  /* Fix background image — cover both layers properly */
  .hero-bg {
    background-size: cover, cover !important;
    background-position: center top, center top !important;
    background-attachment: scroll, scroll !important;
    background-image:
      linear-gradient(
        135deg,
        rgba(0, 0, 0, .55) 0%,
        rgba(0, 0, 0, .45) 60%,
        rgba(0, 0, 0, .35) 100%
      ),
      url('/static/images/visa.jpeg') !important;
  }

  /* Single column, no gap */
  .hero-content {
    grid-template-columns: 1fr;
    gap: 0 !important;
    align-items: start;
  }

  /* Hero text */
  .hero-text {
    padding: 24px 0 20px;
  }

  .hero-title {
    color: #ffffff !important;
    font-size: clamp(28px, 8vw, 38px);
    letter-spacing: -0.5px;
    margin-bottom: 14px;
  }

  .hero-desc {
    font-size: 15px !important;
    color: rgba(255, 255, 255, 0.85) !important;
    margin-bottom: 24px;
    font-weight: 400 !important;
  }

  .hero-badge {
    font-size: 13px !important;
    margin-bottom: 16px;
    padding: 5px 14px;
  }

  /* Buttons — full width stacked */
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 28px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
  }

  /* "How It Works" outline button — visible on dark background */
  .hero-actions .btn-outline {
    border-color: rgba(255, 255, 255, 0.5) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .hero-actions .btn-outline i {
    color: #DD0854 !important;
  }

  /* Stats — 2x2 compact grid */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    margin-bottom: 0 !important;
  }

  .hero-stats > div {
    padding: 10px 8px !important;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, .1);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }

  .hero-stats > div:nth-child(2),
  .hero-stats > div:nth-child(4) {
    border-right: none;
  }

  .hero-stats > div:nth-child(3),
  .hero-stats > div:nth-child(4) {
    border-bottom: none;
  }

  .hero-stat-num {
    font-size: 20px !important;
    color: #ffffff;
  }

  .hero-stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, .5);
  }

  .hero-content > form {
    margin: 0;
    width: 100%;
  }

  .hero-search-card {
    border-radius: 16px !important;
    padding: 20px 16px !important;
    border: none !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .15) !important;
    background: #ffffff !important;
    margin-top: 16px !important;
  }

  .hero-search-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .hero-search-card p {
    font-size: 13px;
    margin-bottom: 22px;
  }

  /* All form fields full width */
  .search-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 16px !important;
  }

  .search-field-full {
    margin-bottom: 16px !important;
  }

  .search-field input,
  .search-field select {
    height: 48px !important;
    font-size: 14px !important;
  }

  .search-submit {
    margin-top: 22px !important;
    padding: 14px !important;
    font-size: 15px !important;
  }

  .trust-row {
    font-size: 11px;
    margin-top: 14px;
  }

  .choices__input {
    height: 48px !important;
  }

  /* Choices dropdown — mobile viewport safe */
  .search-field-full { max-height: calc(100vh - 100px) !important; }

  .choices__list--dropdown {
    max-height: 40vh !important;
    overflow-y: scroll !important;
  }

  /* Destination cards — less tall on mobile */
  .dest-card {
    aspect-ratio: 4 / 3 !important;
  }

  /* Reviews */
  .review-card-carousel {
    flex: 0 0 calc(85% - 4px);
    padding: 18px;
  }

  .reviews-carousel-wrapper { gap: 20px; }
  .reviews-carousel-container { gap: 10px; }

  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }

  .carousel-dot { width: 8px; height: 8px; }
  .carousel-dot.active { width: 24px; }

  /* ── Mobile review card fixes ── */
  .review-card-carousel {
    flex: 0 0 calc(85% - 4px) !important;
    padding: 16px !important;
    gap: 12px !important;
  }

  .review-header {
    gap: 12px;
    align-items: flex-start;
  }

  .review-avatar {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
    flex-shrink: 0;
  }

  .review-info {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
  }

  .review-name {
    font-size: 14px !important;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .review-date {
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Remove emoji pseudo-elements on mobile — they render as OS emoji icons */
  .review-date::before { content: none !important; }
  .review-location::before { content: none !important; }

  .review-location {
    font-size: 11px !important;
  }

  .review-stars {
    font-size: 13px !important;
    gap: 2px !important;
    margin: 3px 0 0 !important;
  }

  .review-text {
    font-size: 12px !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    margin-top: 4px !important;
  }

  .review-images-carousel {
    gap: 6px !important;
    margin-top: 10px !important;
  }

  .review-images-carousel img { height: 100px !important; }
  .review-images { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════
   5. SMALL PHONES (≤ 480px)
═══════════════════════════════════════════════════════ */

@media (max-width: 480px) {

  .hero {
    padding: 32px 0 40px !important;
  }

  .hero-bg {
    background-image:
      linear-gradient(
        135deg,
        rgba(0, 0, 0, .60) 0%,
        rgba(0, 0, 0, .50) 100%
      ),
      url('/static/images/visa.jpeg') !important;
  }

  .hero-title {
    font-size: clamp(26px, 7vw, 34px);
  }

  .hero-search-card {
    padding: 18px 14px !important;
    border-radius: 14px !important;
  }

  .hero-search-card h3 { font-size: 17px; }

  /* Choices dropdown */
  .search-field-full { max-height: calc(100vh - 80px) !important; }
  .choices__list--dropdown { max-height: 35vh !important; }

  /* Reviews */
  .review-card-carousel {
    flex: 0 0 calc(88% - 3px);
    padding: 16px;
    gap: 12px;
  }

  .reviews-carousel-container { gap: 8px; }

  .review-avatar { width: 52px; height: 52px; font-size: 18px; }
  .review-name { font-size: 14px; font-weight: 700; }
  .review-date { font-size: 12px; }
  .review-text { font-size: 12px; -webkit-line-clamp: 3; }

  .carousel-btn { width: 36px; height: 36px; font-size: 12px; }
  .carousel-dot { width: 6px; height: 6px; }
  .carousel-dot.active { width: 20px; }

  .review-images-carousel { gap: 6px; }
  .review-images-carousel img { height: 100px; }
  .image-count-badge { padding: 6px 10px; font-size: 11px; }
}


/* ═══════════════════════════════════════════════════════
   6. TABLET (769px – 1024px)
═══════════════════════════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1024px) {

  .hero {
    min-height: auto;
    padding: 56px 0;
  }

  .hero-bg {
    background-size: cover, cover !important;
    background-position: center center, center center !important;
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
  }

  .hero-title {
    color: #ffffff !important;
    font-size: clamp(28px, 4vw, 44px);
  }

  .hero-desc {
    color: rgba(255, 255, 255, .85) !important;
    font-size: 16px !important;
  }

  .hero-search-card {
    padding: 32px 28px !important;
  }

  /* Carousel */
  .review-card-carousel {
    flex: 0 0 calc(40% - 14.4px);
    padding: 20px;
  }

  .reviews-carousel-container { gap: 12px; }
  .carousel-btn { width: 44px; height: 44px; font-size: 16px; }
}


/* ═══════════════════════════════════════════════════════
   7. LARGE TABLET (≤ 1200px)
═══════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .review-card-carousel {
    flex: 0 0 calc(40% - 14.4px);
  }

  .reviews-carousel-container { gap: 12px; }
}

/* ════════════════════════════════════════
   MOBILE: COMPACT HERO HEIGHT FIX
════════════════════════════════════════ */
@media (max-width: 768px) {

  .hero {
    min-height: auto !important;
    height: auto !important;
    padding: 32px 0 40px !important;
    display: block !important;
  }

  .hero-content {
    padding: 0 !important;
    gap: 24px !important;
  }

  .hero-text {
    padding: 0 !important;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 38px) !important;
    margin-bottom: 12px !important;
  }

  .hero-desc {
    margin-bottom: 20px !important;
    font-size: 15px !important;
  }

  .hero-actions {
    margin-bottom: 20px !important;
    gap: 10px !important;
  }

  .hero-stats {
    padding-top: 16px !important;
    gap: 0 !important;
  }
}

@media (min-width: 769px) {
  .hero-content {
    grid-template-columns: 1fr 1.3fr;
    padding-right: 48px !important;
  }
}

@media (min-width: 1200px) {
  .hero-content {
    padding-right: 80px !important;
  }
}

/* ── Choices.js country dropdown — capped height, scrollable ── */
.country-choices .choices__list--dropdown {
  max-height: 220px !important;
  overflow-y: auto !important;
  z-index: 99999 !important;
}
.country-choices .choices__input {
  font-size: 13px;
}
.country-choices .choices__list--dropdown .choices__item {
  font-size: 13.5px;
  padding: 8px 14px;
}
.country-choices.choices .choices__inner {
  border-radius: 10px;
  border: 1.5px solid #e0e0e0;
  background: #fafafa;
  padding: 4px 8px;
  min-height: 42px;
  font-size: 13.5px;
}
.country-choices.is-focused .choices__inner,
.country-choices.is-open .choices__inner {
  border-color: #DD0854;
  box-shadow: 0 0 0 3px rgba(221,8,84,.07);
  background: #fff;
}