.line-card {
  background: #ffeca1; 
  border: none;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  margin: 20px 0; 
  font-family: "Font Hradec", sans-serif;
  position: relative;
  box-sizing: border-box;
}


.button-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 20px; 
}

.button-container button {
  width: 150px;
  height: 36px !important;
  border-radius: 20px !important;
  padding: 2px !important;
  font-weight: 700 !important;
  border: none !important;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

#back-button:before {
  content: '';
  display: inline-block;
  margin-right: 20px;
  width: 20px;
  height: 20px;
  background-image: url('/wp-content/plugins/Spoje-vyhledavac/assets/styles/left.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
#ticket-button:after {
  content: '';
  display: inline-block;
  margin-left: 20px;
  width: 20px;
  height: 20px;
  background-image: url('/wp-content/plugins/Spoje-vyhledavac/assets/styles/right.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.info-text {
  text-align: left;
}


.transfer-count {
  font-weight: bold;
  font-size: 19px;
  text-decoration: underline;
  color: black;
  text-underline-offset: 15px;
  margin-bottom: 15px;
  text-align: left; 
}


.line-number {
  margin-top: 2%;
  color: #f7c601;
  background: black;
  display: inline-block;
  padding: 1.5% 2%;
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 20px;
}

.result-container {
  max-width: 500px;
  font-family: "Font Hradec", sans-serif;
}

.result-container h2 {
  font-weight: bold !important;
  text-align: center !important; 
}

#results {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
  align-items: flex-start; 
}




.line-body {
  display: flex;
  flex-direction: column;
  position: relative; 
}


.line-body::before {
  content: "";
  position: absolute;

  left: 6px; 

  top: 15px; 
  height: 100px; 
  width: 4px;
  background-color: #ee0000;
  border-radius: 2px;
  z-index: 0;
}


.line-part.is-last::after {
  content: "";
  position: absolute;
  left: 0;
  top: 15px; 
  bottom: -20px; 
  width: 20px; 
  background-color: #ffeca1; 
  z-index: 0;
}


.line-part {
  position: relative;
  min-height: 24px;
  margin-bottom: 25px; 
  z-index: 1;
}


.line-part:last-child {
  margin-bottom: 0;
}


.line-content-wrapper {
  display: flex;
  flex-wrap: wrap; 
  align-items: flex-start;
  padding-left: 35px; 
  gap: 10px;
}

.departure-stop,
.arrival-stop {
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
  position: relative;

}


.departure-stop::before,
.arrival-stop::before {
  content: "";
  position: absolute;

  left: -35px; 
  top: 4px; 
  width: 16px;
  height: 16px;
  background-color: #ee0000;
  border-radius: 50%;
  z-index: 2;
}


.map-action-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-icon {
  width: 20px;
  height: 20px;
}

button.map-show-btn {
  background: transparent !important;
  border: none !important;
  padding: 0;
  align-self: center;
  color: #ee0000 !important;
  text-decoration: underline !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  white-space: nowrap;
}

button.map-show-btn:hover {
  color: #810000 !important;
  background: transparent !important;
  text-decoration: none !important;
}


.route-info {
  margin-top: 15px;
  padding-top: 10px;
  text-align: left; 

}
.route_info p {
  margin: 10px 0;
}


.dynamic-map-row {
  max-height: 50%;
  position: relative;
  z-index: 5;
}

.dynamic-map-row {
  display: grid;
  grid-template-rows: 0fr; 
  transition: grid-template-rows 0.5s ease-in-out; 
  overflow: hidden;
  width: 100%;
  z-index: 5;
}


.dynamic-map-row.is-active {
  grid-template-rows: 1fr;
  margin-top: 15px;
  margin-bottom: 15px;
}


.map-container-wrapper {
  min-height: 0;
}


.map-container {
  height: 400px; 
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}


.line-card {
  background: #ffeca1; 
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  margin: 20px 0; 
  font-family: "Font Hradec", sans-serif;
  position: relative;
  box-sizing: border-box;
}

.line-body {
  display: flex;
  flex-direction: column;
  position: relative; 
}

// ZRUŠENO: .line-body::before (stará dlouhá čára)

.line-part {
  position: relative;
  min-height: 24px;
  margin-bottom: 25px; 
  z-index: 1;
}

// PUNTÍK (Zůstává)
.departure-stop::before,
.arrival-stop::before {
  content: "";
  position: absolute;
  left: -35px; 
  top: 4px; 
  width: 16px;
  height: 16px;
  background-color: #ee0000;
  border-radius: 50%;
  z-index: 5;
}

// NOVÁ SEGMENTOVÁ ČÁRA (Propojuje zastávky)
.line-part:not(.is-last)::after {
  content: "";
  position: absolute;
  left: -29px;
  top: 20px;
  bottom: -30px; 
  width: 4px;
  background-color: #ee0000;
  z-index: 1;
  transition: opacity 0.3s;
}

// SKRYTÍ ČÁRY PŘI OTEVŘENÉ MAPĚ
.line-part.map-opened::after {
  opacity: 0;
}

.line-content-wrapper {
  display: flex;
  flex-wrap: wrap; 
  align-items: flex-start;
  padding-left: 35px; 
  gap: 10px;
}


.dynamic-map-row {
  display: grid;
  grid-template-rows: 0fr; 
  transition: grid-template-rows 0.5s ease-in-out, margin 0.5s; 
  overflow: hidden;
  width: 100%;
  z-index: 10;
}

.dynamic-map-row.is-active {
  grid-template-rows: 1fr;
  margin-top: 15px;
  margin-bottom: 25px;
}

.map-container-wrapper {
  min-height: 0;
}

.map-container {
  height: 400px; 
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}



@media screen and (min-width: 1100px) {
  .result-container {
    max-width: 780px;
  }
}


@media screen and (max-width: 600px) {
  .line-content-wrapper {
    flex-direction: column; 
    align-items: flex-start;
    gap: 2px;
  }

  .map-action-container {

    margin-left: 0; 
    opacity: 0.9;
  }


  .departure-stop::before,
  .arrival-stop::before {
    top: 3px;
  }
}