@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

.accordion-container { max-width: 900px; margin: 0 auto; padding: 20px; }

.accordion {
    cursor: pointer;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    transition: all 0.3s ease;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
}

.accordion::after {
    font-weight: bold;
    float: right;
    transition: transform 0.3s ease;
    font-size: 20px;
}

.panel {
    display: none;
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel.is-open {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Nivel 1: Días */
.accordion-l1 {
    background: linear-gradient(135deg, #4a9d6e 0%, #25623d 100%);
    color: white;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(37, 98, 61, 0.3);
}

.accordion-l1:hover {
    background: linear-gradient(135deg, #25623d 0%, #4a9d6e 100%);
    box-shadow: 0 6px 20px rgba(37, 98, 61, 0.4);
    transform: translateY(-2px);
}

.accordion-l1::after { content: '▼'; color: white; font-size: 14px; }
.accordion-l1.active::after { transform: rotate(180deg); }

.panel-l1 {
    padding: 8px;
    background-color: #e8f4ee;
    border-radius: 0 0 12px 12px;
    margin-top: -12px;
    margin-bottom: 12px;
}

/* Título de grupo (siempre visible) */
.grupo-titulo {
    background-color: #ffffff;
    color: #25623d;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 16px;
    margin: 12px 0 0 0;
    border-radius: 10px 10px 0 0;
    border-left: 4px solid #4a9d6e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-family: 'Poppins', sans-serif;
}

/* Contenido del turno (siempre visible) */
.turno-content {
    padding: 16px 20px;
    background: linear-gradient(to right, #f7fafc 0%, #ffffff 100%);
    border-radius: 0 0 10px 10px;
    margin-bottom: 12px;
    font-size: 14px;
    border-left: 4px solid #4a9d6e;
    border-top: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Información del turno */
.turno-info {
    margin-bottom: 15px;
}

.turno-info h4 {
    color: #25623d;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
}

.turno-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.turno-block {
    flex: 1;
    min-width: 200px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.turno-block h5 {
    color: #4a9d6e;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.turno-block p {
    margin: 5px 0;
    color: #4a5568;
    font-size: 13px;
}

.turno-block strong {
    color: #2d3748;
}

.maps-link {
    color: #4a9d6e;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.maps-link:hover {
    color: #25623d;
    text-decoration: underline;
}

.maps-link i {
    margin-right: 4px;
}

/* Botón ver componentes */
.btn-componentes {
    background: linear-gradient(135deg, #4a9d6e 0%, #25623d 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-componentes:hover {
    background: linear-gradient(135deg, #25623d 0%, #4a9d6e 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 98, 61, 0.3);
}

/* Modal para componentes */
.modal-componentes {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

.modal-componentes.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e8f4ee;
}

.modal-header h3 {
    color: #25623d;
    margin: 0;
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #4a5568;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: #25623d;
}

.modal-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-body li {
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body li:last-child {
    border-bottom: none;
}

/* Agrupación por cuerda - nombres en línea */
.cuerda-group {
    margin-bottom: 15px;
}

.cuerda-group:last-child {
    margin-bottom: 0;
}

.cuerda-header {
    background-color: #e8f4ee;
    color: #25623d;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.cuerda-nombres {
    padding: 0 15px;
    color: #4a5568;
    font-size: 13px;
    line-height: 1.6;
}

/* Sección de marchas */
.marchas-info {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.marchas-info p {
    margin: 8px 0;
    color: #4a5568;
    font-size: 13px;
}

.marchas-info p:first-child {
    margin-top: 0;
}

.marchas-info p:last-child {
    margin-bottom: 0;
}

.marchas-info strong {
    color: #25623d;
}

/* Botón sitios de interés */
.btn-sitios {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 8px 16px;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.btn-sitios:hover {
    background: #c8e6c9;
    border-color: #81c784;
}

/* Modal sitios */
.sitio-link {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.sitio-link:hover {
    color: #1b5e20;
    text-decoration: underline;
}

.marchas-titulo {
    font-weight: 600;
    color: #25623d;
    font-size: 13px;
    margin-bottom: 10px !important;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

/* Header de recorrido dentro de cada bloque de turno */
.turno-recorrido-header {
    margin-bottom: 10px;
}

/* Badge de tipo de recorrido */
.badge-recorrido {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 12px;
    border: 1px solid;
    vertical-align: middle;
    letter-spacing: 0.3px;
    margin-left: 6px;
}

/* Sin descanso */
.sin-descanso {
    text-align: center;
    padding: 30px;
    color: #4a5568;
    font-style: italic;
}

.sin-descanso i {
    font-size: 48px;
    color: #4a9d6e;
    display: block;
    margin-bottom: 15px;
}

/* Duración badge */
.duracion-badge {
    display: inline-block;
    background: #e8f4ee;
    color: #25623d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

/* Buscador */
.buscador-container {
    position: relative;
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.buscador-input-wrapper {
    flex: 1;
    min-width: 250px;
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.buscador-input-wrapper:focus-within {
    border-color: #4a9d6e;
    box-shadow: 0 0 0 3px rgba(74, 157, 110, 0.1);
}

.buscador-input-wrapper i {
    color: #4a9d6e;
    font-size: 18px;
    margin-right: 10px;
}

.buscador-input-wrapper input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 0;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    background: transparent;
}

.buscador-input-wrapper input::placeholder {
    color: #a0aec0;
}

/* Lista de sugerencias */
.sugerencias-lista {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sugerencia-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #4a5568;
    transition: background-color 0.2s ease;
}

.sugerencia-item:last-child {
    border-bottom: none;
}

.sugerencia-item:hover {
    background-color: #e8f4ee;
    color: #25623d;
}

.sugerencia-item strong {
    color: #25623d;
    font-weight: 600;
}

.sugerencia-vacia {
    padding: 15px;
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

.sugerencia-cuerda {
    color: #4a9d6e;
    font-size: 12px;
    font-weight: 500;
}

.btn-limpiar {
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-limpiar:hover {
    color: #e53e3e;
}

/* Resultado de búsqueda */
.resultado-busqueda {
    background: linear-gradient(135deg, #e8f4ee 0%, #d4edda 100%);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Poppins', sans-serif;
}

.resultado-busqueda i {
    color: #4a9d6e;
    font-size: 20px;
}

.resultado-busqueda p {
    margin: 0;
    color: #25623d;
    font-size: 14px;
}

.resultado-busqueda strong {
    color: #1a472a;
}

.resultado-busqueda.no-encontrado {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.resultado-busqueda.no-encontrado i {
    color: #c53030;
}

.resultado-busqueda.no-encontrado p {
    color: #742a2a;
}

/* Nombre resaltado */
.nombre-resaltado {
    background-color: #fef3c7;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    color: #92400e;
}

/* Media Queries */
@media screen and (max-width: 768px) {
    .turno-detail {
        flex-direction: column;
    }

    .turno-block {
        min-width: 100%;
    }

    .modal-content {
        padding: 20px;
        margin: 10px;
    }

    .accordion-l1 {
        padding: 14px 18px;
        font-size: 16px;
    }

    .grupo-titulo {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .accordion-container {
        padding: 10px;
    }

    .gtco-cover .mt-text h1 {
        font-size: 28px !important;
    }

    .btn-componentes {
        width: 100%;
        justify-content: center;
    }

    .buscador-container {
        flex-direction: column;
    }

    .buscador-input-wrapper {
        min-width: 100%;
    }

    .resultado-busqueda {
        flex-direction: column;
        text-align: center;
    }
}
