/* Custom styles beyond Tailwind */

/* Category grid container */
#categories-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* Category items styling */
.category-item {
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid transparent;
    min-width: 0; /* 解决文本溢出问题 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item:hover {
    background-color: #eff6ff; /* blue-50 */
    border-color: #bfdbfe; /* blue-200 */
}

.category-item.selected {
    background-color: #dbeafe; /* blue-100 */
    color: #1e40af; /* blue-800 */
    font-weight: 500;
    border-color: #93c5fd; /* blue-300 */
}

/* Selected categories styling */
.selected-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #e0e7ff; /* indigo-100 */
    border: 1px solid #c7d2fe; /* indigo-200 */
    border-radius: 0.375rem; /* rounded-md */
    transition: background-color 0.2s;
}

.selected-category-item:hover {
    background-color: #c7d2fe; /* indigo-200 */
}

.remove-category-btn {
    color: #4f46e5; /* indigo-600 */
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: 0.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.remove-category-btn:hover {
    color: #ef4444; /* red-500 */
    background-color: #fee2e2; /* red-100 */
}

/* Results table styling */
.page-link {
    color: #2563eb; /* blue-600 */
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
}

.page-link:hover {
    color: #1d4ed8; /* blue-700 */
    text-decoration: underline;
}

/* Pagination styling */
.pagination-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem; /* Increased min-width */
    height: 2.5rem; /* Increased height */
    padding: 0 0.75rem; /* Adjusted padding */
    border: 1px solid #d1d5db; /* gray-300 */
    background-color: #ffffff; /* white */
    color: #374151; /* gray-700 */
    cursor: pointer;
    font-size: 0.875rem; /* text-sm */
    border-radius: 0.375rem; /* rounded-md */
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    margin: 0 0.125rem; /* Added small margin */
}

.pagination-button.active {
    background-color: #2563eb; /* blue-600 */
    color: #ffffff; /* white */
    border-color: #2563eb; /* blue-600 */
    font-weight: 600; /* semibold */
}

.pagination-button:hover:not(.active):not(:disabled) {
    background-color: #f3f4f6; /* gray-100 */
    border-color: #9ca3af; /* gray-400 */
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loader in categories list specific styling if needed */
#categories-loading .animate-spin {
    border-color: #9ca3af; /* gray-400 */
    border-top-color: #3b82f6; /* blue-500 */
    border-bottom-color: #3b82f6; /* blue-500 */
}

/* Progress bar specific styling */
#progress-bar {
    transition: width 0.3s ease-in-out;
}

/* Custom scrollbar for category lists */
#categories-container::-webkit-scrollbar,
#selected-categories-container::-webkit-scrollbar {
    width: 8px;
}

#categories-container::-webkit-scrollbar-track,
#selected-categories-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#categories-container::-webkit-scrollbar-thumb,
#selected-categories-container::-webkit-scrollbar-thumb {
    background: #c5c5c5;
    border-radius: 10px;
}

#categories-container::-webkit-scrollbar-thumb:hover,
#selected-categories-container::-webkit-scrollbar-thumb:hover {
    background: #a5a5a5;
}

/* 响应式布局调整 */
@media (max-width: 768px) {
    #categories-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    #categories-list {
        grid-template-columns: 1fr;
    }
}