/**
 * Story Filter CSS
 * Styling cho form lọc truyện
 */

.section-completed-story {
    margin-top: 0px;
    flex: 1;
}

/* Filter form styling */
#filterForm {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1rem;
    backdrop-filter: blur(15px);
    padding: 24px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
}

#filterForm .form-group {
    margin-bottom: 0;
}

#filterForm label {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
}

#filterForm .form-control,
#filterForm .form-select {
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}

#filterForm .form-control:focus,
#filterForm .form-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#filterForm .select2-selection__clear {
    display: none;
}

#filterForm .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
}

/* Select2 Custom Styling */
#filterForm .select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #fff;
}

#filterForm .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    color: #495057;
}

#filterForm .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

#filterForm .select2-container--default .select2-selection--single .select2-selection__clear {
    height: 36px;
    line-height: 36px;
    margin-right: 30px;
}

#filterForm .select2-container--default .select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#filterForm .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 8px 12px;
}

#filterForm .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#filterForm .select2-container--default .select2-results__option {
    padding: 8px 12px;
}

#filterForm .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #007bff;
    color: white;
}

#filterForm .select2-container--default .select2-results__option[aria-selected='true'] {
    background-color: #e9ecef;
    color: black !important;
}

/* Button styling */
#filterForm .btn {
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

#filterForm .btn-primary {
    background-color: #344767;
    border-color: #344767;
}

#filterForm .btn-primary:hover {
    background-color: #8392ab;
    border-color: #8392ab;
}

#filterForm .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

#filterForm .btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* Select optgroup styling */
#filterForm optgroup {
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

#filterForm option {
    font-weight: normal;
    color: #212529;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #filterForm {
        padding: 1rem;
    }

    #filterForm .row.g-3 > div {
        margin-bottom: 0rem;
    }

    #filterForm .btn {
        height: auto;
        padding: 0.75rem 1rem;
    }

    .select2-container {
        width: 100% !important;
    }
}

/* Active filter indicator */
.filter-active {
    position: relative;
}

.filter-active::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #28a745;
    border-radius: 50%;
}

/* Loading state */
.filter-loading {
    opacity: 0.6;
    pointer-events: none;
}

.filter-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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