/* Custom CSS for Busan 5N5D Tour Web App */

/* Root & Body Mobile Protection */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

*, ::before, ::after {
  box-sizing: border-box;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* CONTINUOUS TIMELINE LAYOUT STYLING */
.timeline-wrapper {
  position: relative;
  padding-left: 1.75rem;
}

.timeline-wrapper::before {
  content: '';
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.7rem;
  width: 3px;
  background: linear-gradient(to bottom, #4f46e5, #0284c7, #0d9488, #059669, #475569);
  border-radius: 9999px;
}

.timeline-item {
  position: relative;
  transition: all 0.3s ease;
  max-width: 100%;
}

.timeline-badge {
  position: absolute;
  left: -1.75rem;
  top: 0.5rem;
  width: 2.6rem;
  height: 1.6rem;
  border-radius: 9999px;
  color: white;
  font-weight: 800;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid white;
  z-index: 10;
}

/* Day Node Marker on Continuous Timeline */
.timeline-day-node {
  position: relative;
  margin-top: 1.75rem;
  margin-bottom: 1rem;
}

.timeline-day-node .timeline-badge {
  background-color: #0f172a !important;
  border-color: #38bdf8 !important;
  width: 2.8rem;
  height: 1.7rem;
  font-size: 0.65rem;
  left: -1.85rem;
}

@media (min-width: 640px) {
  .timeline-wrapper {
    padding-left: 2.2rem;
  }
  .timeline-wrapper::before {
    left: 0.95rem;
  }
  .timeline-badge {
    left: -2.2rem;
    width: 3rem;
    height: 1.75rem;
    font-size: 0.7rem;
  }
  .timeline-day-node .timeline-badge {
    left: -2.35rem;
    width: 3.3rem;
    height: 1.85rem;
    font-size: 0.7rem;
  }
}

/* Active Live Highlight Animation */
.timeline-item.active-live .timeline-content {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  background-color: #f0f9ff;
  position: relative;
}

.timeline-item.active-live .timeline-badge {
  background-color: #ea580c !important;
  animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
  0% {
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(234, 88, 12, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
  }
}

/* Past Item & Day Node Collapsed State */
.past-item-collapsed {
  display: none !important;
}

.past-item-expanded {
  display: block !important;
  opacity: 0.88;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.most-recent-past .timeline-content,
[data-meal-type].most-recent-past {
  border-left: 4px solid #64748b !important;
  background-color: #f8fafc !important;
}

.timeline-item.most-recent-past .timeline-badge {
  background-color: #64748b !important;
}

.past-toggle-bar:hover {
  background-color: #e2e8f0;
}

/* Navigation Tabs */
.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  white-space: nowrap;
  border: 1px solid #e2e8f0;
  background-color: white;
  color: #475569;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-tab:hover {
  background-color: #f8fafc;
  color: #0284c7;
  border-color: #bae6fd;
}

.nav-tab.active {
  background-color: #0284c7;
  color: white;
  border-color: #0284c7;
  box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

/* Tab Panes */
.tab-pane {
  display: none;
  max-width: 100%;
}

.tab-pane.active-pane {
  display: block;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Group Button Filter */
.group-btn {
  color: #94a3b8;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
}

.group-btn:hover {
  color: white;
}

.group-btn.active {
  background-color: #0284c7;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Group Card Filter highlight */
.group-hn-card.highlight-group, .group-sg-card.highlight-group {
  border-color: #0284c7;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15);
}

.group-hn-card.dim-group, .group-sg-card.dim-group {
  opacity: 0.4;
  filter: grayscale(80%);
}

/* Mobile Nav Active */
.mobile-nav-btn {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.mobile-nav-btn.active {
  opacity: 1;
  font-weight: bold;
}

/* Responsive Table & Select Adjustments */
select, input, button {
  max-width: 100%;
}

/* Prevent text overflow on small viewports */
h1, h2, h3, h4, p, span, div {
  overflow-wrap: break-word;
  word-break: break-word;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
