/* ======================== MY JOURNEY POPUP ======================== */
/* Overlay (full screen background khi mở popup) */
#myjourney-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9998;
  display: none;
  justify-content: flex-start; /* Align popup to left on desktop */
  align-items: center;
  animation: fadeIn 0.4s ease;
  overflow: auto;
}

/* Show overlay when active */
#myjourney-overlay.active {
  display: flex;
}

/* Main popup container */
#myjourney-container {
  width: 50vw;
  max-width: 800px;
  height: 92vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.5s ease;
}

/* Header giống chatbot */
#myjourney-header {
  padding: 20px 30px;
  background: linear-gradient(135deg, #00c2cb, #009ba3);
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  position: relative;
  flex-shrink: 0;
}

#myjourney-close {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

#myjourney-close:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-50%) rotate(90deg) scale(1.1);
}

/* Body */
#myjourney-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Map */
#myjourney-map {
  flex: 1;
  min-height: 50%;
  background: #f0f0f0;
}

/* Sidebar (list + summary) */
#myjourney-sidebar {
  display: flex;
  flex-direction: column;
  height: 50%;
  background: #f8f9fa;
}

/* List container */
#journey-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

#journey-list-container h3 {
  margin: 0 0 16px 0;
  color: #2c3e50;
  font-size: 20px;
}

/* Journey item */
.journey-item {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  cursor: grab;
}

.journey-item:active {
  cursor: grabbing;
}

.journey-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.journey-order {
  font-weight: bold;
  font-size: 24px;
  min-width: 50px;
  color: #00c2cb;
  text-align: center;
}

.journey-name {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.nights-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px;
}

.nights-control button {
  width: 38px;
  height: 38px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nights-control button:hover {
  background: #00c2cb;
  color: white;
  border-color: #00c2cb;
  transform: scale(1.1);
}

.nights-count {
  font-weight: bold;
  font-size: 18px;
  min-width: 40px;
  text-align: center;
  color: #333;
}

.remove-destination {
  color: #e74c3c;
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
}

.remove-destination:hover {
  background: #fee;
  transform: scale(1.2);
}

/* Summary */
#journey-summary {
  padding: 20px;
  background: linear-gradient(135deg, #e0f7fa, #b2ebf2);
  text-align: center;
  font-size: 16px;
  color: #006064;
  border-top: 1px solid #ddd;
  flex-shrink: 0;
}

#journey-summary strong {
  font-size: 18px;
  color: #00c2cb;
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 1024px) {
  #myjourney-container {
    width: 70vw;
  }
}

@media (max-width: 768px) {
  #myjourney-overlay {
    justify-content: center;
    align-items: flex-end;
  }

  #myjourney-container {
    width: 96vw;
    max-width: none;
    height: 92vh;
    border-radius: 16px 16px 0 0;
  }

  #myjourney-header {
    font-size: 22px;
    padding: 16px 24px;
  }

  .journey-item {
    padding: 14px;
  }

  .nights-control {
    margin: 0 12px;
  }
}

@media (max-width: 480px) {
  #myjourney-container {
    height: 95vh;
  }

  #myjourney-header {
    font-size: 20px;
  }

  .journey-order {
    font-size: 20px;
    min-width: 40px;
  }

  .journey-name {
    font-size: 15px;
  }

  .nights-control button {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .nights-count {
    font-size: 16px;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}