html, body {
    font-family: 'Segoe UI', Arial, sans-serif;
    height: 100%;
    margin: 0;
    padding: 0; /* Good practice to remove padding too */
    overflow: hidden; /* Prevent scrolling on the body */
}

#map { 
    height: 100vh; 
}

#search-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(5px);
    padding: 10px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    font-family: inherit;
    max-width: 278.45px;
}
#train-search {
    padding: 4px 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}
#search-btn {
    padding: 4px 12px;
    font-size: 1em;
    border: none;
    background: #2196f3;
    color: white;
    border-radius: 4px 4px;
    cursor: pointer;
    font-family: inherit;
}
#search-btn:hover {
    background: #1769aa;
}

.train-circle {
    height: 16px;
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6em;
    font-weight: bold;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
    font-family: inherit;
    background-color: #707070;
    z-index: 10;

}

.container {
    transition: opacity 0.1s ease-in-out;
    font-family: inherit;
    height: 25px;
    width: 25px;
    display: flex;
    align-items: center;
}
.container.leaflet-hidden {
    opacity: 0;
}

.triangle {
    height: 16px;
    width: 16px;
    background: #242424;
    clip-path: polygon(37% 0, 90% 50%, 37% 100%, 0 100%, 0 0);
    margin-left: -10px;
    /* transform: rotate(0deg); change the rotation here e.g. 180deg or 90 deg */
    transform-origin: left center;
    z-index: 5;
}

/* Dropdown styles */
.dropdown {
    position: relative;
    font-family: inherit;
}
.btn {
    padding: 4px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
}
.options {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    padding: 8px;
    z-index: 2000;
    min-width: 160px;
    font-family: inherit;
}
.options label {
    display: block;
    margin: 4px 0;
    font-family: inherit;
}

#search-container #row {
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

#search-container #column {
    display: flex;
    flex-direction: column;
    /* gap: 8px; */
    width: 100%;
}
#expand-toggle {
    padding: 4px 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-family: inherit;

    user-select: none;
    text-align: center;
}
#expand-toggle span {
    margin: 0;
} 

#expanded-content {
    box-sizing: border-box;
    display: none; /* Set to block when toggled via JS */
    font-size: 0.9em;
    background: #fff;
    border-radius: 0px 0px 6px 6px;
    border-bottom: 1px solid #ccc;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.05); */
    width: 100%;
    max-width: 340px;
    text-align: left;
    font-family: inherit;
}


#add-favourite-container {
    border-bottom: 1px solid #ccc;

}
#favourite-list-scroll-container {
    font-size: 16px;
    height: 130px;
    overflow-x: wrap;
    overflow-y: auto;
}
#favourite-list-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 5px;
    /* margin-right: 0px; */
}

#expanded-content p {
    font-size: 16px;
    margin: 0;
    padding: 4px 12px;
}

#favourite-list-scroll-container::-webkit-scrollbar {
    /* Keep the border-radius on the corners if you like */
    border-radius: 0px 0px 6px 0px;
    width: 6px;
}

#favourite-list-scroll-container::-webkit-scrollbar-track {
    background: hsl(0, 0%, 100%); /* light grey background */
    border-radius: 0px 0px 5px 0px;
}

#favourite-list-scroll-container::-webkit-scrollbar-thumb {
  background-color: hsl(0, 0%, 91%); /* darker grey thumb */
  border-radius: 10px; /* The roundness of the thumb */

  /*
   * THIS IS THE KEY PART:
   * Create a 2px border around the thumb.
   * Make the border's color the SAME as the track's background color (#f4f4f4).
   * This creates the illusion of 2px of "padding".
  */
  border: 0px solid hsl(0, 0%, 100%);
}

#favourite-list-scroll-container::-webkit-scrollbar-thumb:hover {
  background-color: hsl(0, 0%, 76%);
}

#train-favourite-add {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 4px 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}
#train-favourite-add-btn {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 4px 12px;
    font-size: 1em;
    border: none;
    background: #2196f3;
    color: white;
    border-radius: 4px 4px;
    cursor: pointer;
    font-family: inherit;
}
#train-favourite-add-btn:hover {
    background: #1769aa;
}

#no-favourites-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    text-align: center;
    color: hsl(0, 0%, 73%);
    user-select: none;
    cursor: auto;
}


.favourite-train-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out;
}

.favourite-train-row-left {
    display: flex;
    flex-direction: row;
}

.favourite-train-indicator {
    height: 100%;
    width: 8px;
    border-radius: 4px 0px 0px 4px;
}
.in-service {
    background-color: hsl(130, 62%, 65%);
}
.not-in-service {
    background-color: hsl(0, 62%, 65%);
}

.favourite-train-row-right {
    gap: 12px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding-right: 8px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}


.favourite-train-row:hover .favourite-train-row-right {
    opacity: 1;
}
.favourite-train-row:hover {
    background-color: hsl(0, 0%, 97.5%);
    cursor: pointer;
}

.favourite-train-edit-button {
    width: 10px;
    height: 10px;
    font-size: 0.9em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.favourite-train-delete-button {
    width: 10px;
    height: 10px;
    font-size: 0.9em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.favourite-train-edit-button svg {
    display: block;
    width: 10px;
    height: 10px;
    fill: hsl(0, 0%, 50%);
}
.favourite-train-delete-button svg {
    display: block;
    width: 100%;
    height: 100%;
}

.favourite-train-edit-button path {
    stroke: hsl(0, 0%, 50%);
    fill: hsl(0, 0%, 97.5%);
    transition: fill 0.2s ease-in-out;
}

.favourite-train-delete-button path {
    fill: hsl(0, 0%, 50%);
    transition: fill 0.2s ease-in-out;
}

.favourite-train-delete-button:hover path {
    fill: rgb(217, 63, 63);
}


.favourite-train-edit-button:hover path {
    stroke: #2196f3;
}