/* CSS Fixes cho Bộ Lọc Khu Vực - Huế Xanh */

/* Sửa lỗi dropdown bị cắt trên mobile */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f06421' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

/* Sửa lỗi text bị cắt trong dropdown */
.filter-select option {
    padding: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Cải thiện trạng thái loading */
.filter-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Sửa lỗi focus state */
.filter-select:focus {
    outline: none;
    border-color: #f06421;
    box-shadow: 0 0 0 2px rgba(240, 100, 33, 0.2);
}

/* Cải thiện spacing cho mobile */
@media (max-width: 768px) {
    .filter-group {
        margin-bottom: 1rem;
    }
    
    .filter-select {
        padding: 0.75rem 2.5rem 0.75rem 0.75rem;
        font-size: 16px; /* Ngăn zoom trên iOS */
        margin-bottom: 0.75rem;
    }
    
    .filter-group-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .filter-options {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .filter-select {
        padding: 0.6rem 2.2rem 0.6rem 0.6rem;
        font-size: 16px;
        margin-bottom: 0.6rem;
    }
    
    .filter-group-title {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .filter-actions {
        margin-top: 1.5rem;
    }
    
    .filter-actions .btn {
        padding: 0.75rem;
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

/* Sửa lỗi container overflow */
.filter-section {
    overflow: visible;
}

.filter-form {
    overflow: visible;
}

/* Cải thiện hiển thị error states */
.filter-select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.filter-select.loading {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Sửa lỗi z-index cho dropdown */
.filter-group {
    position: relative;
    z-index: 1;
}

.filter-select:focus,
.filter-select:active {
    z-index: 2;
}

/* Cải thiện accessibility */
.filter-select:focus-visible {
    outline: 2px solid #f06421;
    outline-offset: 2px;
}

/* Sửa lỗi text truncation */
.filter-select {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Animation cho loading state */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.filter-select.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Sửa lỗi button alignment */
.filter-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

.filter-actions .btn {
    flex: 1;
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cải thiện contrast */
.filter-select option:checked {
    background-color: #f06421;
    color: white;
}

/* Sửa lỗi Safari select styling */
@supports (-webkit-appearance: none) {
    .filter-select {
        -webkit-appearance: none;
    }
}

/* Sửa lỗi Firefox select styling */
@-moz-document url-prefix() {
    .filter-select {
        -moz-appearance: none;
    }
}
