/* ========================================
   BUSCADOR DE RUTAS - ESTILO INSTITUCIONAL
   (Mismo diseño que Listado de Archivos)
   ======================================== */

/* ESTILOS GENERALES */
.buscador-rutas-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
}

.titulo-principal {
    font-size: 32px;
    color: #474345;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
}

/* FILTROS */
.filtros-container {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); */
}

/* BUSCADOR */
.buscador-input-wrapper {
    margin-bottom: 20px;
    position: relative;
}

.buscador-input {
    width: 100% !important;
    padding: 14px 50px 14px 16px !important;
    border: 3px solid #C2BA98 !important;
    border-radius: 25px !important;
    font-size: 16px !important;
    font-family:var(--truenosemibold) !important;
    color: #474345 !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box;
    margin-bottom: 0px !important;
    height: auto !important;
}

.buscador-input:focus {
    outline: none;
    border-color: #7D2447;
    box-shadow: 0 0 0 4px rgba(125, 36, 71, 0.15);
}

.buscador-input::placeholder {
    color: #adb5bd;
}

.buscador-icono {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%237D2447' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
    background-size: contain;
    pointer-events: none;
}

.buscador-limpiar {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7D2447;
    cursor: pointer;
    font-size: 30px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: 800;
}

.buscador-limpiar:hover {
    background-color: rgba(125, 36, 71, 0.1);
    transform: translateY(-50%) scale(1.1);
}

/* BOTONES */
.botones-filtro {
    display: flex;
    gap: 15px;
    justify-content: right;
    margin-top: 10px;
}

.btn-limpiar {
    background: #41504D;
    color: white;
    border: 2px solid #474345;
    padding: 12px 28px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 18px;
    font-family: var(--truenosemibold), sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-limpiar:hover {
    background: #474345;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 67, 69, 0.2);
}

/* TABLA */
.tabla-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    border: 1px solid #e8eced;
    display: none;
}

.tabla-container.visible {
    display: block;
}

.table-header {
    background: rgba(194, 186, 152, 0.6);
    color: #474345;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.contador-resultados {
    font-size: 16px;
    color:#474345;
    font-family: var(--truenolight);
    
}

.uk-overflow-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabla-rutas {
    min-width: 700px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* CENTRADO DE TODAS LAS CELDAS */
.tabla-rutas th
{
  text-align: center !important;
    vertical-align: middle !important;
        font-family: var(--truenosemibold), sans-serif;
}
.tabla-rutas td {
    text-align: center !important;
    vertical-align: middle !important;
    font-family: var(--truenolight), sans-serif;
}

.tabla-rutas th {
    background-color:rgba(194, 186, 152, 0.6);
    color: #474345;
    font-weight: 600;
    padding: 16px 12px;
    font-size: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.tabla-rutas td {
    padding: 14px 12px;
    border-bottom: 2px solid #C2BA98;
    font-size: 16px;
    color: #2d3a37;
}

.tabla-rutas tbody tr:hover {
    background-color: #fdf5f8;
}

.resultados-body tr td:nth-child(4) {
    text-align: left !important;
}
/* Resaltado de coincidencias en la tabla */
.tabla-rutas td mark {
    background: #fff176;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Enlace de descarga para celdas con URL */
.link-descarga {
    display: inline-block;
    background: #7D2447;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.link-descarga:hover {
    background: #5d1a36;
    color: #ffffff;
    transform: translateY(-1px);
}

/* PAGINACIÓN */
.custom-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding: 10px 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 10px 16px;
    border: 2px solid #e8eced;
    border-radius: 10px;
    color: #2d3a37;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    background: white;
    cursor: pointer;
}

.page-link:hover {
    background-color: #f8f9fa;
    border-color: #7D2447;
    color: #7D2447;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background-color: #7D2447;
    border-color: #7D2447;
    color: white;
}

/* Elipsis de paginación */
.page-item.elipsis .page-link {
    border: none;
    background: transparent;
    color: #adb5bd;
    cursor: default;
    min-width: 30px;
    padding: 10px 8px;
}

.page-item.elipsis .page-link:hover {
    background: transparent;
    border-color: transparent;
    color: #adb5bd;
    transform: none;
    box-shadow: none;
}

/* ESTADOS */
.api-status {
    padding: 16px 20px;
    margin: 15px 0 20px;
    border-radius: 10px;
    text-align: center;
    display: none;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.api-status.cargando {
    background-color: #474345;
    color: #ffffff;
}

.api-status.exito {
    background-color: #d4edda;
    color: #155724;
}

.api-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.api-status.advertencia {
    background-color: #ffffff;
    color: #000000;
}

.api-status.visible {
    display: block;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #7D2447;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* SELECTOR DE ELEMENTOS POR PÁGINA */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.elementos-por-pagina-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.elementos-por-pagina-label {
    color:#474345;
    font-size: 16px;
    font-family: var(--truenosemibold), sans-serif;
     position: relative;
  display: inline-block;
}

.elementos-por-pagina-select {
    padding: 12px 28px;
    border: 3px solid #C2BA98;
    border-radius: 25px;
    background: #fff;
    color: #474345;
    font-size: 16px;
    cursor: pointer;
    height: auto !important;
        font-family: var(--truenolight);
}

.elementos-por-pagina-label::after {
   content: '';
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  /* Tu SVG convertido a Data URI */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17.6' height='11' viewBox='0 0 17.6 11'%3E%3Cpath id='iconmonstr-arrow-65_4_' data-name='iconmonstr-arrow-65 (4)' d='M0,6.575,2.075,4.5,8.8,11.349,15.525,4.5,17.6,6.575,8.8,15.5Z' transform='translate(0 -4.5)' fill='%237d2447'/%3E%3C/svg%3E");

    /* Ajustes para que el SVG se dibuje correctamente */
    background-repeat: no-repeat;
    background-size: contain;
    width: 19.6px;  /* Ancho original del SVG */
    height: 13px;   /* Alto original del SVG */
    background-color: #fff;
}

.elementos-por-pagina-select::-ms-expand {
  display: none;
}



.elementos-por-pagina-select option {
    background: #7D2447;
    color: white;
}

/* Mensaje inicial (cuando no hay búsqueda) */
.mensaje-inicial {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.mensaje-inicial .icono-grande {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.mensaje-inicial p {
    margin: 0;
    font-size: 16px;
}

/* Sin resultados */
.sin-resultados {
    text-align: center;
    padding: 60px 20px;
    color: #adb5bd;
}

.sin-resultados .icono-grande {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.sin-resultados p {
    margin: 0;
    font-size: 16px;
}

/* Mensaje de error */
.mensaje-error {
    text-align: center;
    padding: 60px 20px;
}

.mensaje-error .icono-grande {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.mensaje-error p {
    margin: 0;
    font-size: 16px;
    color: #721c24;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .buscador-rutas-wrapper {
        padding: 10px;
    }

    .filtros-container {
        padding: 15px;
    }

    .table-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .header-controls {
        flex-direction: column;
        gap: 10px;
    }

    .titulo-principal {
        font-size: 24px;
    }

    .tabla-rutas {
        min-width: 600px;
    }

    .tabla-rutas th,
    .tabla-rutas td {
        font-size: 12px;
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .titulo-principal {
        font-size: 20px;
    }

    .botones-filtro {
        justify-content: center;
    }

    .btn-limpiar {
        width: 100%;
    }
}

