/* ========================================
   TRIPS LIST (Homepage)
   ======================================== */

/* Trips auto-scroll animation */
@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.animate-scroll-infinite {
  animation: scroll-left 30s linear infinite;
}

.animate-scroll-infinite:hover {
  animation-play-state: paused;
}

/* Ensure smooth scrolling */
.trips-scroll-container {
  width: 100%;
  position: relative;
}

.trips-scroll-track {
  width: max-content;
}

/* Force trip card dimensions */
.trip-card {
  width: 353px !important;
  max-width: 353px !important;
}

.trip-card .relative {
  height: 221px !important;
  max-height: 221px !important;
}

.trip-card img {
  width: 100% !important;
  height: 221px !important;
  max-height: 221px !important;
  object-fit: cover !important;
}

/* ========================================
   TRIP DETAIL PAGE
   ======================================== */

/* Container */
.trip-detail-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  min-height: 100vh;
}

html:not(.dark) .trip-detail-container {
  background-color: #f6f3fc;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1.5rem;
  color: #d1d5db;
}

html:not(.dark) .loading-state {
  color: #6b7280;
}

.loading-spinner {
  position: relative;
  width: 64px;
  height: 64px;
}

.loading-spinner::before,
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 4px solid transparent;
  border-radius: 50%;
}

.loading-spinner::before {
  border-color: rgba(139, 92, 246, 0.2);
}

.loading-spinner::after {
  border-top-color: #8b5cf6;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Hero Section */
.trip-hero {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 350px;
  max-height: 500px;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 3rem;
  animation: fadeInUp 0.8s ease-out;
}

.trip-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.trip-hero:hover img {
  transform: scale(1.05);
}

.trip-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
}

.trip-title {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  margin: 0 0 1rem 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  animation: fadeInUp 1s ease-out 0.2s both;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: white;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.trip-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: white;
}

.trip-meta-item i {
  color: #a78bfa;
}

html:not(.dark) .trip-meta-item i {
  color: #c4b5fd;
}

/* Content Sections */
.trip-content-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.trip-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

html:not(.dark) .trip-section {
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.trip-section:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #a78bfa;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

html:not(.dark) .section-title {
  color: #7c3aed;
}

.trip-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #d1d5db;
}

html:not(.dark) .trip-description {
  color: #374151;
}

/* Highlights */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(167, 139, 250, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

html:not(.dark) .highlight-item {
  background: #f3f4f6;
}

.highlight-item:hover {
  background: rgba(167, 139, 250, 0.2);
  transform: translateX(8px);
}

html:not(.dark) .highlight-item:hover {
  background: #e5e7eb;
}

.highlight-item i {
  color: #a78bfa;
  margin-top: 4px;
  flex-shrink: 0;
}

.highlight-text {
  color: #e5e7eb;
  line-height: 1.6;
}

html:not(.dark) .highlight-text {
  color: #1f2937;
}

/* Photo Gallery */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInScale 0.6s ease-out both;
  background: linear-gradient(90deg, #2a1454 0%, #3a1f64 50%, #2a1454 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite, fadeInScale 0.6s ease-out both;
}

html:not(.dark) .gallery-item {
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.4);
  z-index: 10;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-caption {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.gallery-place {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
}

/* Tags */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tag {
  padding: 0.5rem 1rem;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  color: #c4b5fd;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.tag:hover {
  background: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

html:not(.dark) .tag {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}

html:not(.dark) .tag:hover {
  background: #ddd6fe;
}


/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Error/Empty States */
.error-state, .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1rem;
  color: #d1d5db;
}

html:not(.dark) .error-state,
html:not(.dark) .empty-state {
  color: #6b7280;
}

.error-icon, .empty-icon {
  font-size: 4rem;
  color: #a78bfa;
  margin-bottom: 1rem;
}

html:not(.dark) .error-icon,
html:not(.dark) .empty-icon {
  color: #8b5cf6;
}

.error-message {
  font-size: 1.5rem;
  color: #ef4444;
  margin-bottom: 0.5rem;
}

html:not(.dark) .error-message {
  color: #dc2626;
}

/* Lightbox/Modal */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html:not(.dark) .lightbox-overlay {
  background: rgba(255, 255, 255, 0.98);
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  animation: zoomIn 0.3s ease-out;
  pointer-events: none;
  z-index: 10001;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  color: white;
  font-size: 28px;
  font-weight: 300;
  z-index: 10002;
}

html:not(.dark) .lightbox-close {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1f2937;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

html:not(.dark) .lightbox-close:hover {
  background: rgba(0, 0, 0, 0.2);
}

.lightbox-caption {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  padding: 1rem 2rem;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  max-width: 80%;
  z-index: 10002;
  display: none; /* Hidden by default, JavaScript shows it when needed */
}

html:not(.dark) .lightbox-caption {
  background: rgba(255, 255, 255, 0.9);
  color: #1f2937;
}

.lightbox-caption-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.lightbox-caption-place {
  font-size: 0.9rem;
  opacity: 0.8;
}

html:not(.dark) .lightbox-caption-place {
  opacity: 0.7;
}

.lightbox-navigation {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto;
  color: white;
  font-size: 24px;
  z-index: 10002;
}

html:not(.dark) .lightbox-navigation {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1f2937;
}

.lightbox-navigation:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

html:not(.dark) .lightbox-navigation:hover {
  background: rgba(0, 0, 0, 0.2);
}

.lightbox-prev {
  left: 30px;
}

.lightbox-next {
  right: 30px;
}

.lightbox-counter {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.95rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 10003;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html:not(.dark) .lightbox-counter {
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .lightbox-counter {
    top: 10px;
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Protection watermark */
.photo-protection {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}

.photo-protection::before {
  content: '© Sajid Ahsan';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.1);
  font-weight: bold;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .trip-detail-container {
    padding: 60px 16px 40px;
  }

  .trip-hero {
    height: 50vh;
    min-height: 300px;
    border-radius: 16px;
  }

  .trip-hero-overlay {
    padding: 1.5rem;
  }

  .trip-title {
    font-size: 2rem;
  }

  .trip-meta {
    font-size: 0.9rem;
  }

  .back-button {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .photo-gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .trip-section {
    padding: 1.5rem;
  }
}
