/* Bus Search Widget Styles */
.bsw-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.bsw-search-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.bsw-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}

.bsw-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.bsw-form-group {
    position: relative;
}

.bsw-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #34495e;
    font-size: 14px;
}

.bsw-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.bsw-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.bsw-input:hover {
    border-color: #bdc3c7;
}

/* Styles pour les dropdowns personnalisés avec recherche */
.bsw-dropdown-group {
    position: relative;
}

.bsw-select-wrapper {
    position: relative;
}

.bsw-select-input {
    padding-right: 40px !important;
    cursor: text;
}

.bsw-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
    font-size: 12px;
    pointer-events: none;
    transition: transform 0.3s ease;
}

.bsw-select-wrapper.active .bsw-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.bsw-dropdown-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    margin-top: 4px;
    animation: bsw-dropdown-appear 0.2s ease-out;
}

.bsw-dropdown-container.show {
    display: block;
}

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

.bsw-dropdown-list {
    max-height: 250px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bsw-dropdown-list li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bsw-dropdown-list li:hover {
    background-color: #e8f4fc;
    color: #3498db;
}

.bsw-dropdown-list li:last-child {
    border-bottom: none;
}

.bsw-dropdown-list li.bsw-placeholder,
.bsw-dropdown-list li.bsw-no-result,
.bsw-dropdown-list li.bsw-loading,
.bsw-dropdown-list li.bsw-error {
    color: #95a5a6;
    font-style: italic;
    cursor: default;
}

.bsw-dropdown-list li.bsw-placeholder:hover,
.bsw-dropdown-list li.bsw-no-result:hover,
.bsw-dropdown-list li.bsw-loading:hover {
    background-color: transparent;
    color: #95a5a6;
}

.bsw-dropdown-list li.bsw-error {
    color: #e74c3c;
}

.bsw-route-icon {
    font-size: 14px;
    opacity: 0.7;
}

/* Scrollbar personnalisée pour les dropdowns */
.bsw-dropdown-list::-webkit-scrollbar {
    width: 6px;
}

.bsw-dropdown-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.bsw-dropdown-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.bsw-dropdown-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.bsw-submit-group {
    display: flex;
    align-items: end;
}

.bsw-submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bsw-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.bsw-submit-btn:active {
    transform: translateY(0);
}

.bsw-search-icon {
    font-size: 18px;
}

/* Résultats */
.bsw-results {
    margin-top: 30px;
}

.bsw-loading {
    text-align: center;
    padding: 40px;
}

.bsw-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: bsw-spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.bsw-results-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bsw-results-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
}

.bsw-results-list {
    display: grid;
    gap: 20px;
}

.bsw-result-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
}

.bsw-result-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.bsw-result-image {
    width: 150px;
    height: 120px;
    overflow: hidden;
}

.bsw-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bsw-result-content {
    padding: 20px 20px 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bsw-result-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.bsw-result-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bsw-result-title a:hover {
    color: #3498db;
}

.bsw-result-meta {
    margin-bottom: 15px;
}

.bsw-result-meta p {
    margin: 5px 0;
    color: #7f8c8d;
    font-size: 14px;
}

.bsw-result-actions {
    margin-top: auto;
}

.bsw-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.bsw-btn-primary {
    background: #3498db;
    color: white;
}

.bsw-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 768px) {
    .bsw-search-form {
        padding: 20px;
    }
    
    .bsw-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bsw-result-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .bsw-result-image {
        width: 100%;
        height: 200px;
    }
    
    .bsw-result-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .bsw-title {
        font-size: 20px;
    }
    
    .bsw-input {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* Styles pour les dates disponibles/non disponibles dans le datepicker */
.ui-datepicker .bsw-available-date a {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.ui-datepicker .bsw-available-date a:hover {
    background-color: #c3e6cb !important;
}

.ui-datepicker .bsw-unavailable-date a {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
    cursor: not-allowed !important;
}

.ui-datepicker .bsw-unavailable-date a:hover {
    background-color: #f8d7da !important;
}

/* Style alternatif compact */
.bsw-container[data-style="compact"] .bsw-search-form {
    padding: 20px;
}

.bsw-container[data-style="compact"] .bsw-form-row {
    grid-template-columns: 2fr 2fr 2fr 1fr;
    gap: 15px;
}

.bsw-container[data-style="compact"] .bsw-title {
    font-size: 18px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .bsw-container[data-style="compact"] .bsw-form-row {
        grid-template-columns: 1fr;
    }
}
