/* ============================================================
   Adventures — Complete Stylesheet
   Design: egodevnull.com dark glassmorphism aesthetic
   ============================================================ */

/* --- Design Tokens --- */
:root {
  color-scheme: dark;
  --bg: #1b2626;
  --bg2: #2f4f4f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.15);
  --border-hover: #ff6b35;
  --accent: #ff6b35;
  --accent-light: #ff8557;
  --accent2: #004e98;
  --accent-glow: rgba(255, 107, 53, 0.25);
  --text: #fdfbf7;
  --text-muted: #a5b2b2;
  --text-faint: #7a8c8c;
  --nav-height: 64px;
  --radius: 0px;
  --radius-md: 0px;
  --radius-sm: 0px;
  --radius-pill: 0px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-card: none;
  --transition: 0.18s ease-in-out;
  --amber: #ff6b35;
  --amber-glow: rgba(255, 107, 53, 0.25);
  --green: #10b981;
  --green-surface: rgba(16, 185, 129, 0.1);
  --blue: #004e98;
  --blue-surface: rgba(0, 78, 152, 0.15);
  --danger: #ff4d4d;
}

/* --- Light Mode --- */
[data-theme="light"] {
  color-scheme: light;
  --bg: #fdfbf7;
  --bg2: #f5f1e9;
  --surface: rgba(47, 79, 79, 0.06);
  --surface-hover: rgba(47, 79, 79, 0.1);
  --border: rgba(47, 79, 79, 0.18);
  --border-hover: #004e98;
  --accent: #004e98;
  --accent-light: #0062bd;
  --accent2: #ff6b35;
  --accent-glow: rgba(0, 78, 152, 0.18);
  --text: #1c2626;
  --text-muted: #5e6666;
  --text-faint: #8a9494;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-card: none;
  --amber-glow: rgba(255, 107, 53, 0.15);
  --green-surface: rgba(16, 185, 129, 0.15);
  --blue-surface: rgba(0, 78, 152, 0.15);
  --danger: #d32f2f;
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.1rem;
}

p {
  color: var(--text-muted);
  line-height: 1.7;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-light);
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--surface);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: var(--accent-light);
}

.text-muted {
  color: var(--text-muted);
}

/* --- Container --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(13, 13, 20, 0.72);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="light"] .nav {
  background: rgba(245, 245, 247, 0.78);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  user-select: none;
  cursor: pointer;
  transition: color var(--transition);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-link:hover {
  color: var(--text);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* --- Hamburger --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 9px;
  transition: all var(--transition);
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger:hover {
  background: var(--surface-hover);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

[data-theme="light"] .btn-primary:disabled {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

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

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-success {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.3);
  color: var(--green);
}

.btn-success:hover {
  background: rgba(52, 211, 153, 0.25);
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.2);
}

/* --- Tags --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.tag-accent {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.25);
  color: var(--accent-light);
}

.tag-cyan {
  background: rgba(79, 195, 247, 0.1);
  border-color: rgba(79, 195, 247, 0.25);
  color: var(--accent2);
}

.tag-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger, #f2761d);
}

.tag-wip {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--amber);
}

/* --- Orb Backgrounds --- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.orb-1 {
  width: 400px;
  height: 400px;
  top: -120px;
  right: -100px;
  background: var(--accent);
  opacity: 0.08;
  animation: drift 18s ease-in-out infinite;
}

.orb-2 {
  width: 350px;
  height: 350px;
  bottom: -80px;
  left: -80px;
  background: var(--amber);
  opacity: 0.12;
  animation: drift 22s ease-in-out infinite reverse;
}

.orb-3 {
  width: 280px;
  height: 280px;
  top: 50%;
  left: 60%;
  background: var(--accent2);
  opacity: 0.06;
  animation: drift 25s ease-in-out infinite 3s;
}

@keyframes drift {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -20px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 25px) scale(0.95);
  }

  75% {
    transform: translate(15px, 15px) scale(1.02);
  }
}

/* --- Project Hero --- */
.project-hero {
  position: relative;
  padding: calc(var(--nav-height) + 60px) 0 60px;
  overflow: hidden;
}

.project-hero-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.project-hero-icon {
  font-size: 3.2rem;
  margin-bottom: 20px;
  display: inline-block;
  animation: drift 6s ease-in-out infinite;
}

.project-hero h1 {
  margin-bottom: 14px;
  font-size: 2.6rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.project-hero .desc {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 24px;
  max-width: 580px;
  white-space: pre-wrap;
}

/* --- Premium Cover Image Banner Card --- */
.hero-cover-container {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.hero-cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-cover-container:hover .hero-cover-image {
  transform: scale(1.02);
}

.hero-cover-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero-cover-container {
    height: 180px;
    margin-bottom: 20px;
  }
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.project-meta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}

.meta-row:last-child {
  border-bottom: none;
}

.meta-label {
  color: var(--text-faint);
  font-weight: 500;
}

.meta-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  max-width: 75%;
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-faint);
  margin-bottom: 32px;
  transition: color var(--transition);
}

.back-link:hover {
  color: var(--accent);
}

/* --- Project Body --- */
.project-body {
  padding: 40px 0 80px;
}

/* --- Cost Summary Widget --- */
.cost-summary {
  margin-top: 32px;
  margin-bottom: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

.admin-modal-content .cost-summary {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.cost-summary-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cost-summary-title span {
  font-size: 1.3rem;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cost-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.cost-currency-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  margin-bottom: 14px;
}

.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.cost-row+.cost-row {
  border-top: 1px solid var(--border);
}

.cost-label {
  font-size: 0.85rem;
  color: var(--text-faint);
  font-weight: 500;
}

.cost-value {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.cost-row-total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-hover) !important;
}

.cost-row-total .cost-label {
  color: var(--text);
  font-weight: 700;
}

.cost-row-total .cost-value {
  color: var(--accent-light);
  font-size: 1.05rem;
}

/* --- Itinerary Section --- */
.itinerary-section {
  padding: 0 24px 80px;
}

.itinerary-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.itinerary-title span {
  font-size: 1.5rem;
}

/* --- Itinerary Desktop Split Layout --- */
.itinerary-desktop-layout {
  display: block;
}

.itinerary-sidebar-nav {
  display: none;
}

@media (min-width: 769px) {
  .itinerary-desktop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
    margin-top: 24px;
  }

  .itinerary-sidebar-nav {
    display: block;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    padding-left: 4px;
    padding-right: 16px;
  }

  .itinerary-sidebar-nav::-webkit-scrollbar {
    display: none; /* Safari / Chrome */
  }

  .itinerary-sidebar-days {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Vertical line behind bullets */
  .itinerary-sidebar-line {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 17px;
    width: 2px;
    background: var(--border);
    z-index: 1;
    pointer-events: none;
  }

  .itinerary-sidebar-day-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 12px 10px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    z-index: 2;
    user-select: none;
  }

  .itinerary-sidebar-day-item:hover {
    background: var(--surface-hover);
  }

  .sidebar-day-bullet {
    flex: 0 0 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    margin-top: 2px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
  }

  .itinerary-sidebar-day-item:hover .sidebar-day-bullet {
    border-color: var(--accent);
    transform: scale(1.1);
  }

  .sidebar-day-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }

  .sidebar-day-num {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
  }

  .sidebar-day-meta {
    font-size: 0.72rem;
    color: var(--text-faint);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
  }

  /* Active State */
  .itinerary-sidebar-day-item.active {
    background: rgba(16, 185, 129, 0.05); /* soft accent background tint */
    border-left: 2px solid var(--accent); /* border highlight */
    padding-left: 6px; /* align for border offset */
  }

  [data-theme="light"] .itinerary-sidebar-day-item.active {
    background: rgba(0, 78, 152, 0.05);
  }

  .itinerary-sidebar-day-item.active .sidebar-day-bullet {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
  }

  .itinerary-sidebar-day-item.active .sidebar-day-bullet::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    display: block;
  }

  .itinerary-sidebar-day-item.active .sidebar-day-num {
    color: var(--accent);
  }

  .itinerary-sidebar-day-item.active .sidebar-day-meta {
    color: var(--text-muted);
    font-weight: 500;
  }

  /* Today state for sidebar items */
  .sidebar-today-badge {
    background: rgba(16, 185, 129, 0.12);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.25);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-left: 8px;
  }

  [data-theme="light"] .sidebar-today-badge {
    background: rgba(4, 120, 87, 0.1);
    color: #047857;
    border-color: rgba(4, 120, 87, 0.2);
  }

  .itinerary-sidebar-day-item.is-today:not(.active) .sidebar-day-bullet {
    border-color: var(--green);
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
  }

  /* Add a pulse dot inside the bullet for today's active day */
  .itinerary-sidebar-day-item.is-today:not(.active) .sidebar-day-bullet::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: block;
    animation: today-pulse 2s infinite ease-in-out;
  }

  @keyframes today-pulse {
    0%, 100% {
      transform: scale(0.9);
      opacity: 0.6;
    }
    50% {
      transform: scale(1.2);
      opacity: 1;
    }
  }
}

/* --- View Toggle / Itinerary Layout Switcher --- */
.itinerary-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

.view-toggle-container {
  display: flex;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}

.view-toggle-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.view-toggle-btn:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

/* --- Calendar View --- */
.calendar-view-container {
  width: 100%;
  max-width: 820px;
  margin-top: 4px;
  animation: fadeIn 0.25s ease-out;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-month-title {
  display: flex;
  align-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.calendar-month-meta {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-left: 10px;
  font-weight: 500;
}

.calendar-nav-group {
  display: flex;
  gap: 6px;
}

.calendar-nav-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.calendar-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--text-faint);
}

.calendar-grid-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
}

.calendar-grid-scroll-wrapper::-webkit-scrollbar {
  height: 6px;
}
.calendar-grid-scroll-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}
.calendar-grid-scroll-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.calendar-grid-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  width: 100%;
  min-width: 600px;
}

.calendar-day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.calendar-cell {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  min-height: 64px;
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition);
  color: var(--text-faint);
  opacity: 0.35;
}

.calendar-cell.is-current-month {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border);
}

.calendar-cell.is-trip-day {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.calendar-cell.is-trip-day:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Banding Border Radiuses */
.calendar-cell.band-start {
  border-top-left-radius: 10px !important;
  border-bottom-left-radius: 10px !important;
  border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.calendar-cell.band-end {
  border-top-right-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
  border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.calendar-cell.band-middle {
  border-radius: 0px !important;
  border-left: none !important;
  border-right: none !important;
}

/* Header row of date cell (date number, dot, and flat icons) */
.day-cell-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-weight: 700;
  font-size: 0.82rem;
  width: 100%;
}

.day-cell-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.72rem;
  opacity: 0.9;
}

.day-cell-icons .calendar-icon {
  font-size: 0.72rem;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
  color: inherit;
}

.day-cell-icons .calendar-icon:hover {
  transform: scale(1.25);
  opacity: 1;
}

/* Location labels at the bottom */
.day-location-label {
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 6px;
  opacity: 0.9;
}

/* Light Theme overrides for Calendar */
[data-theme="light"] .view-toggle-container {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .view-toggle-btn {
  color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .view-toggle-btn.active {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="light"] .calendar-cell {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .calendar-cell.is-current-month {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .calendar-cell.is-trip-day {
  border-color: rgba(0, 0, 0, 0.1);
}

/* --- Itinerary Timeline --- */
.itinerary-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* --- Day Card --- */
.itinerary-day-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}

.itinerary-day-card:hover {
  border-color: var(--amber-glow);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--amber-glow);
  transform: translateY(-2px);
}

.itinerary-day-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 12px;
  background: rgba(245, 158, 11, 0.06);
  border-right: 1px solid var(--border);
}

.itinerary-day-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.itinerary-day-date {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.3;
}

/* --- Day Content --- */
.itinerary-day-content {
  padding: 24px 28px;
  position: relative;
}

.itinerary-day-content h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
  padding-right: 40px;
}

.itinerary-day-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

/* --- Highlights (Activities) --- */
.itinerary-day-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.itinerary-day-highlight {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.18);
  color: var(--text-muted);
  transition: all var(--transition);
}

.itinerary-day-highlight:hover {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.itinerary-day-highlight-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

/* --- Activity Location Links --- */
.activity-location-link {
  color: var(--accent) !important;
  text-decoration: underline;
  text-decoration-color: var(--accent-glow, rgba(255, 107, 53, 0.4));
  text-underline-offset: 3px;
  cursor: pointer;
  transition: all var(--transition);
}

.activity-location-link:hover {
  color: var(--accent-light) !important;
  text-decoration-color: var(--accent-light);
}

.itinerary-day-highlight .activity-location-link {
  color: var(--accent) !important;
  font-weight: 600;
}

.itinerary-day-highlight .activity-location-link:hover {
  color: var(--accent-light) !important;
}

/* --- Itinerary Detailed Card Metadata --- */
.itinerary-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.itinerary-meta-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text-muted);
  line-height: 1.5;
}

.itinerary-meta-label {
  font-weight: 700;
  color: var(--text-faint);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.itinerary-meta-value {
  color: var(--text);
  word-break: break-word;
}

.itinerary-meta-value a {
  color: var(--accent) !important;
  text-decoration: none;
  font-weight: 600;
}

.itinerary-meta-value a:hover {
  text-decoration: underline !important;
}

/* --- Price Badges --- */
.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.lodging-price {
  background: var(--green-surface);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--green);
}

.transit-price {
  background: var(--green-surface);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: var(--green);
}

.rental-price {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

.breakfast-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b; /* Golden amber for dark mode */
  margin-left: 6px;
  vertical-align: middle;
}

[data-theme="light"] .breakfast-badge {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.2);
  color: #b45309; /* Darker amber for light mode readability */
}

/* --- Memories Section --- */
.memories-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--accent-glow);
}

.memories-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 10px rgba(165, 151, 255, 0.25);
  letter-spacing: 0.02em;
}

.memories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.memory-card {
  background: rgba(255, 107, 53, 0.07);
  border: 1px solid rgba(165, 151, 255, 0.22);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  transition: all var(--transition);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.04);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  flex: 1 1 320px;
  max-width: min(100%, 520px);
  box-sizing: border-box;
}

.memory-card.editing {
  padding-right: 74px;
}

.memory-card:hover {
  border-color: rgba(165, 151, 255, 0.5);
  background: rgba(255, 107, 53, 0.15);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.18);
  transform: translateY(-2px);
}

[data-theme="light"] .memory-card {
  background: rgba(108, 92, 231, 0.05);
  border: 1px solid rgba(108, 92, 231, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .memory-card:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.35);
  box-shadow: 0 8px 24px rgba(108, 92, 231, 0.1);
}

/* Modal Memory & Note Rows */
.modal-memory-row,
.modal-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  gap: 12px;
  width: 100%;
  transition: all var(--transition);
}

.modal-memory-row:hover,
.modal-note-row:hover {
  border-color: rgba(165, 151, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-memory-row,
[data-theme="light"] .modal-note-row {
  background: rgba(0, 0, 0, 0.015);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modal-memory-row:hover,
[data-theme="light"] .modal-note-row:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(108, 92, 231, 0.3);
}

/* Modal Cost Rows */
.modal-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(251, 191, 36, 0.04);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 12px;
  gap: 12px;
  width: 100%;
  transition: all var(--transition);
  box-sizing: border-box;
}

.modal-cost-row:hover {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.06);
}

[data-theme="light"] .modal-cost-row {
  background: rgba(245, 158, 11, 0.03);
  border-color: rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .modal-cost-row:hover {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.35);
}

.memory-content {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.65;
}

.memory-time {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.memory-location-badge,
.cost-location-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent-light);
  background: rgba(255, 107, 53, 0.15);
  border: 1px solid rgba(165, 151, 255, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition);
}

.memory-location-badge:hover,
.cost-location-badge:hover {
  background: rgba(255, 107, 53, 0.25);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.2);
}

[data-theme="light"] .memory-location-badge,
[data-theme="light"] .cost-location-badge {
  color: var(--accent);
  background: rgba(108, 92, 231, 0.08);
  border-color: rgba(108, 92, 231, 0.2);
}

[data-theme="light"] .memory-location-badge:hover,
[data-theme="light"] .cost-location-badge:hover {
  background: rgba(108, 92, 231, 0.15);
  border-color: var(--accent);
}

.memory-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 4px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.memory-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.25);
}

.memory-edit {
  position: absolute;
  top: 10px;
  right: 38px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 107, 53, 0.12);
  border-radius: 4px;
  color: var(--accent-light);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.memory-edit:hover {
  opacity: 1;
  background: rgba(255, 107, 53, 0.25);
  color: var(--text);
}

/* --- Costs Section --- */
.costs-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.costs-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fcd34d;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
  letter-spacing: 0.02em;
}

.costs-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.cost-item-card {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  padding: 14px 16px;
  position: relative;
  transition: all var(--transition);
  box-shadow: 0 8px 32px rgba(251, 191, 36, 0.03);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  flex: 1 1 280px;
  max-width: min(100%, 420px);
  box-sizing: border-box;
}

.cost-item-card:hover {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
  transform: translateY(-2px);
}

[data-theme="light"] .cost-item-card {
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .cost-item-card:hover {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.08);
}

.cost-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 8px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.cost-delete:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.25);
}

.cost-edit {
  position: absolute;
  top: 12px;
  right: 42px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 107, 53, 0.12);
  border-radius: 8px;
  color: var(--accent-light);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  opacity: 0.7;
}

.cost-edit:hover {
  opacity: 1;
  background: rgba(255, 107, 53, 0.25);
  color: var(--text);
}

/* --- Memory Form --- */
.memory-form {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.memory-form textarea {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  resize: vertical;
  min-height: 40px;
  max-height: 120px;
  transition: border-color var(--transition);
  outline: none;
}

.memory-form textarea::placeholder {
  color: var(--text-faint);
}

.memory-form textarea:focus {
  border-color: var(--border-hover);
}

/* --- Admin Banner --- */
.admin-banner {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 999;
  background: linear-gradient(135deg, var(--accent) 0%, #7c6af7 100%);
  background-color: var(--accent);
  padding: 6px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.admin-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logout-btn {
  color: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  font-size: 0.75rem !important;
  padding: 3px 12px !important;
}

.admin-logout-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

/* --- Admin Modal --- */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

.admin-modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  position: relative;
  animation: slideUp 0.3s ease;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Custom scrollbar for modals */
.admin-modal-content::-webkit-scrollbar,
#day-modal-form::-webkit-scrollbar {
  width: 6px;
}

.admin-modal-content::-webkit-scrollbar-track,
#day-modal-form::-webkit-scrollbar-track {
  background: transparent;
}

.admin-modal-content::-webkit-scrollbar-thumb,
#day-modal-form::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.admin-modal-content::-webkit-scrollbar-thumb:hover,
#day-modal-form::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#day-modal-form {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.admin-modal-content h2 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.admin-modal-content .text-muted {
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.admin-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 10;
}

.admin-modal-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

/* --- Day Details Modal Side Chevron Navigation --- */
.day-details-side-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all var(--transition);
  z-index: 12;
}

.day-details-side-btn.prev-side-btn {
  left: 8px;
}

.day-details-side-btn.next-side-btn {
  right: 8px;
}

.day-details-side-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.day-details-side-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 768px) {
  .day-details-modal-box {
    padding: 20px 36px 20px 36px !important;
  }

  .day-details-side-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .day-details-side-btn.prev-side-btn {
    left: 4px;
  }

  .day-details-side-btn.next-side-btn {
    right: 4px;
  }
}

/* --- Starting Location Picker Custom Styles --- */
.origin-tab-btn {
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
}

.origin-tab-btn.active {
  background: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.35);
}

.origin-tab-btn:hover:not(.active) {
  background: var(--surface);
  color: var(--text);
}

.search-result-item:hover {
  background: var(--surface-hover) !important;
  color: var(--accent-light) !important;
}

#origin-picker-map {
  z-index: 10;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.admin-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

select.admin-input {
  background: var(--bg2) !important;
}

select.admin-input option {
  background: var(--bg2) !important;
  color: var(--text) !important;
}

textarea.admin-input {
  min-height: 75px;
  resize: vertical;
}

.admin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-input::placeholder {
  color: var(--text-faint);
}

/* --- Date & Time Inputs Calendar/Clock Picker --- */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark;
}

[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 4px;
  filter: brightness(0) invert(0.92);
  opacity: 0.85;
  transition: all var(--transition);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  filter: brightness(0) invert(1);
  background: var(--surface-hover);
  transform: scale(1.08);
}

/* In light mode, ensure dark, bold, high-contrast calendar icon on light background */
[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(0.12);
  opacity: 0.88;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  filter: brightness(0) invert(0);
  opacity: 1;
  background: var(--surface-hover);
  transform: scale(1.08);
}

.admin-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: #ef4444;
  margin-bottom: 16px;
}

.admin-submit-btn {
  width: 100%;
  margin-top: 16px;
}

/* --- Edit Button & Move Day Button --- */
.edit-btn,
.move-day-btn {
  position: absolute;
  top: 20px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}

.edit-btn {
  right: 20px;
}

.move-day-btn {
  right: 58px;
}

.edit-btn:hover,
.move-day-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

/* --- Edit Form --- */
.edit-form {
  padding: 4px 0;
}

.edit-form .form-group {
  margin-bottom: 16px;
}

.edit-form .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.edit-form input,
.edit-form textarea,
.edit-form select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.edit-form input:focus,
.edit-form textarea:focus,
.edit-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-form input::placeholder,
.edit-form textarea::placeholder {
  color: var(--text-faint);
}

.edit-form textarea {
  resize: vertical;
  min-height: 70px;
}

.edit-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e9eb1' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

.edit-form select option {
  background: var(--bg2);
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* --- Activity Editor --- */
.activity-editor {
  margin-top: 4px;
}

.activity-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.activity-input {
  flex: 1;
}

.activity-delete-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 6px;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.activity-delete-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.add-activity-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  margin-top: 4px;
}

.add-activity-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Loading --- */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* --- Error --- */
.error-container {
  text-align: center;
  padding: 80px 24px;
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.error-container h2 {
  margin-bottom: 8px;
}

/* --- Success Toast --- */
.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: var(--bg2);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-size: 0.88rem;
  color: var(--green);
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 3000;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake-input {
  animation: inputShake 0.4s ease-in-out !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6) !important;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  margin-top: 0;
}

.footer-inner {
  text-align: center;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-accent {
  color: var(--accent);
  font-weight: 600;
}

.footer-sub {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 6px;
}

.itinerary-tabs-wrapper {
  display: none;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  h1 {
    font-size: 1.85rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .hamburger {
    display: none !important;
  }

  .nav-links {
    display: none !important;
  }

  #hamburger-wrapper.is-logged-out {
    display: block !important;
  }

  #nav-logo.is-logged-out .logo-text {
    display: none !important;
  }

  .create-trip-placeholder-card {
    display: none !important;
  }

  #mobile-create-trip-btn.is-logged-in {
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .trips-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }

  .trips-section-title {
    justify-content: space-between;
    width: 100%;
  }

  .project-hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .project-hero h1 {
    font-size: 1.85rem;
  }

  /* Keep date + visibility pills on one line in mobile */
  .hero-badge-row {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .hero-dates-pill {
    font-size: 0.78rem;
    padding: 5px 12px;
    gap: 6px;
    white-space: nowrap;
  }

  .hero-pill .pill-label-text {
    display: none;
  }

  .hero-pill {
    padding: 5px 10px;
    font-size: 0.78rem;
    min-width: 0;
    flex-shrink: 0;
  }

  .hero-pill.hero-pill-select {
    font-size: 0.75rem;
    padding: 5px 22px 5px 8px !important;
    background-position: right 2px center !important;
  }

  /* Mobile tap-to-reveal tooltip on visibility pill */
  .visibility-pill-mobile {
    position: relative;
    cursor: pointer;
  }

  .visibility-pill-mobile::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }

  .visibility-pill-mobile.pill-public::after {
    background: rgba(6, 78, 59, 0.92);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
  }

  .visibility-pill-mobile.pill-private::after {
    background: rgba(127, 29, 29, 0.92);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  .visibility-pill-mobile.tooltip-visible::after {
    opacity: 1;
  }

  .project-meta-box {
    width: 100%;
  }

  .itinerary-day-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .itinerary-day-number {
    flex-direction: row;
    padding: 10px 16px;
    justify-content: flex-start;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .itinerary-day-content {
    padding: 20px;
  }

  .cost-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .admin-modal-content {
    margin: 16px;
    padding: 28px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  /* --- Itinerary Tab Navigation UX (Mobile Carousel Only) --- */
  .itinerary-tabs-wrapper {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .itinerary-tabs-wrapper::-webkit-scrollbar {
    display: none;
  }

  .itinerary-day-tab {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    color: var(--text-muted);
    background: var(--bg);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
  }

  .itinerary-day-tab .tab-day-label {
    font-size: 0.82rem;
    font-weight: 700;
  }

  .itinerary-day-tab .tab-date-label {
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0.75;
    margin-top: 1px;
  }

  .itinerary-day-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.25);
  }

  /* --- Itinerary Timeline Carousel Adaptations --- */
  .itinerary-timeline {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 16px;
    padding: 12px 4px;
    margin-top: 8px;
    align-items: flex-start;
    transition: height 0.25s ease-out;
  }

  .itinerary-timeline::-webkit-scrollbar {
    display: none;
  }

  .itinerary-day-card {
    grid-template-columns: 1fr;
    flex: 0 0 85vw;
    max-width: 400px;
    scroll-snap-align: center;
    margin: 0;
    align-self: flex-start;
    height: auto;
  }

  .timeline-add-day-divider {
    flex: 0 0 160px;
    height: auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(255, 107, 53, 0.2);
    background: rgba(255, 107, 53, 0.01);
    border-radius: var(--radius);
    margin: 0;
    padding: 24px;
    transition: all var(--transition);
    scroll-snap-align: center;
    box-sizing: border-box;
  }

  .timeline-add-day-divider::before {
    display: none !important;
  }

  .timeline-add-day-divider:hover {
    border-color: var(--accent);
    background: rgba(255, 107, 53, 0.03);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.1);
  }

  .timeline-add-day-btn {
    opacity: 1;
    font-size: 0.8rem;
    padding: 8px 14px;
    border-style: solid;
  }

  /* Responsive Circular actions bar buttons on Mobile to prevent page horizontal overflow */
  .trip-actions-right .btn-text,
  .trip-actions-right #action-edit-text {
    display: none !important;
  }
  .trip-actions-right .btn {
    padding: 0 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    justify-content: center !important;
    border-radius: 50% !important;
  }
  .trip-actions-right {
    gap: 8px !important;
  }

  /* Collapse all side-by-side grid columns inside admin modals on mobile to prevent horizontal overflow */
  .admin-modal-content [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  .admin-modal-content {
    padding: 20px !important;
    margin: 12px !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  .container {
    padding: 0 16px;
  }

  .project-hero {
    padding: calc(var(--nav-height) + 32px) 0 40px;
  }

  .project-hero-icon {
    font-size: 2.4rem;
  }

  .project-hero .desc {
    font-size: 0.95rem;
  }

  .tech-stack {
    gap: 6px;
  }

  .tag {
    font-size: 0.73rem;
    padding: 4px 10px;
  }

  .cost-summary {
    padding: 20px;
  }

  .itinerary-day-content h3 {
    font-size: 1rem;
  }

  .itinerary-day-highlights {
    gap: 6px;
  }

  .memory-form {
    flex-direction: column;
    align-items: stretch;
  }

  .memory-form .btn {
    width: 100%;
  }
}

/* --- Interactive Journey Map --- */
#journey-map-section {
  margin-top: 16px;
  margin-bottom: 48px;
}

.map-card-wrapper {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.map-header-title {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.map-header-title span {
  font-size: 1.6rem;
}

.map-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.map-body {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color var(--transition);
}

.map-element {
  width: 100%;
  height: 650px;
  background: var(--bg2);
  z-index: 1;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-card-toggle-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}

.map-card-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--accent-light);
  border-color: var(--accent);
  transform: scale(1.05);
}

.map-card-minimized-title {
  display: none;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding-right: 48px; /* Avoid overlapping text with the toggle button */
  transition: color var(--transition);
}

.map-card-minimized-title:hover {
  color: var(--accent-light);
}

/* Card Minimized States */
.map-card-wrapper.minimized {
  padding: 16px 24px;
}

.map-card-wrapper.minimized .map-explorer-layout {
  display: none !important;
}

.map-card-wrapper.minimized #map-header-container {
  display: none !important;
}

.map-card-wrapper.minimized .map-card-minimized-title {
  display: flex;
}

.map-card-wrapper.minimized .map-card-toggle-btn {
  top: 10px;
  right: 16px;
}

/* Custom styles for Leaflet elements inside dark mode - removed for clean white background */

.leaflet-container {
  font-family: inherit !important;
  background-color: #e4e8eb !important; /* prevents dark/white flashing during zoom-out tile reloads */
}

.leaflet-bar {
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
}

.leaflet-bar a {
  background-color: var(--bg2) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
  transition: all var(--transition) !important;
}

.leaflet-bar a:hover {
  background-color: var(--surface-hover) !important;
  color: var(--accent-light) !important;
}

.leaflet-popup-content-wrapper {
  background: rgba(18, 18, 30, 0.92) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  padding: 4px;
}

[data-theme="light"] .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #1a1a2e !important;
}

.leaflet-popup-tip {
  background: rgba(18, 18, 30, 0.92) !important;
  border: 1px solid var(--border) !important;
}

[data-theme="light"] .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.92) !important;
}

.leaflet-popup-content {
  margin: 12px 16px !important;
  line-height: 1.6 !important;
  font-size: .98333em;
}

.leaflet-popup-close-button {
  color: var(--text-muted) !important;
  font-size: 16px !important;
  top: 8px !important;
  right: 8px !important;
}

.leaflet-popup-close-button:hover {
  color: var(--accent) !important;
}

/* Custom Marker Styling */
.custom-leaflet-icon {
  background: transparent !important;
  border: none !important;
}

.marker-pin-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-ping-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  opacity: 0.25;
  animation: marker-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.marker-inner-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 11px;
  transition: transform var(--transition);
}

.marker-inner-dot:hover {
  transform: scale(1.15);
}

@keyframes marker-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.25;
  }

  50% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Map Legend Overlay */
.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(18, 18, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  z-index: 1000;
  font-size: 0.8rem;
  max-width: 260px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}

[data-theme="light"] .map-legend {
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a2e;
}

/* Elegant Minimized State */
.map-legend.minimized {
  width: 44px;
  height: 44px;
  max-width: 44px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  bottom: 20px;
  right: 20px;
  left: auto !important;
  /* Prevents spanning the whole bottom width on mobile */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.map-legend.minimized:hover {
  transform: scale(1.1);
  background: var(--accent);
  border-color: var(--accent-light);
}

.map-legend.minimized:hover .legend-title i {
  color: #fff !important;
  transform: rotate(15deg);
}

.map-legend.minimized .legend-header {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.map-legend.minimized .legend-title {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 0 !important;
  /* Collapses any anonymous text/whitespace nodes to 0 */
  line-height: 0 !important;
}

.map-legend.minimized .legend-title-text {
  display: none !important;
}

.map-legend.minimized .legend-title i {
  font-size: 1.1rem !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  transition: all 0.3s ease;
}

.map-legend.minimized .legend-toggle-btn {
  display: none !important;
}



.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  cursor: pointer;
}

.legend-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
}

.legend-toggle-btn:hover {
  color: var(--text);
}

.legend-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: max-height var(--transition), opacity var(--transition);
  overflow: hidden;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.legend-line {
  width: 20px;
  display: inline-block;
  vertical-align: middle;
}

.legend-line.line-dashed {
  height: 0;
  border-top: 3px dashed var(--line-color, #f59e0b);
}

.legend-line.line-dotted {
  height: 0;
  border-top: 3px dotted var(--line-color, #4fc3f7);
}

.legend-line.line-ferry {
  height: 0;
  border-top: 3px dashed var(--line-color, #2ec4b6);
}

/* Animations UI classes */
.btn-animation-stop {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #ef4444 !important;
}

.btn-animation-stop:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

@media (max-width: 768px) {
  .map-card-wrapper {
    padding: 16px;
  }

  .map-element {
    height: 580px;
  }

  .map-legend {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Active day card selection styling */
.itinerary-day-card {
  cursor: pointer;
}

.itinerary-day-card.active-day {
  border-color: var(--accent) !important;
  background: rgba(255, 107, 53, 0.06) !important;
  box-shadow: var(--shadow-card), 0 0 0 1px var(--accent) !important;
}

/* --- Split-Screen Map Explorer Sidebar --- */
.map-explorer-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Elegant App Footer */
.app-footer {
  width: 100%;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: rgba(18, 18, 30, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 80px;
  text-align: center;
  position: relative;
  z-index: 10;
}

[data-theme="light"] .app-footer {
  background: rgba(255, 255, 255, 0.45);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-footer span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-faint) !important;
  letter-spacing: 0.06em;
  transition: all var(--transition);
  display: inline-block;
  cursor: pointer;
}

.app-footer span:hover {
  color: var(--accent) !important;
  transform: scale(1.03) translateY(-1px);
  text-shadow: 0 0 8px var(--accent-glow);
}

/* Premium Map Header Replication */
.custom-map-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
}

.map-header-badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.map-header-badge {
  background: var(--accent);
  /* Premium brand accent blue/violet */
  color: #ffffff !important;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 10px rgba(255, 107, 53, 0.2);
  display: inline-block;
}

.map-header-dates {
  font-size: 0.88rem;
  color: var(--text-faint);
  font-weight: 500;
}

.map-header-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin: 4px 0 0 0 !important;
  letter-spacing: -0.02em;
}

.map-header-path {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0 !important;
  letter-spacing: 0.02em;
}

/* Map controls layout row */
.map-controls-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

@media (min-width: 992px) {
  .map-controls-row {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }
}

/* Compact elegant play button */
.btn-animate-route {
  width: 100%;
  background: var(--accent);
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.25);
  transition: all var(--transition);
}

@media (min-width: 992px) {
  .btn-animate-route {
    width: auto;
  }
}

.btn-animate-route:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.35);
}

.btn-animate-route:active {
  transform: translateY(0);
}

.btn-animate-route i {
  font-size: 0.85rem;
}

.map-popup-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}

.map-popup-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.map-popup-toggle:hover {
  color: var(--text);
}

@media (min-width: 992px) {
  .map-popup-toggle {
    display: inline-flex;
  }
}

/* --- Map Re-center Button --- */
.map-recenter-btn {
  position: absolute;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(18, 18, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-card);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="light"] .map-recenter-btn {
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a2e;
}

.map-recenter-btn i {
  font-size: 1.1rem;
  color: var(--accent-light);
  transition: color var(--transition);
}

.map-recenter-btn:hover {
  background: var(--accent);
  border-color: var(--accent-light);
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.map-recenter-btn:hover i {
  color: #ffffff;
}

.map-recenter-btn:active {
  transform: scale(0.95);
}

/* Sibling positioning relative to Legend minimized/maximized state */
.map-legend.minimized+.map-recenter-btn {
  bottom: 78px;
  /* Offset just above the minimized circle (20px + 44px + 14px padding) */
}

.map-legend:not(.minimized)+.map-recenter-btn {
  bottom: 380px;
  /* Offset just above the maximized card */
}

.map-legend.minimized+.map-recenter-btn+.map-gps-btn {
  bottom: 136px;
  /* Offset 58px above the recenter button in minimized state */
}

.map-legend:not(.minimized)+.map-recenter-btn+.map-gps-btn {
  bottom: 438px;
  /* Offset 58px above the recenter button in maximized state */
}

/* Responsive override for mobile */
@media (max-width: 768px) {
  .map-legend.minimized+.map-recenter-btn {
    bottom: 78px;
  }

  .map-legend:not(.minimized)+.map-recenter-btn {
    bottom: 380px;
  }

  .map-legend.minimized+.map-recenter-btn+.map-gps-btn {
    bottom: 136px;
  }

  .map-legend:not(.minimized)+.map-recenter-btn+.map-gps-btn {
    bottom: 438px;
  }
}

/* --- Pulsing GPS Location Dot --- */
.gps-custom-icon {
  background: transparent !important;
  border: none !important;
}

.gps-pulsing-dot {
  width: 14px;
  height: 14px;
  background-color: #007aff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 122, 255, 0.6);
  position: relative;
}

.gps-pulsing-dot::after {
  content: '';
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(0, 122, 255, 0.25);
  position: absolute;
  top: -11px;
  left: -11px;
  animation: gpsPulse 2s infinite ease-out;
}

@keyframes gpsPulse {
  0% {
    transform: scale(0.5);
    opacity: 1;
  }

  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* --- Memories Leaflet Pins --- */
.memory-leaflet-icon {
  background: transparent !important;
  border: none !important;
}

.memory-pin-wrapper {
  transform: scale(0.9);
  transition: all var(--transition);
}

.memory-pin-wrapper:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

.memory-inner-dot {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50%;
  border: 1.5px solid #ffffff !important;
  box-shadow: 0 0 10px var(--amber-glow) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.memory-inner-dot i {
  font-size: 0.65rem !important;
  color: #ffffff !important;
}

/* --- Homepage View & Trips Grid --- */
.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 16px;
}

.trip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  height: 100%;
  cursor: pointer;
}

.trip-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--accent-glow);
}

.trip-card.is-archived {
  opacity: 0.55;
  filter: grayscale(0.9);
  transition: opacity var(--transition), filter var(--transition), transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.trip-card.is-archived:hover {
  opacity: 0.85;
  filter: grayscale(0.3);
}

.trip-card-image-wrapper {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.trip-card:hover .trip-card-image {
  transform: scale(1.05);
}

.trip-card-image-fallback {
  text-align: center;
  color: var(--accent-light);
  font-size: 3.5rem;
  opacity: 0.65;
  transition: transform var(--transition);
}

.trip-card:hover .trip-card-image-fallback {
  transform: scale(1.1);
}

.trip-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(11, 12, 22, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trip-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.trip-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text);
  transition: color var(--transition);
}

.trip-card:hover .trip-card-title {
  color: var(--accent-light);
}

.trip-card-dates {
  font-size: 0.78rem;
  color: var(--text-faint);
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trip-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.trip-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
}

.trip-card-origin {
  font-size: 0.78rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Support Page Components --- */
.section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.gradient-text {
  color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-glow);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--accent-glow);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  transition: color var(--transition);
}

.project-card:hover h3 {
  color: var(--accent-light);
}

.project-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.project-card .arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 1.1rem;
  color: var(--text-faint);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: all 0.3s ease;
}

.project-card:hover .arrow {
  opacity: 1;
  transform: translate(0, 0);
  color: var(--accent-light);
}

.project-card-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Premium Auth & Sharing UI --- */
.auth-container {
  display: flex;
  align-items: center;
  margin-right: 12px;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.25);
  transition: all var(--transition);
}

.user-avatar:hover {
  transform: scale(1.08);
  border-color: var(--accent2);
}

.user-profile-menu .logout-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  height: 28px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.user-profile-menu .logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}

.private-barrier {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 500px;
  margin: 120px auto;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.private-barrier-icon {
  font-size: 3.5rem;
  margin-bottom: 24px;
  animation: float 4s ease-in-out infinite;
}

.pulse-icon {
  display: inline-block;
  animation: pulse-grow 2s infinite;
}

@keyframes pulse-grow {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

.share-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.share-list-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-faint);
}

/* Floating Actions & Buttons UI fixes */
.admin-banner-actions .btn {
  font-size: 0.72rem;
  height: 28px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}

.btn-xs {
  font-size: 0.72rem;
  height: 28px;
  padding: 0 10px;
}

/* --- Hamburger Action Dropdown --- */
.dropdown-menu-list {
  animation: slideDownMenu 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownMenu {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-item {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted) !important;
  padding: 10px 16px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--surface) !important;
  color: var(--accent) !important;
  padding-left: 18px;
  /* Micro-interaction reveal */
}

.dropdown-item .icon {
  font-size: 0.95rem;
  opacity: 0.8;
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* --- Edit Mode Exit Button Style --- */
#exit-edit-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 6px 18px !important;
  height: 32px !important;
  border-radius: 0;
  box-shadow: none;
  transition: all var(--transition);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

#exit-edit-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: none;
  transform: translateY(-1px);
}

#exit-edit-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
}

#hamburger-wrapper.is-logged-out {
  display: none;
}

#mobile-create-trip-btn {
  display: none !important;
}

/* --- Trips Section Header & Title styling --- */
.trips-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
}

.trips-section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  white-space: nowrap;
}

.trip-count-badge {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-weight: 400;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: nowrap;
}

/* --- Trip Card Role Badges --- */
.trip-card-role-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all var(--transition);
  background: #11111b !important;
  /* Completely opaque dark base to prevent clashing with background images */
}

.role-owner {
  border: 1px solid #7c6af7 !important;
  color: #a597ff !important;
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.25) !important;
}

.role-collaborator {
  border: 1px solid #34d399 !important;
  color: #34d399 !important;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.2) !important;
}

.role-viewer {
  border: 1px solid #4fc3f7 !important;
  color: #4fc3f7 !important;
  box-shadow: 0 0 12px rgba(79, 195, 247, 0.2) !important;
}

.role-public {
  border: 1px solid #f59e0b !important;
  color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
}

.role-bookmarked {
  border: 1px solid #f59e0b !important;
  color: #f59e0b !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2) !important;
}

/* --- Dynamic Hero Badges & Action Buttons --- */
.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 24px;
  align-items: center;
}

.hero-dates-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-light);
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.35);
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.08);
}

.hero-dates-pill i {
  font-size: 0.95rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Visibility status pills */
.hero-pill.pill-public {
  background: rgba(52, 211, 153, 0.1) !important;
  border: 1px solid rgba(52, 211, 153, 0.35) !important;
  color: #34d399 !important;
}

.hero-pill.pill-private {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #ef4444 !important;
}

/* Route type pills */
.hero-pill.pill-round {
  background: rgba(79, 195, 247, 0.1) !important;
  border: 1px solid rgba(79, 195, 247, 0.35) !important;
  color: #4fc3f7 !important;
}

.hero-pill.pill-oneway {
  background: rgba(245, 158, 11, 0.1) !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #f59e0b !important;
}

/* Custom Select Pill style for interactive visibility dropdown */
.hero-pill.hero-pill-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2334d399' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 6px center !important;
  background-size: 16px !important;
  padding-right: 24px !important;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 20px;
  outline: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--transition);
}

.hero-pill.hero-pill-select.pill-private {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%23ef4444' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") !important;
  background-repeat: no-repeat !important;
}

.hero-pill.hero-pill-select option {
  background: var(--bg2);
  color: var(--text);
  font-weight: normal;
}

/* Interactive checkbox switches inside the hero edit mode */
.hero-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid rgba(255, 107, 53, 0.35);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--transition);
}

.hero-pill-toggle:hover {
  background: rgba(255, 107, 53, 0.18);
  border-color: rgba(255, 107, 53, 0.5);
  transform: scale(1.03);
}

.hero-pill-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
}

/* --- Glassmorphic Hero Action Buttons --- */
.btn-glass {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  padding: 8px 16px !important;
  height: 34px !important;
  border-radius: var(--radius-sm) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
}

.btn-glass-active {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  padding: 8px 16px !important;
  height: 34px !important;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition) !important;
  box-shadow: none !important;
}

.btn-glass-active:hover {
  background: var(--accent-light) !important;
  border-color: var(--accent-light) !important;
  transform: translateY(-1px) !important;
  box-shadow: none !important;
}

/* Custom color modifiers for glass buttons */
.btn-glass-edit {
  background: rgba(255, 107, 53, 0.12) !important;
  border: 1px solid rgba(255, 107, 53, 0.4) !important;
  color: #c3baff !important;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.1) !important;
}

.btn-glass-edit:hover {
  background: rgba(255, 107, 53, 0.22) !important;
  border-color: rgba(255, 107, 53, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.25) !important;
}

.btn-glass-share {
  background: rgba(52, 211, 153, 0.12) !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
  color: #34d399 !important;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.1) !important;
}

.btn-glass-share:hover {
  background: rgba(52, 211, 153, 0.22) !important;
  border-color: rgba(52, 211, 153, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.25) !important;
}

.btn-glass-memory {
  background: rgba(253, 121, 168, 0.12) !important;
  border: 1px solid rgba(253, 121, 168, 0.4) !important;
  color: #ff9fb8 !important;
  box-shadow: 0 4px 15px rgba(253, 121, 168, 0.1) !important;
}

.btn-glass-cost {
  background: rgba(251, 191, 36, 0.12) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  color: #fcd34d !important;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.1) !important;
}

.btn-glass-cost:hover {
  background: rgba(251, 191, 36, 0.22) !important;
  border-color: rgba(251, 191, 36, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.25) !important;
}

/* --- Light Mode overrides for Glass Buttons --- */
[data-theme="light"] .btn-glass {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: var(--text) !important;
}

[data-theme="light"] .btn-glass:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.22) !important;
}

[data-theme="light"] .btn-glass-edit {
  background: rgba(0, 78, 152, 0.06) !important;
  border-color: rgba(0, 78, 152, 0.25) !important;
  color: #004e98 !important;
  box-shadow: 0 4px 15px rgba(0, 78, 152, 0.05) !important;
}

[data-theme="light"] .btn-glass-edit:hover {
  background: rgba(0, 78, 152, 0.12) !important;
  border-color: rgba(0, 78, 152, 0.45) !important;
  color: #004e98 !important;
}

[data-theme="light"] .btn-glass-share {
  background: rgba(5, 150, 105, 0.06) !important;
  border-color: rgba(5, 150, 105, 0.25) !important;
  color: #059669 !important;
  box-shadow: 0 4px 15px rgba(5, 150, 105, 0.05) !important;
}

[data-theme="light"] .btn-glass-share:hover {
  background: rgba(5, 150, 105, 0.12) !important;
  border-color: rgba(5, 150, 105, 0.45) !important;
  color: #059669 !important;
}

[data-theme="light"] .btn-glass-memory {
  background: rgba(219, 39, 119, 0.06) !important;
  border-color: rgba(219, 39, 119, 0.25) !important;
  color: #db2777 !important;
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.05) !important;
}

[data-theme="light"] .btn-glass-memory:hover {
  background: rgba(219, 39, 119, 0.12) !important;
  border-color: rgba(219, 39, 119, 0.45) !important;
  color: #db2777 !important;
}

[data-theme="light"] .btn-glass-cost {
  background: rgba(180, 83, 9, 0.06) !important;
  border-color: rgba(180, 83, 9, 0.25) !important;
  color: #b45309 !important;
  box-shadow: 0 4px 15px rgba(180, 83, 9, 0.05) !important;
}

[data-theme="light"] .btn-glass-cost:hover {
  background: rgba(180, 83, 9, 0.12) !important;
  border-color: rgba(180, 83, 9, 0.45) !important;
  color: #b45309 !important;
}

/* --- Google Sign-In Container Polish --- */
#google-signin-btn,
#error-google-signin-btn,
#welcome-google-signin-btn {
  display: inline-block;
  min-height: 40px;
  vertical-align: middle;
  transition: all var(--transition) !important;
  color-scheme: dark !important;
}

#google-signin-btn:hover,
#error-google-signin-btn:hover,
#welcome-google-signin-btn:hover {
  transform: translateY(-1px) !important;
}

/* Force browser to render Google iframe background transparently under dark-mode user-agent */
#google-signin-btn iframe,
#error-google-signin-btn iframe,
#welcome-google-signin-btn iframe,
iframe {
  background: transparent !important;
  color-scheme: light !important;
}

#google-signin-btn.is-logged-in {
  display: none !important;
}

/* Crew Members in Hero */
.crew-member:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
  border-color: var(--accent) !important;
}

/* --- Logged Out Home View Scroll & Centering Optimization --- */
body.logged-out-home {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.logged-out-home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Fallback scrolling for exceptionally small/landscape screens */
  justify-content: center;
}

body.logged-out-home #homepage-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: calc(var(--nav-height) + 12px) !important;
  padding-bottom: 24px !important;
  min-height: min-content;
}

body.logged-out-home .homepage-trips-section {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.logged-out-home .app-footer {
  margin-top: auto !important;
  padding: 16px 0 !important;
  background: transparent !important;
  border-top: none !important;
}

/* ============================================================
   Day Management UI Styles
   ============================================================ */

/* Location Selector Card Buttons in Modal */
.location-select-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.location-select-box:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
}

.location-select-box.active {
  background: rgba(255, 107, 53, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.25);
}

.location-select-indicator {
  font-size: 1.25rem;
}

.location-select-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.location-select-box.active .location-select-label {
  color: var(--accent-light);
}

.location-select-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Sidebar Mini Add Day Floating Connector Divider */
.mini-add-day-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  margin: 6px 0;
  position: relative;
  cursor: pointer;
  opacity: 0.65;
  transition: all var(--transition);
  z-index: 10;
}

.mini-add-day-btn::after {
  content: '';
  position: absolute;
  left: 32px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  transform: scaleY(1.0);
  transition: transform var(--transition);
}

.mini-add-day-btn:hover {
  opacity: 1;
}

.mini-add-day-btn i {
  position: absolute;
  left: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.4);
  transform: scale(0.85);
  transition: transform var(--transition);
}

.mini-add-day-btn:hover i {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.7);
}

.mini-add-day-btn:hover::after {
  transform: scaleY(1.5);
}

/* Timeline Horizontal Add Day Connector Divider */
.timeline-add-day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin: 14px 0;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-add-day-divider::before {
  content: '';
  position: absolute;
  left: 60px;
  right: 0;
  height: 1px;
  border-top: 1px dashed var(--border);
  opacity: 0.5;
  transition: all var(--transition);
}

.timeline-add-day-divider:hover::before {
  border-top: 1px solid var(--accent);
  opacity: 0.9;
}

.timeline-add-day-btn {
  position: relative;
  background: rgba(18, 16, 35, 0.9);
  border: 1px dashed var(--accent);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.8;
  transform: scale(1.0);
  box-shadow: var(--shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 5;
}

.timeline-add-day-divider:hover {
  height: 44px;
  margin: 14px 0;
}

.timeline-add-day-divider:hover .timeline-add-day-btn {
  opacity: 1;
  border-style: solid;
  color: var(--text);
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.4);
}

.timeline-add-day-btn:hover {
  background: var(--accent);
  color: #fff;
  border-style: solid;
}

@media (max-width: 768px) {
  .mini-add-day-btn {
    display: none !important;
  }
}

/* Sticky Action Header Bar below Main Nav */
.trip-actions-bar {
  position: sticky;
  top: var(--nav-height);
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(18, 16, 35, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 990;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

/* Light theme support */
[data-theme="light"] .trip-actions-bar {
  background: rgba(245, 245, 247, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.trip-actions-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

@media (max-width: 576px) {
  .trip-actions-bar {
    height: 48px;
  }
}

/* Multi-Transit Edit Mode Row Styles */
.modal-transit-row {
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.modal-transit-row:hover {
  border-color: rgba(255, 107, 53, 0.25);
  background: rgba(255, 107, 53, 0.02);
}

.btn-delete-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-delete-row:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  transform: scale(1.1);
}

[data-theme="light"] .modal-transit-row {
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.01);
}

[data-theme="light"] .modal-transit-row:hover {
  border-color: rgba(255, 107, 53, 0.2);
  background: rgba(255, 107, 53, 0.03);
}

/* Modal Activity Rows */
.modal-activity-row:hover {
  border-color: rgba(255, 107, 53, 0.25) !important;
  background: rgba(255, 107, 53, 0.02) !important;
}

[data-theme="light"] .modal-activity-row {
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  background: rgba(0, 0, 0, 0.01) !important;
}

[data-theme="light"] .modal-activity-row:hover {
  border-color: rgba(255, 107, 53, 0.2) !important;
  background: rgba(255, 107, 53, 0.03) !important;
}

/* Drag-and-drop styles for activities */
.activity-drag-handle {
  cursor: grab;
  opacity: 0.35;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  color: var(--text-muted);
  touch-action: none;
}

.activity-drag-handle:hover {
  opacity: 0.95;
  color: var(--accent);
}

.activity-drag-handle:active {
  cursor: grabbing;
}

/* SortableJS states */
.sortable-ghost {
  opacity: 0.4 !important;
  border: 1px dashed var(--accent) !important;
  background: rgba(255, 107, 53, 0.05) !important;
  box-shadow: none !important;
}

.sortable-chosen {
  background: rgba(255, 107, 53, 0.04) !important;
  border-color: var(--accent) !important;
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  transition: none !important;
  touch-action: none !important;
}

.sortable-drag {
  opacity: 0.95 !important;
  transition: none !important;
  pointer-events: none !important;
  touch-action: none !important;
}

/* Position leaflet popups at the upper-left of the map container to prevent obscuring markers */
.leaflet-popup-top-fixed {
  position: absolute !important;
  top: 16px !important;
  left: 16px !important;
  transform: none !important;
  bottom: auto !important;
  margin: 0 !important;
  z-index: 1000 !important;
}

.leaflet-popup-top-fixed .leaflet-popup-tip-container {
  display: none !important;
}

/* --- Active Travel Awareness Styles --- */
.trip-card-active-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--green);
  color: #ffffff;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 5px 0;
  z-index: 15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.active-pulse-dot-white {
  width: 6px;
  height: 6px;
  background-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #ffffff;
  animation: pulse-active-white 1.5s infinite ease-in-out;
}

@keyframes pulse-active-white {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Push role badge and duration badge down to avoid overlap with the top banner overlay */
.trip-card.is-active .trip-card-role-badge,
.trip-card.is-active .trip-card-badge {
  top: 38px !important;
}

.active-pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-active 1.5s infinite ease-in-out;
}

@keyframes pulse-active {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* --- Active Trip Banner --- */
.trip-active-banner {
  background: rgba(13, 13, 20, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  padding: 10px 0;
  display: flex;
  align-items: center;
  z-index: 980;
  transition: all var(--transition);
  position: sticky;
  top: calc(var(--nav-height) + 52px);
  cursor: pointer;
}

.trip-active-banner:hover {
  background: rgba(13, 13, 20, 0.85);
  border-bottom-color: rgba(16, 185, 129, 0.35);
}

[data-theme="light"] .trip-active-banner {
  background: rgba(245, 245, 247, 0.85);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .trip-active-banner:hover {
  background: rgba(240, 240, 243, 0.95);
  border-bottom-color: rgba(16, 185, 129, 0.25);
}

.active-banner-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  gap: 24px;
  flex-wrap: wrap;
}

.active-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.active-banner-text {
  font-size: 0.88rem;
  color: #a7f3d0; /* Soft green */
}

[data-theme="light"] .active-banner-text {
  color: #065f46; /* Dark green for readability in light mode */
}

.btn-active-banner-action {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #34d399 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 6px 14px !important;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1) !important;
  cursor: pointer;
}

.btn-active-banner-action:hover,
.trip-active-banner:hover .btn-active-banner-action {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: rgba(16, 185, 129, 0.6) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2) !important;
}

/* Light Mode Overrides for active banner button */
[data-theme="light"] .btn-active-banner-action {
  background: rgba(4, 120, 87, 0.08) !important;
  border: 1px solid rgba(4, 120, 87, 0.25) !important;
  color: #047857 !important;
  box-shadow: 0 4px 12px rgba(4, 120, 87, 0.05) !important;
}

[data-theme="light"] .btn-active-banner-action:hover,
[data-theme="light"] .trip-active-banner:hover .btn-active-banner-action {
  background: #047857 !important;
  border-color: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(4, 120, 87, 0.2) !important;
}

@media (max-width: 576px) {
  .active-banner-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
  }
  .active-banner-left {
    display: none;
  }
  .btn-active-banner-action {
    width: 100%;
    justify-content: center;
  }
}

#active-day-card-container .itinerary-day-card {
  cursor: default;
  margin-top: 10px;
}

#active-day-card-container .itinerary-day-card:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-card);
}

/* Fix double padding in trip details view where sticky actions bar and active banner push the hero down */
#trip-view .project-hero {
  padding-top: 60px;
}

@media (max-width: 768px) {
  #trip-view .project-hero {
    padding-top: 32px;
  }
  #trip-view .project-hero.no-cover {
    padding-top: 80px;
  }
  .trip-active-banner {
    position: sticky !important;
    top: calc(var(--nav-height) + 48px) !important;
  }
}

/* AI Summary Generator trigger button & modal custom styling */
#ai-summary-trigger-btn {
  transition: all var(--transition) !important;
}

#ai-summary-trigger-btn:hover {
  background: rgba(255, 107, 53, 0.15) !important;
  border-color: var(--accent) !important;
  color: var(--text) !important;
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.25) !important;
}

/* Quick View Submenu Navigation Tabs */
.trip-view-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 3px;
  gap: 2px;
  align-items: center;
  margin-right: auto;
}

[data-theme="light"] .trip-view-selector {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.view-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.view-selector-btn i {
  font-size: 0.9rem;
}

.view-selector-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .view-selector-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

.view-selector-btn.active {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.35);
  font-weight: 600;
}

[data-theme="light"] .view-selector-btn.active {
  box-shadow: 0 0 8px rgba(255, 107, 53, 0.25);
}

@media (max-width: 768px) {
}

@media (max-width: 576px) {
  .view-selector-btn {
    padding: 6px 10px;
    gap: 0;
  }
  .view-selector-btn .nav-text {
    display: none !important;
  }
}

/* --- Edit Mode Layout Adjustments --- */
body.edit-mode-active .admin-banner {
  top: calc(var(--nav-height) + 52px);
}

body.edit-mode-active #trip-view .project-hero {
  margin-top: 32px;
}

body.edit-mode-active .trip-active-banner {
  top: calc(var(--nav-height) + 52px + 32px) !important;
}

@media (max-width: 576px) {
  body.edit-mode-active .admin-banner {
    top: calc(var(--nav-height) + 48px);
  }
  body.edit-mode-active #trip-view .project-hero {
    margin-top: 32px;
  }
  body.edit-mode-active .trip-active-banner {
    top: calc(var(--nav-height) + 48px + 32px) !important;
  }
}

/* --- Mobile Quick Nav Button Overlap & Squeeze Fixes --- */
.view-selector-btn,
.trip-actions-right .btn {
  flex-shrink: 0 !important;
}

/* Remove default focus outlines to avoid browser-default rings */
button:focus,
button:focus-visible,
.btn:focus,
.btn:focus-visible,
.view-selector-btn:focus,
.view-selector-btn:focus-visible {
  outline: none !important;
}

/* Hide the redundant edit mode badge on all screens to avoid clutter and redundancy */
.trip-actions-left,
#actions-bar-edit-badge {
  display: none !important;
}

@media (max-width: 576px) {
  /* Reduce side padding for the sticky actions bar to fit all buttons on small screens */
  .trip-actions-bar .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

/* Move timeline item duration under time on mobile */
@media (max-width: 768px) {
  .day-timeline-duration-mobile {
    display: inline-flex !important;
  }
  .day-timeline-duration-desktop {
    display: none !important;
  }
}

/* Trip Import & Export Styles */
#import-dropzone:hover {
  border-color: var(--accent) !important;
  background: rgba(99, 102, 241, 0.04) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#import-dropzone {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top: 3px solid var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#import-preview-container::-webkit-scrollbar {
  width: 5px;
}
#import-preview-container::-webkit-scrollbar-track {
  background: transparent;
}
#import-preview-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
#import-preview-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Make import modal scrollable body obvious */
#import-modal-body {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.02);
}

#import-modal-body::-webkit-scrollbar {
  width: 6px;
  display: block;
}

#import-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

#import-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  border: 1px solid transparent;
}

#import-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* --- Walkthrough Tooltip --- */
.walkthrough-tooltip {
  position: absolute;
  top: -160px; /* Sits above the card */
  left: 50%;
  transform: translateX(-50%);
  width: 310px;
  max-width: calc(100vw - 32px);
  background: rgba(27, 38, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #38bdf8;
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
  padding: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  border-radius: 8px; /* Curved corners */
  animation: float-tooltip 3s infinite ease-in-out;
}

@keyframes float-tooltip {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -6px);
  }
}

/* Tooltip Arrow */
.walkthrough-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #38bdf8 transparent;
  display: block;
  width: 0;
  height: 0;
}

.walkthrough-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.walkthrough-tooltip-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.walkthrough-tooltip-close {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 2px;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.walkthrough-tooltip-close:hover {
  color: var(--danger);
}

.walkthrough-tooltip-body {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.walkthrough-tooltip-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.walkthrough-tooltip-btn {
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px; /* Curved button corners */
  transition: all var(--transition);
}

.walkthrough-tooltip-btn-primary {
  background: #0284c7;
  border: 1px solid #0284c7;
  color: var(--text);
}

.walkthrough-tooltip-btn-primary:hover {
  background: #0ea5e9;
  border-color: #0ea5e9;
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.walkthrough-tooltip-btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.walkthrough-tooltip-btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* Important Links Section Styles */
.links-card-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition);
}

.links-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.links-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.link-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  min-height: 72px;
}

.link-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--accent);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.08);
  transform: translateY(-2px);
}

.link-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  padding-right: 64px; /* Space for action buttons */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-item-url {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 64px;
}

.link-item-actions {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.link-item:hover .link-item-actions {
  opacity: 1;
}

.link-item-actions-visible {
  opacity: 1 !important;
}

.link-item-action-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
}

.link-item-action-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.link-item-action-btn.link-edit-btn:hover {
  color: var(--accent-light);
  border-color: var(--accent);
}

.link-item-action-btn.link-delete-btn:hover {
  color: #ef4444;
  border-color: #ef4444;
}

.links-empty-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* --- Day Details Modal Day Card Adaptation --- */
#day-details-modal .itinerary-day-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  width: 100%;
  max-width: 100%;
  flex: none;
  margin: 0;
  box-shadow: none;
  border: none;
  background: transparent;
  transform: none !important;
}

@media (max-width: 768px) {
  #day-details-modal .itinerary-day-card {
    grid-template-columns: 1fr !important;
  }
}

/* --- Dedicated Header Update App Button --- */
.header-update-btn {
  padding: 0 10px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
}

.header-update-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 107, 53, 0.08);
}

.header-update-btn.update-available {
  background: linear-gradient(135deg, var(--accent) 0%, #ff8555 100%) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 15px rgba(255, 107, 53, 0.55), 0 0 30px rgba(255, 107, 53, 0.25) !important;
  font-weight: 600;
  animation: updateBtnPulse 2.5s infinite ease-in-out;
}

.header-update-btn.update-available .header-update-icon {
  color: #ffffff !important;
  animation: updateSpin 3s linear infinite;
}

@keyframes updateBtnPulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.45), 0 0 25px rgba(255, 107, 53, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.75), 0 0 40px rgba(255, 107, 53, 0.4);
    transform: scale(1.04);
  }
}

@keyframes updateSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 576px) {
  .header-update-btn .header-update-text {
    display: none;
  }
  .header-update-btn {
    padding: 0 8px;
  }
}
