/* ==========================================
   Design System & Variable Declarations
   ========================================== */
:root {
  /* Color Palette (Deep Space Slate & Neon Glows) */
  --bg-main: #0b0f19;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-hover: rgba(26, 36, 57, 0.85);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-card-hover: rgba(99, 102, 241, 0.3);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Category Colors */
  --color-transit: #f59e0b;     /* Amber */
  --color-hotel: #8b5cf6;       /* Violet */
  --color-food: #f43f5e;        /* Rose */
  --color-show: #ec4899;        /* Pink */
  --color-sightseeing: #06b6d4; /* Cyan */
  --color-shopping: #10b981;    /* Emerald */
  --color-dome: #14b8a6;        /* Teal */
  --color-optional: #eab308;    /* Yellow */
  
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
  
  /* Fonts */
  --font-en: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  --font-th: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  
  /* Glassmorphism settings */
  --glass-blur: 16px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================
   Language Toggling Engine
   ========================================== */
html[lang="en"] .lang-th {
  display: none !important;
}

html[lang="th"] .lang-en {
  display: none !important;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-en);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Switch Thai text to Thai font */
html[lang="th"] body {
  font-family: var(--font-th);
}

/* ==========================================
   Background Decorative Elements
   ========================================== */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
}

.circle-1 {
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, #6366f1, #06b6d4);
}

.circle-2 {
  bottom: -10%;
  left: -10%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
}

/* ==========================================
   Header Styles
   ========================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  padding: 1rem 0;
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.8rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: planeFloat 3s ease-in-out infinite;
}

@keyframes planeFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

.header-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-logo .subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Language Toggle Buttons */
.lang-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  border-radius: 9999px;
  gap: 0.25rem;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.lang-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.flag-icon {
  font-size: 1rem;
}

/* ==========================================
   Main Layout & Hero Card
   ========================================== */
.main-content {
  max-width: 850px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.hero-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-card);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  background: linear-gradient(to right, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

.meta-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.meta-icon {
  font-size: 1.3rem;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.meta-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}

.meta-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================
   Tips Accordion Section
   ========================================== */
.tips-accordion {
  margin-bottom: 2rem;
}

.tips-details {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.tips-details[open] {
  box-shadow: var(--shadow-lg);
  border-color: rgba(255, 255, 255, 0.12);
}

.tips-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Hide default marker in Safari */
.tips-summary::-webkit-details-marker {
  display: none;
}

.summary-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #38bdf8;
}

.chevron-icon {
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.tips-details[open] .chevron-icon {
  transform: rotate(180deg);
}

.tips-dropdown-content {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.tip-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.25rem;
  transition: var(--transition-smooth);
}

.tip-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.tip-card-icon {
  font-size: 1.4rem;
  color: #38bdf8;
  margin-bottom: 0.75rem;
}

.tip-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tip-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================
   Day Navigation (Tab Selector)
   ========================================== */
.day-nav {
  position: sticky;
  top: 75px; /* Offset for header */
  z-index: 90;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 2.5rem;
  padding: 0.5rem 0;
  border-radius: 16px;
}

.tabs-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none; /* Hide standard firefox scrollbar */
  padding: 0.25rem;
}

.tabs-container::-webkit-scrollbar {
  display: none; /* Hide Chrome/Safari scrollbar */
}

.tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  transition: var(--transition-bounce);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.75rem;
}

.tab-btn.active .day-num {
  background: rgba(0, 0, 0, 0.25);
}

/* ==========================================
   Itinerary Timeline & Cards
   ========================================== */
.itinerary-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Timeline central vertical guide line */
.itinerary-timeline::before {
  content: '';
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 28px;
  width: 2px;
  background: linear-gradient(to bottom, 
    rgba(99, 102, 241, 0.4) 0%, 
    rgba(59, 130, 246, 0.4) 50%, 
    rgba(6, 182, 212, 0.1) 100%
  );
  z-index: 1;
}

/* Day Divider Banner */
.day-group-header {
  position: relative;
  z-index: 2;
  margin-top: 1rem;
  margin-left: 4.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeIn 0.5s ease-out;
}

.day-group-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.day-group-header h3 i {
  color: #6366f1;
}

.day-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  margin-top: 0.25rem;
}

/* The card structure */
.itinerary-card {
  position: relative;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-left: 4.5rem;
  transition: var(--transition-bounce);
  z-index: 2;
}

.itinerary-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px) scale(1.01);
}

/* The timeline bubble dot node */
.card-timeline-node {
  position: absolute;
  left: -4.5rem;
  top: 1.75rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.node-dot {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bg-main);
  border: 3px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
}

.itinerary-card:hover .node-dot {
  transform: scale(1.2);
  border-color: #6366f1;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

/* Node Category Variations */
.node-dot.transit { border-color: var(--color-transit); color: var(--color-transit); }
.node-dot.hotel { border-color: var(--color-hotel); color: var(--color-hotel); }
.node-dot.food { border-color: var(--color-food); color: var(--color-food); }
.node-dot.show { border-color: var(--color-show); color: var(--color-show); }
.node-dot.sightseeing { border-color: var(--color-sightseeing); color: var(--color-sightseeing); }
.node-dot.shopping { border-color: var(--color-shopping); color: var(--color-shopping); }
.node-dot.dome { border-color: var(--color-dome); color: var(--color-dome); }
.node-dot.optional { border-color: var(--color-optional); color: var(--color-optional); }

/* Image section */
.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.itinerary-card:hover .card-image {
  transform: scale(1.08);
}

/* Category Badge overlay on image */
.category-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.category-tag.transit { background: rgba(245, 158, 11, 0.85); }
.category-tag.hotel { background: rgba(139, 92, 246, 0.85); }
.category-tag.food { background: rgba(244, 63, 94, 0.85); }
.category-tag.show { background: rgba(236, 72, 153, 0.85); }
.category-tag.sightseeing { background: rgba(6, 182, 212, 0.85); }
.category-tag.shopping { background: rgba(16, 185, 129, 0.85); }
.category-tag.dome { background: rgba(20, 184, 166, 0.85); }
.category-tag.optional { background: rgba(234, 179, 8, 0.85); }

/* Card text details */
.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-time-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-time-info i {
  color: #38bdf8;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Card custom alerts & block notes */
.card-notes {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card-notes.info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}

.card-notes.schedule {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #a7f3d0;
}

.card-notes.tip {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  color: #fde68a;
}

.card-notes.warn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.card-notes.check {
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: #ddd6fe;
}

.map-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.map-link:hover {
  opacity: 0.85;
}

/* ==========================================
   Footer Styles
   ========================================== */
.footer {
  text-align: center;
  border-top: 1px solid var(--border-card);
  padding: 2.5rem 1.5rem;
  background: rgba(17, 24, 39, 0.4);
  margin-top: 4rem;
}

.footer p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.text-red {
  color: #f43f5e;
}

.footer-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ==========================================
   Responsive Adjustments & Media Queries
   ========================================== */

/* Tablet & Mobile Layout Adaptations */
@media (max-width: 768px) {
  .hero-card {
    padding: 1.75rem;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .hero-meta-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .tips-grid {
    grid-template-columns: 1fr;
  }
  
  .day-nav {
    top: 65px;
    padding: 0.25rem 0;
  }
  
  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  /* Remove dual column grid on cards */
  .itinerary-card {
    grid-template-columns: 1fr;
    margin-left: 2rem;
  }
  
  .card-image-wrapper {
    height: 180px;
    min-height: auto;
  }
  
  .day-group-header {
    margin-left: 2rem;
  }
  
  /* Relocate timeline node path */
  .itinerary-timeline::before {
    left: 10px;
  }
  
  .card-timeline-node {
    left: -2rem;
    top: 1.5rem;
    width: 2rem;
    height: 2rem;
  }
  
  .node-dot {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.75rem;
    border-width: 2px;
  }
}

/* Super Small Mobiles */
@media (max-width: 480px) {
  .header-logo h1 {
    font-size: 1.15rem;
  }
  
  .header-logo .subtitle {
    font-size: 0.7rem;
  }
  
  .main-content {
    margin-top: 1rem;
    padding: 0 1rem;
  }
  
  .day-group-header h3 {
    font-size: 1.1rem;
  }
  
  .card-content {
    padding: 1.25rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
}

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