/**
 * ProQyz Course Test Filters CSS
 * Styles for the test filtering interface
 */

/* Filter Container */
.proqyz-test-filters {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.proqyz-test-filters .filter-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.filter-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.lesson-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lesson-filter-container label {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.lesson-filter-select {
    padding: 8px 35px 8px 12px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 200px;
    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='currentColor' 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 8px center;
    background-size: 20px;
}

.lesson-filter-select:hover {
    border-color: #3b82f6;
}

.lesson-filter-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Filter Buttons Container */
.filter-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Individual Filter Button */
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f5f7fa;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #4a5568 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e8ecf1;
    color: #4a5568 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    background: #ffffff;
    color: #1a1a1a !important;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Filter Icons */
.filter-icon {
    font-size: 18px;
    display: inline-block;
}

/* Specific color themes for each filter type */
.filter-btn[data-filter="ielts-reading"].active {
    border-color: #327846;
    color: #327846 !important;
}

.filter-btn[data-filter="ielts-listening"].active {
    border-color: #33B2C7;
    color: #33B2C7 !important;
}

.filter-btn[data-filter="ielts-writing"].active {
    border-color: #faaa5a;
    color: #faaa5a !important;
}

.filter-btn[data-filter="ielts-speaking"].active {
    border-color: #c86478;
    color: #c86478 !important;
}

.filter-btn[data-filter="all"].active {
    border-color: #3b82f6;
    color: #3b82f6 !important;
}

/* Tests Grid Layout */
.practice-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Test Card Wrapper */
.test-card-wrapper {
    opacity: 1;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.test-card-wrapper.filter-animation {
    opacity: 0.8;
}

/* Ensure practice items fill the grid cell */
.test-card-wrapper .practice-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .practice-list-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .proqyz-test-filters {
        padding: 20px 15px;
    }
    
    .proqyz-pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-btn {
        width: 100%;
        justify-content: center;
    }
    
    .filter-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lesson-filter-container {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lesson-filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .practice-list-grid {
        grid-template-columns: 1fr;
    }
    
    .proqyz-test-filters .filter-header h3 {
        font-size: 20px;
    }
    
    .filter-btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .pagination-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .pagination-info {
        font-size: 14px;
    }
    
    .lesson-filter-container label {
        font-size: 13px;
    }
    
    .lesson-filter-select {
        font-size: 13px;
        min-width: 150px;
    }
}

/* Optional: Add a search bar style if you want to add search later */
.test-search-container {
    margin-top: 15px;
}

#test-search {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#test-search:focus {
    outline: none;
    border-color: #3b82f6;
}

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

/* Pagination Styles */
.proqyz-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #3b82f6;
    color: #ffffff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.pagination-btn:disabled {
    background: #e5e7eb;
    color: #9ca3af !important;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 15px;
    font-weight: 500;
    color: #4a5568;
    padding: 0 10px;
}

.pagination-info .current-page {
    color: #3b82f6;
    font-weight: 600;
    font-size: 16px;
}

.pagination-info .total-pages {
    color: #1a1a1a;
}

/* Empty state */
.no-tests-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #718096;
    font-size: 16px;
}

.no-tests-message::before {
    content: "📋";
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
}

/* Animation for test cards appearing */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-card-wrapper {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

/* Stagger animation for multiple cards */
.test-card-wrapper:nth-child(1) { animation-delay: 0.03s; }
.test-card-wrapper:nth-child(2) { animation-delay: 0.06s; }
.test-card-wrapper:nth-child(3) { animation-delay: 0.09s; }
.test-card-wrapper:nth-child(4) { animation-delay: 0.12s; }
.test-card-wrapper:nth-child(5) { animation-delay: 0.15s; }
.test-card-wrapper:nth-child(6) { animation-delay: 0.18s; }
.test-card-wrapper:nth-child(7) { animation-delay: 0.21s; }
.test-card-wrapper:nth-child(8) { animation-delay: 0.24s; }
.test-card-wrapper:nth-child(n+9) { animation-delay: 0.27s; }

