@charset "UTF-8";

/* ==========================================================================
   Tokyo Walker — Trip Switcher UI Stylesheet
   All selectors strictly scoped to trip-prefixed IDs and classes.
   Preserves CSS variables and ensures min 44px touch targets without overflow.
   ========================================================================== */

#trip-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  min-height: 44px;
  max-width: 220px;
  box-sizing: border-box;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

#trip-switch:hover {
  background: var(--paper);
  border-color: var(--ink);
}

#trip-switch:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

#trip-switch:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-switch-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.trip-switch-chevron {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* --------------------------------------------------------------------------
   Dialog & Sheet Layout
   -------------------------------------------------------------------------- */

#trip-switch-dialog {
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: 90dvh;
  margin: auto;
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  overflow-x: hidden;
}

#trip-switch-dialog::backdrop {
  background: #17291f88;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.trip-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.trip-dialog-eyebrow {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.6;
  color: var(--muted);
}

.trip-dialog-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin: 4px 0 0;
}

.trip-close-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.trip-close-btn:hover {
  background: var(--cream);
}

.trip-close-btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.trip-close-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-close-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* --------------------------------------------------------------------------
   Error Alert
   -------------------------------------------------------------------------- */

.trip-error {
  padding: 11px 14px;
  background: #f2e0d7;
  color: #8a3428;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 4px;
  margin-bottom: 16px;
  border-left: 3px solid var(--red);
}

/* --------------------------------------------------------------------------
   Trip List & Choice Items
   -------------------------------------------------------------------------- */

.trip-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
  max-height: 46vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.trip-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--white);
}

.trip-item {
  width: 100%;
}

.trip-choice-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  gap: 12px;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.trip-choice-btn:hover {
  background: var(--cream);
  border-color: var(--ink);
}

.trip-choice-btn:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

.trip-choice-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-choice-btn.trip-current {
  border-color: var(--ink);
  background: var(--cream);
  border-width: 1.5px;
}

.trip-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.trip-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trip-item-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.trip-item-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.trip-item-dates {
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.3px;
}

.trip-item-arrow {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  padding-left: 4px;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.trip-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.trip-badge-current {
  background: var(--red);
  color: var(--white);
}

.trip-badge-pending {
  background: #f0e5d2;
  color: #80602a;
}

/* --------------------------------------------------------------------------
   Create Trip Section & Form
   -------------------------------------------------------------------------- */

.trip-actions-row {
  margin-top: 14px;
}

.trip-create-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.trip-create-toggle:hover {
  background: var(--cream);
  border-color: var(--ink);
}

.trip-create-toggle:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.trip-create-toggle:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-create-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.trip-field {
  margin-bottom: 14px;
}

.trip-field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.trip-field input {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.trip-field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.trip-field input:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trip-form-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.trip-btn-cancel,
.trip-btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
  border: 1px solid transparent;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.trip-btn-cancel {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.trip-btn-cancel:hover {
  background: var(--cream);
}

.trip-btn-cancel:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.trip-btn-cancel:disabled {
  opacity: 0.55;
  cursor: wait;
}

.trip-btn-save {
  background: var(--ink);
  color: var(--white);
}

.trip-btn-save:hover {
  background: #335348;
}

.trip-btn-save:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.trip-btn-save:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* --------------------------------------------------------------------------
   Mobile-First Responsive Adjustments (320px, 390px, 1440px)
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {
  #trip-switch-dialog {
    padding: 22px 18px;
    width: calc(100% - 24px);
    max-height: 91dvh;
  }

  .trip-dialog-title {
    font-size: 21px;
  }

  .trip-dialog-eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }

  .trip-field input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  }

  .trip-choice-btn {
    padding: 11px 12px;
  }

  .trip-item-title {
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  #trip-switch {
    max-width: 170px;
    padding: 6px 12px;
    font-size: 11px;
  }

  .trip-switch-title {
    max-width: 120px;
  }

  .trip-dates-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .trip-form-buttons {
    flex-direction: column-reverse;
  }

  .trip-btn-cancel,
  .trip-btn-save {
    width: 100%;
  }
}

@media (max-width: 330px) {
  #trip-switch-dialog {
    width: calc(100% - 12px);
    padding: 16px 12px;
  }

  #trip-switch {
    max-width: 130px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .trip-switch-title {
    max-width: 85px;
  }
}
