/* Enhanced Flashcard Filtering Styles */

/* Filter Form Styles */
.filter-form {
    background: white;
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.form-control, .form-select {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.1);
    background-color: white;
}

.form-control:hover, .form-select:hover {
    border-color: #dee2e6;
}

/* Quick Filter Buttons */
.quick-filter {
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: 2px solid #dee2e6;
    background: white;
}

.quick-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-filter.active {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    border-color: #0d6efd;
    color: white;
}

/* Flashcard Cards */
.flashcard-item {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: white;
}

.flashcard-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.flashcard-item .card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.flashcard-item .card-title {
    color: #212529;
    font-weight: 700;
    line-height: 1.3;
}

.flashcard-item .card-text {
    color: #6c757d;
    line-height: 1.5;
}

/* Status Badges */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.badge.bg-success {
    background: linear-gradient(135deg, #198754, #157347) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14) !important;
    color: #000 !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #0dcaf0, #0ea5e9) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7) !important;
}

/* Stats Display */
.stats-row {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.stats-row .stat-value {
    font-weight: 700;
    font-size: 1.125rem;
}

/* Button Groups */
.btn-group .btn {
    border-radius: 0.375rem !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

/* Advanced Filters Panel */
#advancedFilters {
    border-top: 2px solid #e9ecef;
    margin-top: 1rem;
    padding-top: 1.5rem;
}

.filter-section-title {
    color: #0d6efd;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0d6efd;
}

/* Form Checkboxes */
.form-check {
    margin-bottom: 0.75rem;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-check-label {
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    user-select: none;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid #e9ecef;
    border-top: 0.25rem solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Active Filters Display */
.active-filters {
    background: linear-gradient(135deg, #e7f5ff, #cff4fc);
    border: 1px solid #a5d8ff;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.active-filters .filter-badge {
    background: #0d6efd;
    color: white;
    font-size: 0.75rem;
    margin: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.active-filters .filter-badge:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

/* Statistics Dashboard */
.stats-dashboard {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.stat-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-card.primary {
    background: linear-gradient(135deg, #e7f5ff, #cff4fc);
    border-color: #a5d8ff;
}

.stat-card.success {
    background: linear-gradient(135deg, #d1e7dd, #b7e0c7);
    border-color: #a5d8b9;
}

.stat-card.warning {
    background: linear-gradient(135deg, #fff3cd, #ffe69c);
    border-color: #ffd43b;
}

.stat-card.info {
    background: linear-gradient(135deg, #cff4fc, #b6effb);
    border-color: #6edff6;
}

.stat-card.secondary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-color: #dee2e6;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6c757d;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 1rem;
    margin: 2rem 0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #adb5bd;
    margin-bottom: 1.5rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 1rem;
}

.empty-state-text {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Pagination Enhanced */
.pagination .page-link {
    border: none;
    color: #0d6efd;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.pagination .page-link:hover {
    background: #0d6efd;
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: #0d6efd;
    color: white;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .flashcard-item {
        margin-bottom: 1rem;
    }

    .quick-filter {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }

    .stat-card {
        margin-bottom: 0.5rem;
    }

    .form-control, .form-select {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    #advancedFilters .row {
        gap: 0.5rem;
    }

    .filter-section-title {
        font-size: 0.75rem;
    }

    .badge {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }

    .stats-row {
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    .d-flex.gap-2 {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .quick-filter {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Focus States for Accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus,
.quick-filter:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .form-control, .form-select {
        border-width: 3px;
    }

    .flashcard-item {
        border: 2px solid #000;
    }

    .badge {
        border: 1px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}