/*
 * Copyright 2023 Google LLC
 * Licensed under the Apache License, Version 2.0
 * Adapted for Danton Medical Clinic travel-time estimates.
 */

.directions-hero {
  width: 100%;
  max-width: none;
  margin: 0 0 28px;
  padding: clamp(86px, 11vw, 130px) max(18px, calc((100vw - var(--max)) / 2)) 36px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(8, 18, 28, 0.82) 0%, rgba(8, 18, 28, 0.62) 48%, rgba(8, 18, 28, 0.28) 100%),
    url("../assets/heroes/danton-medical-hero.png") center center / cover no-repeat #0d1a24;
}

.directions-hero .eyebrow,
.directions-hero h1,
.directions-hero p {
  max-width: 720px;
  color: #fff;
}

.directions-hero p {
  color: rgba(255, 255, 255, 0.9);
}

.travel-wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto 64px;
}

.travel-time {
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(760px, calc(100vh - 88px));
  min-height: 560px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.travel-time [hidden],
.travel-modal[hidden],
.travel-modal [hidden] {
  display: none !important;
}

.travel-map {
  position: relative;
  flex: 1;
  min-height: 280px;
  background: #e5e3df;
}

.travel-map-loading,
.travel-map-error {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #3c4043;
  text-align: center;
}

.travel-map-error {
  background: #fff;
}

.travel-panel {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: #fff;
}

.travel-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 110px;
  margin: 8px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.travel-empty-copy {
  flex: 1;
  min-width: 0;
}

.travel-empty h2,
.travel-dialog h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}

.travel-empty p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.travel-add,
.travel-add-card,
.travel-edit,
.travel-directions,
.travel-scroll,
.travel-dialog button {
  font: inherit;
  cursor: pointer;
}

.travel-add {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 10px;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.travel-add svg,
.travel-add-card svg {
  fill: currentColor;
}

.travel-starts {
  position: relative;
}

.travel-starts-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  scrollbar-width: none;
}

.travel-starts-scroller::-webkit-scrollbar {
  display: none;
}

.travel-starts-list {
  display: flex;
  flex: 1;
  gap: 8px;
}

.travel-add-card {
  display: flex;
  flex: 1 0 156px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 156px;
  padding: 16px;
  color: var(--blue);
  background: var(--teal-soft);
  border: 1px solid var(--teal-soft);
  border-radius: 8px;
  font-weight: 700;
}

.travel-add-card:hover,
.travel-add:hover {
  filter: brightness(0.95);
}

.travel-card {
  position: relative;
  display: flex;
  flex: 1 0 280px;
  min-width: 280px;
  cursor: pointer;
}

.travel-card-body {
  width: 100%;
  min-height: 96px;
  padding: 12px 88px 12px 12px;
  color: #5f6368;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.travel-card.is-active .travel-card-body {
  box-shadow: inset 0 4px 0 #4285f4, 0 1px 2px rgba(60, 64, 67, 0.3);
}

.travel-card-meta,
.travel-card-address {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.travel-card-address span,
.travel-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.travel-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: currentColor;
}

.travel-card-label {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #616161;
  background: #f1f3f4;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.travel-card.is-active .travel-card-label {
  color: #d93025;
  background: #fce8e6;
}

.travel-card-eta {
  color: #202124;
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
}

.travel-card-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.travel-directions,
.travel-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  background: #fff;
  border: 1px solid #dadce0;
}

.travel-directions {
  width: 34px;
  height: 32px;
  border-radius: 32px;
}

.travel-card.is-active .travel-directions {
  color: #4285f4;
}

.travel-edit {
  gap: 2px;
  padding: 3px 10px 3px 6px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
}

.travel-card:hover .travel-edit,
.travel-card:focus-within .travel-edit,
.travel-card.is-active .travel-edit {
  opacity: 1;
}

.travel-scroll {
  position: absolute;
  top: 36px;
  z-index: 2;
  width: 40px;
  height: 40px;
  padding: 8px;
  color: #616161;
  background: #fff;
  border: 0;
  border-radius: 40px;
  box-shadow: 0 2px 3px rgba(60, 64, 67, 0.3), 0 6px 10px 4px rgba(60, 64, 67, 0.15);
}

.travel-scroll svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.travel-scroll-left {
  left: 8px;
}

.travel-scroll-right {
  right: 8px;
}

.travel-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
}

.travel-dialog {
  width: min(420px, 100%);
  padding: 24px 24px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.travel-dialog form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.travel-dialog input[type="text"] {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-sizing: border-box;
}

.travel-suggest-wrap {
  position: relative;
}

.travel-suggestions {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  margin: 0;
  padding: 4px 0;
  overflow: auto;
  list-style: none;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.travel-suggestions button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  color: #202124;
  text-align: left;
  background: transparent;
  border: 0;
}

.travel-suggestions button:hover,
.travel-suggestions button:focus {
  background: #f1f3f4;
}

.travel-dialog input.is-invalid {
  background: #fce4e4;
  border-color: #c03;
}

.travel-error {
  min-height: 16px;
  margin: 0;
  color: #c03;
  font-size: 12px;
  line-height: 16px;
}

.travel-modes {
  display: flex;
}

.travel-modes input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.travel-modes label {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: #5f6368;
  border: 1px solid #dadce0;
  cursor: pointer;
}

.travel-modes label svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.travel-modes label:first-of-type {
  border-radius: 4px 0 0 4px;
}

.travel-modes label:last-of-type {
  border-radius: 0 4px 4px 0;
}

.travel-modes input:checked + label {
  color: var(--blue);
  background: var(--teal-soft);
}

.travel-modes input:focus-visible + label {
  outline: 2px solid #1a73e8;
  outline-offset: -2px;
}

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

.travel-actions button {
  padding: 8px 12px;
  background: transparent;
  border: 0;
  font-weight: 700;
}

.travel-save {
  color: var(--blue);
}

.travel-cancel {
  color: #5f6368;
}

.travel-delete {
  margin-right: auto;
  color: #c5221f;
}

.pac-container {
  z-index: 3000;
}

@media (max-width: 640px) {
  .travel-empty h2 {
    font-size: 16px;
    line-height: 22px;
  }

  .travel-card,
  .travel-card-body {
    min-width: 240px;
  }

  .travel-edit {
    opacity: 1;
  }
}
