/* ==============================
   DESTINATIONS SECTION - FLIP CARDS WITH PAGINATION
   ============================== */

.destinations-section {
  background: white;
  padding: 40px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 40px;
  container-type: inline-size;
}

.destinations-wrapper {
  position: relative;
  width: 100%;
}

.destinations-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 10px 0;
}

.destinations-container::-webkit-scrollbar {
  display: none;
}

/* DESTINATION CARD - REDUCED HEIGHT (from 340px to 320px) */
.destination-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 320px; /* Reduced from 340px */
  perspective: 1000px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
  cursor: pointer;
  min-width: 280px;
}

.destination-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.destination-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.destination-card.flipped .destination-card-inner {
  transform: rotateY(180deg);
}

.destination-card-front, .destination-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
}

.destination-card-front {
  background-color: white;
  color: var(--text);
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--gold);
}

.destination-card-back {
  background-color: white;
  color: var(--text);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-top: 4px solid var(--gold);
}

/* Front side - SLIGHTLY REDUCED IMAGE HEIGHT */
.destination-image {
  width: 100%;
  height: 170px; /* Reduced from 180px */
  object-fit: cover;
}

.destination-front-content {
  padding: 16px 15px 10px 15px; /* INCREASED top padding from 12px to 16px */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.destination-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px; /* Increased from 8px for more space below title */
  color: var(--text);
  line-height: 1.3;
  text-align: center;
  margin-top: 0; /* Ensure no top margin */
}

/* VOYAGE DETAILS - ONLY DEPARTURE DATE */
.voyage-details {
  text-align: center;
  margin-bottom: 6px; /* Reduced from 8px */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.voyage-detail {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 4px; /* Reduced from 6px */
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

/* FLIP HINT - LESS SPACE */
.flip-hint {
  font-size: 0.85rem;
  color: var(--gold);
  margin-top: auto;
  padding-top: 6px; /* Reduced from 8px */
  border-top: 1px solid #f0f0f0;
  line-height: 1.2;
  display: block;
}

.return-hint {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
}

/* Back side - DATE - PORT FORMAT */
.destination-back-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.itinerary-pages {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}

.itinerary-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  overflow-y: auto;
}

.itinerary-page.active {
  opacity: 1;
  pointer-events: all;
}

.itinerary-item {
  padding: 7px 0; /* Reduced from 8px */
  border-bottom: 1px solid #f0f0f0;
}

.itinerary-item:last-child {
  border-bottom: none;
}

.itinerary-date-port {
  display: flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

/* CHANGED: Itinerary date color from gold to neutral dark gray */
.itinerary-date {
  font-weight: 600;
  color: #555; /* Changed from var(--gold) to neutral color */
  font-size: 0.8rem;
}

.itinerary-separator {
  color: #999;
  font-size: 0.8rem;
}

.itinerary-port {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text);
}

/* Page navigation */
.page-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 6px; /* Reduced from 8px */
  padding-top: 6px; /* Reduced from 8px */
  border-top: 1px solid #f0f0f0;
  gap: 8px;
}

.page-btn {
  background: none;
  color: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  font-size: 18px;
  font-weight: 300;
  width: 20px;
  height: 20px;
}

.page-btn:hover {
  color: #b08c4a;
  transform: scale(1.1);
}

.page-btn:disabled {
  color: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.page-indicator {
  font-size: 0.85rem;
  color: #666;
  margin: 0 5px;
}

/* Pagination dots - FIXED POSITIONING */
.destinations-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.destinations-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.destinations-dot.active {
  background: var(--gold);
  transform: scale(1.2);
}

.destinations-dot:hover {
  background: #ccc;
}

/* Scroll arrows - ADJUSTED FOR SHORTER CARDS */
.destinations-wrapper .scroll-arrow {
  position: absolute;
  top: 90px; /* Adjusted for shorter cards (was 100px) */
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.destinations-wrapper .scroll-arrow.visible {
  display: flex;
}

.destinations-wrapper .scroll-arrow:hover {
  background: rgba(0, 0, 0, 0.4);
  color: white;
}

.destinations-wrapper .scroll-arrow.left {
  left: 10px;
}

.destinations-wrapper .scroll-arrow.right {
  right: 10px;
}

.destinations-wrapper .scroll-arrow.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.destinations-wrapper .scroll-arrow.disabled:hover {
  background: rgba(0, 0, 0, 0.3);
  color: white;
}

/* TWO DESTINATIONS LAYOUT */
.destinations-container.two-destinations .destination-card {
  flex: 0 0 calc(50% - 10px);
}

/* Override container queries when there are exactly 2 destinations */
@container (min-width: 768px) {
  .destinations-container.two-destinations .destination-card {
    flex: 0 0 calc(50% - 10px) !important;
  }
}

/* Ensure arrows are hidden for 2 destinations on desktop */
.destinations-container.two-destinations ~ .scroll-arrow {
  display: none !important;
}

/* Responsive behavior */
.destination-card {
  flex: 0 0 calc(100% - 20px);
}

@container (min-width: 600px) {
  .destination-card {
    flex: 0 0 calc(50% - 10px);
  }
}

@container (min-width: 800px) {
  .destination-card {
    flex: 0 0 calc(33.333% - 14px);
  }
}

/* Show arrows for 2 destinations on mobile since they stack */
@media (max-width: 800px) {
  .destinations-container.two-destinations .destination-card {
    flex: 0 0 100%;
  }
  
  .destinations-container.two-destinations ~ .scroll-arrow {
    display: flex !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .destinations-section {
    padding: 20px;
  }
  
  .destinations-wrapper .scroll-arrow { 
    width: 30px; 
    height: 30px; 
    top: 80px; /* Adjusted for shorter cards (was 90px) */
  }
  
  .destinations-wrapper .scroll-arrow.left { 
    left: 5px;
  }
  
  .destinations-wrapper .scroll-arrow.right { 
    right: 5px;
  }
  
  .destination-card {
    height: 300px; /* Reduced from 320px for mobile */
  }
  
  .destination-image {
    height: 150px; /* Reduced from 160px */
  }
  
  .destination-front-content {
    padding: 14px 12px 8px 12px; /* INCREASED top padding from 10px to 14px for mobile */
  }
  
  .destination-card-back {
    padding: 10px;
  }
  
  .destination-title {
    font-size: 1rem;
    margin-bottom: 8px; /* Increased from 6px for mobile */
  }
  
  .voyage-detail {
    font-size: 0.82rem;
    margin-bottom: 3px; /* Reduced */
  }
  
  .flip-hint {
    padding-top: 5px; /* Reduced */
    font-size: 0.82rem;
  }
  
  .itinerary-item {
    padding: 5px 0; /* Reduced from 6px */
  }
  
  .itinerary-date-port {
    margin-bottom: 2px;
  }
  
  .itinerary-date {
    font-size: 0.76rem;
  }
  
  .itinerary-port {
    font-size: 0.78rem;
  }
  
  .page-nav {
    margin-top: 5px; /* Reduced from 6px */
    padding-top: 5px; /* Reduced from 6px */
  }
  
  .page-indicator {
    font-size: 0.8rem;
  }
  
  .return-hint {
    padding-top: 5px; /* Reduced from 6px */
  }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 1024px) {
  .destinations-section {
    padding: 30px;
  }
  
  .destination-card {
    height: 320px; /* Reduced from 340px for tablet */
  }
}

/* Variables */
:root {
  --gold: #b8860b;
  --gold-dark: #996515;
  --text: #333333;
}