/* ══════════════════════════════════════════════
   NOCTAMBUS — PLAN.CSS
══════════════════════════════════════════════ */

.page-hero.plan-hero {
  background-image: url(/assets/Materials/Img/plan.png);
}

/* ════ Section carte ════ */
.plan-map-section {
  position: relative;
  width: calc(100% - 48px);
  max-width: 1650px;
  margin: 0 auto var(--sp-lg);
  height: calc(100vh - 80px);
  min-height: 600px;
  border-radius: 20px;
  overflow: hidden;
  background: #e8e6e2;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  border-radius: 20px;
}

/* ════ Widget flottant ════ */
.plan-widget {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  width: 400px;
  max-width: calc(100% - 40px);
  background: var(--clr-cream);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

/* ── Tabs ── */
.plan-tabs {
  display: flex;
  background: var(--clr-bg);
}

.plan-tab {
  flex: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.84rem;
  color: rgba(175, 175, 230, 0.5);
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--t-fast);
}

.plan-tab-picto {
  width: 24px;
  height: auto;
  filter: invert(60%) sepia(20%) saturate(300%) hue-rotate(200deg);
  transition: filter var(--t-fast);
}

.plan-tab-active,
.plan-tab.active {
  color: var(--clr-blanc) !important;
  border-bottom-color: var(--clr-orange);
  background: rgba(255, 255, 255, 0.05) !important;
}

.plan-tab-active .plan-tab-picto,
.plan-tab.active .plan-tab-picto {
  filter: invert(40%) sepia(90%) saturate(600%) hue-rotate(355deg) brightness(1);
}

.plan-tab:hover:not(.plan-tab-active):not(.active) {
  color: var(--clr-blanc);
}

/* ── Body ── */
.plan-body {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--clr-cream);
}

/* ── Fields wrap — même logique que hero-widget ── */
.plan-fields-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.plan-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-field-row:first-child {
  margin-bottom: 10px;
}

/* Badges A / B / Loc */
.plan-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--clr-blanc);
  flex-shrink: 0;
}

.plan-badge-a {
  background: var(--clr-bg);
}

.plan-badge-b {
  background: var(--clr-b3);
}

.plan-badge-loc {
  background: var(--clr-orange);
}

/* Input wrap */
.plan-input-wrap {
  flex: 1;
  position: relative;
  background: var(--clr-b2);
  border-radius: var(--r-full);
  padding: 12px 16px;
  transition: background var(--t-fast);
}

.plan-input-wrap:focus-within {
  background: var(--clr-b3);
}

.plan-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--clr-blanc);
}

.plan-input::placeholder {
  color: rgba(175, 175, 230, 0.55);
  font-weight: 400;
}

/* Swap — absolu entre les deux champs, à droite */
.plan-swap-row {
  position: relative;
  height: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  padding-right: 0;
}

.plan-swap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 80px;
  background: var(--clr-cream);
  border: 2px solid rgba(27, 0, 105, 0.18);
  color: var(--clr-orange);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  z-index: 5;
}

.plan-swap:hover {
  background: var(--clr-orange);
  border-color: var(--clr-orange);
}

.plan-swap:hover img {
  filter: brightness(0) invert(1) !important;
}

/* Autocomplete */
.plan-ac-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--clr-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  z-index: 200;
  display: none;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.plan-ac-drop.open {
  display: block;
}

.plan-ac-item {
  padding: 10px 16px;
  font-size: 0.84rem;
  color: var(--clr-muted);
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--t-fast), color var(--t-fast);
}

.plan-ac-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clr-orange);
  flex-shrink: 0;
}

.plan-ac-item:hover {
  background: rgba(253, 83, 18, 0.1);
  color: var(--clr-blanc);
}

/* Bouton recherche */
.plan-search-btn {
  background: var(--clr-orange);
  color: var(--clr-blanc);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--r-full);
  padding: 13px 20px;
  cursor: pointer;
  width: 100%;
  transition: background var(--t-fast);
  margin-top: 2px;
}

.plan-search-btn:hover {
  background: var(--clr-orange-dark);
}

/* ════ Résultats ════ */
.plan-results {
  border-top: 1px solid rgba(27, 0, 105, 0.1);
  background: var(--clr-cream);
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.plan-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(27, 0, 105, 0.08);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--clr-bg);
  gap: 8px;
}

.plan-results-summary span {
  color: rgba(27, 0, 105, 0.45);
  font-weight: 400;
}

.plan-results-nav {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(27, 0, 105, 0.06);
}

.plan-results-nav button {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--clr-orange);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Item résultat */
.route-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(27, 0, 105, 0.07);
  cursor: pointer;
  transition: background var(--t-fast);
}

.route-item:hover {
  background: rgba(27, 0, 105, 0.04);
}

.route-item.selected {
  background: #fff;
}

.route-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.route-time-start,
.route-time-end {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #1a1a1a;
  min-width: 46px;
}

.route-time-start small,
.route-time-end small {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  color: rgba(27, 0, 105, 0.4);
}

.route-time-end {
  text-align: right;
}

.route-line-track {
  flex: 1;
  height: 2px;
  background: #1a1a1a;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-badge-mid {
  display: flex;
  gap: 2px;
  align-items: center;
}

.route-meta {
  display: flex;
  gap: 12px;
  font-size: 0.74rem;
  color: rgba(27, 0, 105, 0.5);
  padding-left: 54px;
}

.route-meta i {
  color: var(--clr-orange);
  margin-right: 2px;
}

.route-detail-btn {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--clr-orange);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0 0 54px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Prochain départ rows */
.next-dep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(27, 0, 105, 0.07);
}

.next-dep-info {
  flex: 1;
  font-size: 0.84rem;
  color: rgba(27, 0, 105, 0.6);
  font-family: var(--font-body);
}

.next-dep-time {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--clr-orange);
}

/* ════ Popups événements ════ */
.event-popup {
  min-width: 200px;
  font-family: var(--font-body);
}

.event-popup-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
  display: block;
}

.event-popup-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.event-popup-meta {
  font-size: 0.74rem;
  color: rgba(27, 0, 105, 0.6);
  margin-bottom: 8px;
}

.event-popup-btn {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--clr-orange, #FD5312);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* ════ Leaflet overrides ════ */
.leaflet-control-zoom a {
  background: var(--clr-cream, #EEE8E2) !important;
  color: #1B0069 !important;
  border: 1px solid rgba(27, 0, 105, 0.2) !important;
}

.leaflet-popup-content-wrapper {
  background: #fff !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
}



.leaflet-popup-tip {
  background: #fff !important;
}

.leaflet-popup-close-button {
  color: #1a1a1a !important;
  font-size: 18px !important;
  padding: 6px 8px !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .plan-widget {
    width: calc(100% - 24px);
    left: 12px;
    top: 12px;
  }

  .plan-map-section {
    height: calc(100vh - 60px);
    width: 100%;
    border-radius: 0;
    margin: 0;
  }
}

/* ════ Animation pulse pour événements ════ */
@keyframes planEventPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(253, 83, 18, 0.55);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(253, 83, 18, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(253, 83, 18, 0);
  }
}

/* ════ Route item sélectionné ════ */
.route-item {
  background: var(--clr-cream);
  cursor: pointer;
}

.route-item.selected {
  background: #ffffff;
  box-shadow: inset 0 0 0 1.5px rgba(27, 0, 105, 0.12);
}

.route-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 2px;
  border-top: 1px solid rgba(27, 0, 105, 0.07);
  margin-top: 6px;
}

.route-detail-btn {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--clr-orange);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.route-alarm-btn {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(27, 0, 105, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.route-alarm-btn i {
  color: var(--clr-orange);
}

.route-delay {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(27, 0, 105, 0.4);
}

.route-delay.late {
  color: #C0392B;
}

/* ════ Detail timeline ════ */
.plan-detail-timeline {
  padding: 12px 16px 4px;
  position: relative;
}

/* Ligne verticale continue */
.plan-detail-timeline::before {
  content: '';
  position: absolute;
  left: calc(16px + 6px);
  /* padding + centre du dot (12px/2) */
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: var(--clr-b3, #6262CF);
  opacity: 0.25;
  z-index: 0;
}

.plan-dtl-stop {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.plan-dtl-stop.last .plan-dtl-content {
  padding-bottom: 4px;
}

.plan-dtl-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 12px;
  padding-top: 4px;
}

.plan-dtl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--clr-orange);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px var(--clr-orange);
  z-index: 2;
  flex-shrink: 0;
}

.plan-dtl-content {
  flex: 1;
  padding-bottom: 18px;
}

.plan-dtl-header {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.plan-dtl-time {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--clr-bg);
}

.plan-dtl-delay {
  font-size: 0.66rem;
  font-weight: 700;
  color: rgba(27, 0, 105, 0.4);
}

.plan-dtl-delay.late {
  color: #C0392B;
}

.plan-dtl-name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--clr-bg);
  flex: 1;
}

.plan-dtl-quai {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(27, 0, 105, 0.4);
}

.plan-dtl-segment {
  background: rgba(27, 0, 105, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 5px;
}

.plan-dtl-seg-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--clr-bg);
  font-weight: 600;
  margin-bottom: 3px;
}

.plan-dtl-seg-info {
  font-size: 0.72rem;
  color: rgba(27, 0, 105, 0.5);
  font-family: var(--font-body);
}

.plan-dtl-walk {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: rgba(27, 0, 105, 0.5);
  font-style: italic;
  padding: 5px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}