/* ===== ITINERARY PAGE ===== */

.itinerary-page {
  background: var(--bg);
  min-height: 100vh;
}

.itinerary-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 65px);
  max-width: 1280px;
  margin: 0 auto;
}

/* ─── Sidebar ─────────────────────────────────────────────────────── */

.itin-sidebar {
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 32px 24px;
  border-right: 1px solid rgba(26, 26, 46, 0.07);
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: var(--bg);
}

.itin-trip-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.itin-destination {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ocean);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.itin-dates {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.itin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.day-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.day-nav-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
}

.day-nav-item:hover,
.day-nav-item.active {
  background: var(--teal-soft);
}

.day-nav-num {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.day-nav-theme {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.35;
}

.btn-new-trip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: var(--accent-soft);
  color: var(--coral);
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-new-trip:hover {
  background: var(--coral);
  color: #fff;
  transform: translateY(-1px);
}

/* ─── Main itinerary area ─────────────────────────────────────────── */

.itin-main {
  padding: 48px 48px 80px;
  max-width: 860px;
}

.itin-header {
  margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(26, 26, 46, 0.07);
}

.itin-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--ocean);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 8px;
}

.itin-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
}

/* ─── Day sections ────────────────────────────────────────────────── */

.day-section {
  margin-bottom: 64px;
  scroll-margin-top: 80px;
}

.day-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 32px;
}

.day-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 8px 14px;
  background: var(--ocean);
  color: #fff;
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-top: 4px;
}

.day-theme {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ocean);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
}

.day-date-str {
  font-size: 0.875rem;
  color: var(--fg-muted);
}

/* ─── Activity cards ──────────────────────────────────────────────── */

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-card {
  display: grid;
  grid-template-columns: 32px 64px 32px 1fr 32px;
  align-items: flex-start;
  gap: 0 12px;
  padding: 20px 0;
  border-radius: 0;
  transition: background 0.15s ease, opacity 0.25s ease, transform 0.25s ease;
  position: relative;
  cursor: grab;
}

.activity-card:hover {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 20px 12px;
  margin: 0 -12px;
}

.activity-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.activity-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(26, 26, 46, 0.2);
  font-size: 0.9rem;
  letter-spacing: -2px;
  padding-top: 4px;
  user-select: none;
  cursor: grab;
  transition: color 0.15s ease;
}

.activity-card:hover .activity-drag-handle {
  color: var(--fg-muted);
}

.activity-time-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 2px;
}

.activity-time {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
}

.activity-time-end {
  font-size: 0.75rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

.activity-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 4px;
}

.connector-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2.5px solid var(--bg);
  box-shadow: 0 0 0 2px var(--teal);
  background: var(--teal);
  flex-shrink: 0;
  z-index: 1;
}

.connector-dot.food { box-shadow: 0 0 0 2px var(--coral); background: var(--coral); }
.connector-dot.transport { box-shadow: 0 0 0 2px var(--sand); background: var(--sand); }
.connector-dot.culture { box-shadow: 0 0 0 2px #9b59b6; background: #9b59b6; }
.connector-dot.outdoor { box-shadow: 0 0 0 2px #27ae60; background: #27ae60; }
.connector-dot.shopping { box-shadow: 0 0 0 2px var(--sand); background: var(--sand); }
.connector-dot.relaxation { box-shadow: 0 0 0 2px #3498db; background: #3498db; }

.connector-line {
  width: 2px;
  flex: 1;
  min-height: 40px;
  background: linear-gradient(to bottom, rgba(26,26,46,0.1), rgba(26,26,46,0.05));
  margin-top: 4px;
}

.activity-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 24px;
}

.activity-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--teal-soft);
  color: var(--teal);
  width: fit-content;
}

.activity-type-badge.type-food { background: var(--accent-soft); color: var(--coral); }
.activity-type-badge.type-transport { background: rgba(212, 165, 116, 0.15); color: #a07850; }
.activity-type-badge.type-culture { background: rgba(155, 89, 182, 0.1); color: #7d3c98; }
.activity-type-badge.type-outdoor { background: rgba(39, 174, 96, 0.1); color: #1e8449; }
.activity-type-badge.type-shopping { background: rgba(212, 165, 116, 0.15); color: #a07850; }
.activity-type-badge.type-relaxation { background: rgba(52, 152, 219, 0.1); color: #1a6fa8; }

.activity-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.activity-desc {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  max-width: 540px;
}

.activity-location {
  font-size: 0.85rem;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.location-icon {
  font-size: 0.75rem;
}

.activity-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: rgba(26,26,46,0.2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
  margin-top: 2px;
  flex-shrink: 0;
}

.activity-delete-btn:hover {
  background: var(--accent-soft);
  color: var(--coral);
}

/* ─── Add activity ────────────────────────────────────────────────── */

.add-activity-row {
  margin-top: 8px;
  padding-left: 140px;
}

.btn-add-activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px dashed rgba(26,26,46,0.15);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

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

.add-form {
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.add-input {
  width: 100%;
  padding: 10px 14px;
  background: #fff;
  border: 1.5px solid rgba(26,26,46,0.12);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s ease;
}

.add-input:focus {
  border-color: var(--teal);
}

.add-form-actions {
  display: flex;
  gap: 8px;
}

.btn-add-save {
  padding: 8px 20px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add-save:hover { background: #156358; }

.btn-add-cancel {
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid rgba(26,26,46,0.12);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-add-cancel:hover { background: var(--bg-alt); }

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .itinerary-layout {
    grid-template-columns: 1fr;
  }

  .itin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    border-right: none;
    border-bottom: 1px solid rgba(26,26,46,0.07);
  }

  .day-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    flex: none;
  }

  .day-nav-item {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
  }

  .day-nav-theme { display: none; }

  .itin-main {
    padding: 32px 24px 60px;
  }

  .add-activity-row {
    padding-left: 0;
  }

  .activity-card {
    grid-template-columns: 0 52px 28px 1fr 28px;
    gap: 0 8px;
  }

  .activity-drag-handle { display: none; }
}

@media (max-width: 600px) {
  .itin-main { padding: 24px 16px 60px; }
  .activity-card { grid-template-columns: 0 44px 24px 1fr 24px; }
  .itin-sidebar { padding: 16px; }
}
