.lines-times-container {

    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 25px;

    .select-container {
        display: flex;
        flex-direction: row;
        gap: 10px;

        .select-container-line {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        select {
            /* Eliminar la apariencia por defecto de la flecha del navegador */
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;

            width: 300px;
            height: 52px;
            padding: 0px 30px 0px 5px;
            border-color: var(--primary-base);

            /* Insertar la imagen de la flecha */
            background-image: url('/modules/custom/tic_public_transport/assets/images/select-arrow.png');
            background-repeat: no-repeat;
            background-position: right 10px center;
            /* Posicionar la flecha a la derecha */
            background-size: 16px;
            /* Ajustar el tamaño de la flecha */
        }

        /* Eliminar la flecha por defecto de select en Internet Explorer */
        select::-ms-expand {
            display: none;
        }
    }

    .line-title {
        display: flex;
        border: 1px solid var(--neutral-light);
        border-radius: 4px;
        align-items: center;
        max-height: 54px;

        .line-number {
            background-color: var(--primary-base);
            padding: 8px;
            color: var(--white);
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
            font-size: 30px;
            font-weight: 700;
            min-width: 54px;
            text-align: center;
            height: 54px;
            display: flex;
            justify-content: center;
            align-items: center;
            white-space: nowrap
        }

        .line-text {
            padding: 4px 16px;
            width: 100%;
            font-size: 24px;
            font-weight: 700;
        }
    }

    .stops-map {
        display: flex;
        gap: 40px;

        .stops-list {
            width: 35%;
            display: flex;
            flex-direction: column;
            align-items: flex-end;

            .stops-container {
                display: flex;
                flex-direction: column;
                gap: 16px;

                .stop.origin .stop-name,
                .stop.destination .stop-name {
                    font-weight: 700;
                    font-size: 18px;
                    line-height: 28px;
                    color: var(--black);
                }

                .stop {
                    display: grid;
                    grid-template-columns: 6fr auto 1fr;
                    align-items: center;
                    gap: 8px;

                    /* NUEVOS ESTILOS PARA SELECCIÓN */
                    padding: 8px;
                    border-radius: 4px;
                    margin: 2px 0;
                    transition: all 0.3s ease;
                    cursor: pointer;

                    .stop-name {
                        text-align: right;
                        padding-right: 4px;
                        font-size: 14px;
                        color: var(--primary-base);
                        transition: color 0.3s ease;
                    }

                    .circle {
                        display: flex;
                        width: 28px;
                        height: 28px;
                        justify-content: center;
                        align-items: center;
                        border-radius: 50%;
                        border: 1px solid var(--primary-base);
                        position: relative;
                        transition: all 0.3s ease;
                        background-color: white;
                        z-index: 50;
                    }

                    .stop-id {
                        text-align: left;
                        padding-left: 4px;
                        font-weight: 700;
                        font-size: 14px;
                        color: var(--primary-base);
                        transition: color 0.3s ease;
                        min-width: 30px;
                    }
                }

                /* EFECTO HOVER PARA PARADAS INTERMEDIAS */
                .stop:hover {
                    background-color: rgba(0, 123, 255, 0.1);
                }

                /* ESTILOS PARA PARADA SELECCIONADA */
                .stop.selected {
                    .stop-name {
                        color: var(--primary-base);
                        font-weight: 700;
                    }

                    .stop-id {
                        color: var(--primary-base);
                        font-weight: 700;
                    }

                    .circle {
                        background-color: var(--primary-base);
                        border: 2px solid var(--primary-base);
                    }
                }

                /* LAS PARADAS ORIGEN Y DESTINO NO SON SELECCIONABLES */
                /* .stop.origin,
                .stop.destination {
                    cursor: default;
                } */

                /* .stop.origin:hover,
                .stop.destination:hover {
                    background-color: transparent;
                    transform: none;
                } */

                .stop:not(.stop.destination) .circle::after {
                    content: '';
                    position: absolute;
                    top: 103%;
                    left: 50%;
                    transform: translateX(-50%);
                    width: 2px;
                    height: 42px;
                    background-color: var(--neutral-light);
                    z-index: -1;
                    border-radius: 1px;
                }

                @media (max-width: 768px) {
                    .stop:not(.stop.destination) .circle::after {
                        content: '';
                        position: absolute;
                        top: 103%;
                        left: 50%;
                        transform: translateX(-50%);
                        width: 2px;
                        height: 65px;
                        background-color: var(--neutral-light);
                        z-index: -1;
                        border-radius: 1px;
                    }
                }
            }
        }

        /* NUEVO CONTENEDOR PARA MAPA Y HORARIOS */
        .map-and-schedules {
            padding: 16px;
            height: 100%;
            width: 65%;
            display: flex;
            flex-direction: column;

            .tabs {
                display: flex;

                .tab-button {
                    padding: 10px 20px;
                    cursor: pointer;
                    font-weight: 500;
                    color: #333;
                    border-top-left-radius: 3px;
                    border-top-right-radius: 3px;
                    position: relative;
                    top: 1px;
                    border: none;
                    border-bottom: 1px solid var(--neutral-dark);
                    background-color: var(--white);
                }

                .tab-button:hover {
                    background-color: #e6e6e6;
                }

                .tab-button.active {
                    border: 1px solid var(--neutral-dark);
                    background-color: var(--white);
                    color: #000;
                    border-bottom: 1px solid var(--white); /* Elimina la separación */
                    z-index: 2;
                }
            }

           .tab-content {
                display: none;
                padding: 15px;
                border: 1px solid var(--neutral-dark);
                border-radius: 0 0 6px 6px;
                background-color: #fff;
            }

            .tab-content.active {
                display: block;
            }

            #map {
                margin-bottom: 20px;

                .leaflet-routing-container {
                    display: none !important;
                }
            }

            .map-display {
                width: 100%;
            }

            /* ESTILOS PARA CONTAINER DE HORARIOS */
            .schedules-container {
                display: flex;
                justify-content: space-between;
                align-items: center;
                gap: 8px;
                flex-wrap: wrap;

                h3 {
                    margin: 0 0 16px 0;
                    font-size: 18px;
                    font-weight: 700;
                    color: var(--black);
                    border-bottom: 2px solid var(--primary-base);
                    padding-bottom: 8px;
                }

                .schedule-item {
                    width: 100%;

                    .schedule-line-row {
                        display: flex;
                        justify-content: space-between;
                        margin-bottom: 10px;

                        .schedule-line {
                            display: flex;
                            align-items: center;
                            gap: 10px;
                            transition: background-color 0.2s ease;
                            border-style: solid;
                            border-color: #EDEDEC;
                            min-height: 46px;
                            flex: 0 0 100%;
                            border-radius: 4px;

                            .line-id {
                                background-color: var(--primary-base);
                                color: var(--white);
                                padding: 8px;
                                border-radius: 4px 0 0 4px;
                                font-weight: 700;
                                font-size: 12px;
                                min-width: fit-content;
                                min-height: 100%;
                                text-align: center;
                                display: flex;
                                justify-content: center;
                                align-items: center;
                            }

                            .destination-name {
                                flex: 1;
                                font-size: 12px;
                                color: var(--black);
                                font-weight: 700;
                                white-space: nowrap;
                                overflow: hidden;
                                text-overflow: ellipsis;
                            }

                            .arrival-time {
                                font-size: 18px;
                                font-weight: 400;
                                color: var(--black);
                                min-width: 50px;
                                text-align: right;
                                padding-right: 8px;

                                .icon-pmr {
                                    color: var(--primary-base);
                                    margin-left: 4px;
                                }

                                .icon-demand {
                                    color: var(--primary-base);
                                    margin-left: 4px;
                                }
                            }
                        }
                    }
                }
            }

            #schedules-tab {

                .date-selector {

                    #select-date {
                        border-radius: 8px;
                        color: var(--white);
                        background-color: var(--primary-base);
                        border: none;
                        padding: 3px 20px;
                    }
                }

                .text {
                    margin: 10px 0px;
                }

                .timetable {
                    display: flex;

                    .timetable table {
                        width: 50%;
                        margin: 0;
                        border-collapse: collapse;
                    }
                }
            }
        }
    }
}

#schedule-loader {
    width: 100%;

    .spinner {
        border: 4px solid #f3f3f3; /* gris claro */
        border-top: 4px solid var(--dark-primary-light);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
        margin: 0 auto; /* centrar */
    }
}

.timetable-first-departures {
    width: 100%;
    table {
        
        thead {
            background-color: var(--dark-primary-light);
        }

        tbody {
            background-color: white;
        }
    }
    .spinner {
        border: 4px solid #f3f3f3; /* gris claro */
        border-top: 4px solid var(--dark-primary-light);
        border-radius: 50%;
        width: 40px;
        height: 40px;
        animation: spin 1s linear infinite;
        margin: 0 auto; /* centrar */
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para el listado de IES */
.ies-list-container {
    .ies-list {
        margin-bottom: 2rem !important;

        .ies-item {
            color: var(--black);
            font-weight: 400;
            font-size: 16px;
            line-height: 24px;
            padding-block: 10px;

            .ies-link {
                color: var(--primary-base);
                text-decoration: none;

                &:hover {
                    text-decoration: underline;
                }
            }
        }
    }
}