/* ========== Trip Planner Styles ========== */

/* Trip Planner Container (right side, like filters) */
.trip-planner-container {
  position: fixed;
  right: 16px;
  top: 100px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

/* Trip Planner Panel - Modern glass morphism (matching filter panel) */
.trip-planner-panel {
  display: none;
  min-width: 300px;
  max-height: calc(100vh - 80px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(39, 30, 55, 0.1);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 
    0 10px 40px rgba(39, 30, 55, 0.1),
    0 2px 10px rgba(0, 0, 0, 0.05);
}

.trip-planner-panel.active,
.trip-planner-panel.show {
  display: block;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.trip-planner-panel h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  color: #271E37;
  font-weight: 700;
}

/* Trip planner panel header with close button */
.trip-planner-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.trip-planner-panel-header h3 {
  margin: 0;
}

.trip-planner-close-btn {
  background: transparent;
  border: 1px solid rgba(39, 30, 55, 0.3);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #271E37;
}

.trip-planner-close-btn:hover {
  background: rgba(39, 30, 55, 0.1);
  border-color: #271E37;
}

/* Trip planner content area */
.trip-planner-content {
  padding: 10px 0;
}

/* Trip planner card styling in nav - UPDATED */
.nav-card-trip-planner {
  cursor: pointer;
  /* Remove transition here - let GSAP handle all animation */
}

.nav-card-trip-planner:hover {
  /* Only apply hover when pointer-events are enabled */
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(39, 30, 55, 0.3);
}

.nav-card-trip-planner[style*="pointer-events: none"] {
  cursor: default;
}

.nav-card-trip-planner[style*="pointer-events: none"]:hover {
  transform: none;
  box-shadow: none;
}

.trip-planner-hint {
  font-size: 14px;
  opacity: 0.9;
}

.trip-planner-status {
  font-size: 12px;
  opacity: 0.8;
  font-style: italic;
}

/* Responsive styles for trip planner */
@media (max-width: 900px) {
  .trip-planner-panel {
    min-width: 280px;
  }
}

@media (max-width: 600px) {
  .trip-planner-container {
    right: 10px;
    top: 90px;
  }
  .trip-planner-panel {
    min-width: min(92vw, 340px);
    max-height: calc(100vh - 100px);
  }
}

/* Scrollbar polish for trip planner - matching purple theme */
.trip-planner-panel::-webkit-scrollbar {
  width: 10px;
}
.trip-planner-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #271E37 0%, #1a1226 100%);
  border-radius: 10px;
}
.trip-planner-panel::-webkit-scrollbar-track {
  background: rgba(39, 30, 55, 0.05);
  border-radius: 10px;
}

/* Trip header */
.trip-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(39, 30, 55, 0.1);
  margin-bottom: 12px;
}

.trip-header h4 {
  margin: 0;
  color: #271E37;
  font-size: 1rem;
  font-weight: 600;
}

/* Action buttons */
.trip-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.trip-action-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(39, 30, 55, 0.2);
  background: white;
  color: #271E37;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.trip-action-btn:hover:not(:disabled) {
  background: rgba(39, 30, 55, 0.05);
  border-color: #271E37;
}

.trip-action-btn.primary {
  background: linear-gradient(135deg, #271E37 0%, #1a1226 100%);
  color: white;
  border: none;
}

.trip-action-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(39, 30, 55, 0.3);
}

.trip-action-btn.danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.trip-action-btn.danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.trip-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Empty state */
.trip-empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #666;
}

.trip-empty-state svg {
  margin-bottom: 16px;
}

.trip-empty-state p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #271E37;
}

.trip-empty-state small {
  font-size: 0.85rem;
  color: #999;
}

/* Locations list */
.trip-locations-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 0 -10px;
  padding: 0 10px;
}

.trip-location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(39, 30, 55, 0.03);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.trip-location-item:hover {
  background: rgba(39, 30, 55, 0.06);
  border-color: rgba(39, 30, 55, 0.15);
}

.location-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.location-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.location-details {
  flex: 1;
  min-width: 0;
}

.location-name {
  font-weight: 500;
  color: #271E37;
  font-size: 0.9rem;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: #666;
}

.location-category {
  color: #271E37;
  font-weight: 500;
}

.location-coords {
  font-family: monospace;
  opacity: 0.7;
}

.location-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.location-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.location-action-btn:hover {
  background: white;
  border-color: rgba(39, 30, 55, 0.2);
  color: #271E37;
}

.location-action-btn.show-on-map:hover {
  color: #0077be;
  border-color: rgba(0, 119, 190, 0.3);
}

.location-action-btn.remove-location:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Route section */
.trip-route-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(39, 30, 55, 0.1);
}

.trip-route-section .trip-action-btn {
  width: 100%;
}

/* Scrollbar styling */
.trip-locations-list::-webkit-scrollbar {
  width: 6px;
}

.trip-locations-list::-webkit-scrollbar-thumb {
  background: rgba(39, 30, 55, 0.2);
  border-radius: 3px;
}

.trip-locations-list::-webkit-scrollbar-thumb:hover {
  background: rgba(39, 30, 55, 0.3);
}

/* Pulse animation for map markers */
@keyframes pulse-animation {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 119, 190, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(0, 119, 190, 0);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 119, 190, 0);
    transform: scale(1);
  }
}

.pulse-marker {
  width: 20px;
  height: 20px;
  background: #0077be;
  border: 3px solid white;
  border-radius: 50%;
  animation: pulse-animation 2s infinite;
}

/* Responsive adjustments */
@media (max-width: 400px) {
  .trip-actions {
    flex-direction: column;
  }
  
  .trip-location-item {
    padding: 10px;
  }
  
  .location-meta {
    flex-direction: column;
    gap: 2px;
  }
}