.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.form-search-th {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.form-search-th.loaded {
    opacity: 1;
}

.terms-grid {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.terms-grid.loaded {
    opacity: 1;
}

/* Select2 Container */
.select2-container {
    width: 250px !important;
    font-family: inherit;
}

/* Select Box */
.select2-container--default .select2-selection--single {
    height: 45px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    width: 250px !important;
    position: relative;
}

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Selected Text */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 45px;
    padding-left: 15px;
    padding-right: 30px;
    color: #333;
    font-size: 14px;
    width: 100% !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Dropdown Arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 43px;
    width: 30px;
    right: 5px;
    position: absolute;
    top: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #666 transparent transparent transparent;
    border-width: 6px 4px 0 4px;
    margin-left: -4px;
}

/* Dropdown */
.select2-dropdown {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-top: 5px;
    width: 250px !important;
}

/* Search Box */
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    margin: 8px;
    width: calc(100% - 16px);
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Group Headers */
.select2-container--default .select2-results__group {
    font-weight: 600;
    padding: 10px 15px;
    background: #f8f9fa;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Options */
.select2-container--default .select2-results__option {
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
}

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

/* No Results */
.select2-container--default .select2-results__option--no-results {
    color: #666;
    padding: 10px 15px;
    font-style: italic;
}

#ajax-search-form {
    position: relative;
    max-width: 600px;
    margin: 20px auto;
    z-index: 10;
}

#search-input {
    width: 300px;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease-in-out;
}

#search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
}

/* Results */
#search-results {
    background: #fff;
    border-radius: 8px;
    position: absolute;
    z-index: 10;
    left: 0;
    right: 0;
    display: none;
    padding: 15px;
    max-height: 550px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Inline-style replacements */
.filter-optgroup-select { width: 250px; }

.copy-link-container { margin: 4px 0; padding: 4px 6px; background: #f8f9fa; border-radius: 3px; border-left: 2px solid #0048d8; position: relative; }
.copy-link-inner { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.copy-emoji { color: #6c757d; font-weight: 500; font-size: 11px; }
.copy-link-input-style { flex: 1; padding: 2px 4px; border: 1px solid #dee2e6; border-radius: 2px; background: #fff; font-size: 20px; font-family: monospace; color: #495057; }
.copy-link-btn-style { padding: 2px 6px; background: #0048d8; color: #fff; border: none; border-radius: 2px; cursor: pointer; font-size: 10px; font-weight: 500; min-width: 40px; }
.copy-success-notification { display: none; position: absolute; top: -25px; right: 0; background: #28a745; color: #fff; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 500; z-index: 1000; }

.binh-don-tooltip-wrapper { display: inline-block; position: relative; }
.binh-don-tooltip-icon { vertical-align: middle; cursor: pointer; }
.binh-don-tooltip { visibility: hidden; opacity: 0; width: max-content; background: #333; color: #fff; text-align: left; border-radius: 4px; padding: 6px 10px; position: absolute; z-index: 10; left: 120%; top: 50%; transform: translateY(-50%); transition: opacity 0.2s; font-size: 13px; min-width: 120px; max-width: 300px; }
.search-results .result-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    color: #333;
    transition: background 0.2s ease-in-out;
    cursor: pointer;
}

.search-results .result-item:last-child {
    border-bottom: none;
}

.search-results .result-item:hover {
    background: #f8f9fa;
    color: #007bff;
}
#clear-search {
    background: 0;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s ease;
}

#clear-search:hover {
    color: #ff4d4d;
    transform: scale(1.2);
}

#clear-search:active {
    transform: scale(0.9);
}
#clear-search img {
    width: 20px;
    max-width: fit-content;
    height: 20px;
}
/* Mobile adjustments */
@media (max-width: 768px) {
    .filter-optgroup-select { width: 100%; }
    .select2-container { width: 100% !important; }
    .select2-container--default .select2-selection--single { width: 100% !important; }
    .select2-dropdown { width: 100% !important; }
    #search-input { width: 100%; }
	.form-search-th .form-search .term-form-search>div, .main-section-2{
        flex-direction: column;
		width: 100%;
    }
	.form-search-input{
		width:100%
	}
    .form-search-th .form-search .term-form-search{
        width:90%;
    }
	#search-input{
		font-size:14px;
	}
    .form-search-th .form-search .button-xoa{
        width:10%;
		flex:0 1;
		padding:0;
    }
    .form-search-th .form-search{
        align-items:center;
        
    }
	.form-search-th .form-search>*{
		flex:1;
	}
	#nhomCatLieuGrid.collapsed{
        max-height: 280px;
    }
    #filter-optgroup{
        width:100%;
		font-size: 14px;
        color: #000;
    }
}

