:root {
  /* Light, warm color palette */
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-hover: #f5f5f4;
  --text: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #78716c;
  --primary: #0d9488;
  --primary-light: #14b8a6;
  --primary-dark: #0f766e;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --border: #e7e5e4;
  --border-light: #f5f5f4;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-lg: 16px;
}

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

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

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================
   HEADER
   ============================================ */

header {
  margin-bottom: 2.5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-2px);
}

header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 400;
}

.trip-header-full {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.trip-header-full h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
}

.trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.trip-meta span {
  background: var(--bg);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border);
}

.trip-description-full {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 600px;
  margin-top: 1rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.7;
}

.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================
   TRIP CARDS
   ============================================ */

.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.trip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.trip-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.trip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.trip-card:hover::before {
  transform: scaleX(1);
}

.trip-card h2 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.trip-location {
  color: var(--text-muted);
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

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

.date-range {
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.875rem;
}

.duration {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trip-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.day-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.day-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
}

.day-number {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.day-date {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.timeline {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: flex;
  gap: 1.25rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-marker {
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-light);
  z-index: 1;
}

.timeline-content {
  flex: 1;
  padding-bottom: 1.5rem;
}

.timeline-item:last-child .timeline-content {
  padding-bottom: 0;
}

.activity-time {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.375rem;
}

.activity-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.activity-location {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.activity-location .map-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px dotted var(--primary-light);
}

.activity-location .map-link:hover {
  color: var(--primary-dark);
  border-bottom-style: solid;
}

.activity-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.activity-notes {
  color: var(--text-muted);
  font-size: 0.875rem;
  background: var(--bg);
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  line-height: 1.6;
}

.no-activities {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 2.5rem;
  font-size: 0.9375rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 1rem;
}

footer p {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ============================================
   HOMEPAGE STYLES
   ============================================ */

.homepage {
  max-width: 1200px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.homepage-header {
  text-align: center;
  padding: 3rem 2rem 2rem;
}

.homepage-title {
  font-size: 2.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.homepage-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 1rem 2rem 2rem;
  flex: 1;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-color, linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%));
  transform: scaleX(0);
  transition: transform 0.3s ease;
  transform-origin: left;
}

.app-card:hover::before {
  transform: scaleX(1);
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.app-card-placeholder {
  border-style: dashed;
  opacity: 0.5;
  cursor: default;
}

.app-card-placeholder:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.app-card-placeholder::before {
  display: none;
}

.app-icon {
  font-size: 3rem;
  line-height: 1;
}

.app-content {
  flex: 1;
}

.app-name {
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.app-description {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.app-arrow {
  font-size: 1.25rem;
  color: var(--primary);
  align-self: flex-end;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:hover .app-arrow {
  opacity: 1;
  transform: translateX(0);
}

.homepage-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

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

@media (max-width: 768px) {
  .container {
    padding: 1.25rem 1rem;
  }

  header h1 {
    font-size: 1.875rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .trip-header-full {
    padding: 1.5rem;
  }

  .trip-header-full h1 {
    font-size: 1.625rem;
  }

  .trip-meta {
    justify-content: flex-start;
  }

  .trips-grid,
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .trip-card,
  .app-card {
    padding: 1.5rem;
  }

  .day-header {
    padding: 1rem 1.25rem;
  }

  .day-number {
    width: 40px;
    height: 40px;
    font-size: 0.875rem;
  }

  .day-date {
    font-size: 1rem;
  }

  .timeline {
    padding: 1.25rem;
  }

  .timeline-item {
    gap: 1rem;
  }

  .activity-title {
    font-size: 1.0625rem;
  }

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

  .homepage-subtitle {
    font-size: 1rem;
  }
}

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

  .trip-dates {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .duration {
    align-self: flex-start;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.day-block {
  animation: fadeInUp 0.5s ease-out;
}

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

.trip-card {
  animation: fadeInUp 0.5s ease-out;
}

.trip-card:nth-child(2) { animation-delay: 0.1s; }
.trip-card:nth-child(3) { animation-delay: 0.2s; }
.trip-card:nth-child(4) { animation-delay: 0.3s; }

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
