/* Sistema de Horarios de Buses - v3.6 */

* {
    box-sizing: border-box;
}

.bus-schedule-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* HEADER */
.bus-schedule-header {
    text-align: center;
    margin-bottom: 40px;
}

.bus-schedule-header .icons {
    display: none;
}

.bus-schedule-header h2 {
    color: #003087;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

/* FORMULARIO */
.bus-schedule-form {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* FILA PRINCIPAL */
.search-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: end;
    background: transparent;
    padding: 0;
}

.search-row .form-field {
    margin: 0;
}

/* LABELS */
.form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #003087;
}

.field-icon {
    display: none;
}

.field-label {
    display: block;
}

/* SELECTS */
.form-field select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    background-color: #ffffff;
    color: #1a1a2e;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='%23003087'%3E%3Cpath d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    height: 52px;
}

.form-field select:hover {
    border-color: #003087;
}

.form-field select:focus {
    outline: none;
    border-color: #003087;
    box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.1);
}

/* BOTON SWAP */
.swap-button {
    background: #003087;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 48, 135, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swap-button:hover {
    background: #002266;
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 48, 135, 0.3);
}

/* FILTROS */
.filters-section {
    padding: 30px 0;
    background: transparent;
    border-top: 2px solid #f0f0f0;
    margin-bottom: 30px;
}

.filters-section h3 {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #003087;
    margin: 0 0 20px 0;
    letter-spacing: 2px;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* BOTON BUSCAR - REDONDO */
.search-button,
button.search-button,
input[type="submit"].search-button {
    width: auto !important;
    padding: 10px 32px !important;
    background: #003087 !important;
    color: white !important;
    border: none !important;
    border-radius: 50px !important;
    -webkit-border-radius: 50px !important;
    -moz-border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 48, 135, 0.3) !important;
    margin-bottom: 12px !important;
    margin-right: 20px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

.search-button:hover,
button.search-button:hover,
input[type="submit"].search-button:hover {
    background: #002266 !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 48, 135, 0.4) !important;
}

.search-button:active,
button.search-button:active,
input[type="submit"].search-button:active {
    transform: translateY(0) !important;
}

.search-button:focus,
button.search-button:focus,
input[type="submit"].search-button:focus {
    outline: none !important;
    color: white !important;
}

.search-icon::before {
    content: "";
}

/* BOTON LIMPIAR - REDONDO */
.clear-button,
button.clear-button {
    width: auto !important;
    padding: 10px 32px !important;
    background: #ffffff !important;
    color: #dc3545 !important;
    border: 2px solid #dc3545 !important;
    border-radius: 50px !important;
    -webkit-border-radius: 50px !important;
    -moz-border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    line-height: 1 !important;
}

.clear-button:hover,
button.clear-button:hover {
    background: #dc3545 !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3) !important;
}

.clear-button:focus,
button.clear-button:focus {
    outline: none !important;
}

/* RESULTADOS */
.search-results {
    margin-top: 40px;
}

.results-container h3 {
    display: none;
}

/* TABLA DE RESULTADOS - ESTILO LIMPIO CON COLUMNAS */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 16px;
    background: transparent;
}

.results-table thead {
    display: none;
}

.results-table tbody {
    display: block;
}

.results-table tbody tr {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr 1.5fr 1fr;
    gap: 15px;
    padding: 24px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
    align-items: center;
}

.results-table tbody tr:hover {
    border-color: #003087;
    box-shadow: 0 4px 16px rgba(0, 48, 135, 0.1);
    transform: translateY(-2px);
}

.results-table td {
    padding: 0;
    border: none;
    font-size: 15px;
}

/* RUTA */
.route-cell {
    font-size: 18px;
    font-weight: 700;
    color: #003087;
}

/* EMPRESA - BADGE */
.company-cell {
    background: #003087;
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

/* HORARIOS */
.time-cell {
    font-size: 14px;
    color: #1a1a2e;
}

.time-cell strong {
    font-weight: 700;
    color: #1a1a2e;
}

.duration-cell {
    font-size: 14px;
    color: #6c757d;
}

.duration-cell strong {
    font-weight: 600;
    color: #1a1a2e;
}

.days-cell {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

.days-cell strong {
    font-weight: 600;
    color: #1a1a2e;
}

/* SIN RESULTADOS */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 2px dashed #e0e0e0;
}

.no-results p {
    font-size: 16px;
    color: #6c757d;
    margin: 10px 0;
}

.no-results p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

/* LOADING */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #003087;
    font-weight: 600;
}

.loading:after {
    content: "...";
    display: inline-block;
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* ANULAR SELECT2 */
.select2-container--default .select2-selection--single {
    display: none !important;
}

#origin-select,
#destination-select,
#company-select,
#days-select {
    display: block !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .bus-schedule-container {
        padding: 20px 15px;
    }
    
    .bus-schedule-header h2 {
        font-size: 28px;
    }
    
    .bus-schedule-form {
        padding: 25px 20px;
    }
    
    .search-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .swap-button {
        display: none;
    }
    
    .filters-section {
        padding: 20px 0;
    }
    
    .filters-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-button {
        font-size: 14px;
        height: 42px;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .clear-button {
        width: 100%;
        margin-top: 0;
    }
    
    /* En mobile cambiar a una columna */
    .results-table tbody tr {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 20px;
    }
    
    .route-cell {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .company-cell {
        display: inline-block;
        margin-bottom: 10px;
    }
    
    .time-cell,
    .duration-cell,
    .days-cell {
        display: block;
    }
}