@media (max-width: 768px) {
    .card-header-custom {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header-custom .ms-auto {
        margin-left: 0 !important;
        width: 100%;
        margin-top: 1rem;
    }

    .card-header-custom form {
        width: 100%;
    }

    .card-header-custom button {
        flex: 1;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

.typing-tests-wrapper {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.gradient-text {
    background: linear-gradient(to right, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle-text {
    color: rgba(255, 255, 255, 0.9);
}

.badge-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Filter Section */
.filter-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.filter-label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

.filter-select {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a1a;
    transition: all 0.3s ease;
    width: 100%;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Search Section */
.search-container {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9fafb;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    color: #6b7280;
    font-size: 1.25rem;
    margin-left: 1rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1rem 1rem 1rem 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    padding: 0.75rem 1.25rem;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Popular Keywords Section */
.popular-keywords-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.keywords-title {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.keyword-btn {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.keyword-btn:hover,
.keyword-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.view-all-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.view-all-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: white;
}

.stat-icon-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-icon-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.stat-unit {
    font-size: 1.2rem;
    font-weight: 600;
    color: #6b7280;
    margin-left: 0.25rem;
}

.stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: inline-block;
}

.stat-trend.positive {
    background: #d1fae5;
    color: #059669;
}

.stat-trend.neutral {
    background: #e5e7eb;
    color: #6b7280;
}

/* Main Cards */
.main-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.custom-test-card {
    padding: 2.5rem;
}

.card-header-custom {
    padding: 1rem 1.75rem;
    background: white;
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.card-header-custom h4 {
    margin: 0;
    font-weight: 800;
    color: #1a1a1a;
    font-size: 1.15rem;
}

.card-header-custom p {
    margin: 0.25rem 0 0;
    color: #6b7280;
    font-size: 0.8rem;
}

.form-label-custom {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: block;
}

.form-control-custom,
.form-select-custom {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Inter', 'Nirmala UI', 'Mangal', 'Noto Sans Devanagari', sans-serif;
}

.form-control-custom:focus,
.form-select-custom:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.helper-text {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    display: inline-block;
    text-align: center;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1rem;
    color: #1e40af;
    font-size: 0.875rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.info-box i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

/* Difficulty Grid */
/* Minimized Difficulty Cards */
.difficulty-grid-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 1.5rem 2.5rem;
}

.difficulty-card-mini {
    background: white;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.difficulty-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.difficulty-card-mini .diff-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1e293b;
}

.difficulty-card-mini .diff-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: #f8fafc;
    color: #64748b;
}

.difficulty-card-mini.difficulty-easy {
    border-left: 4px solid #10b981;
}

.difficulty-card-mini.difficulty-medium {
    border-left: 4px solid #f59e0b;
}

.difficulty-card-mini.difficulty-hard {
    border-left: 4px solid #ef4444;
}

.difficulty-card-mini.difficulty-easy:hover {
    background-color: #f0fdf4;
    border-color: #86efac;
}

.difficulty-card-mini.difficulty-medium:hover {
    background-color: #fffbeb;
    border-color: #fcd34d;
}

.difficulty-card-mini.difficulty-hard:hover {
    background-color: #fef2f2;
    border-color: #fca5a5;
}

.difficulty-card-mini.active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.difficulty-card-mini.difficulty-easy.active {
    background-color: #f0fdf4;
    border-color: #10b981;
}

.difficulty-card-mini.difficulty-medium.active {
    background-color: #fffbeb;
    border-color: #f59e0b;
}

.difficulty-card-mini.difficulty-hard.active {
    background-color: #fef2f2;
    border-color: #ef4444;
}

/* Tests Table Format */
.tests-table-wrapper {
    padding: 0 2.5rem 2.5rem;
}

.tests-table {
    margin-bottom: 0;
    vertical-align: middle;
}

.tests-table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
}

.tests-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

.test-title-cell small {
    font-size: 0.75rem;
    margin-top: 2px;
}

.btn-start-test-sm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.4rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-start-test-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
}

@media (max-width: 768px) {
    .difficulty-grid-mini {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .tests-table thead {
        display: none;
    }

    .tests-table tbody td {
        display: block;
        padding: 0.5rem 1rem;
        border: none;
    }

    .tests-table tbody tr {
        display: block;
        border-bottom: 1px solid #e2e8f0;
        padding: 0.5rem 0;
    }
}

/* Tests List */
.tests-list {
    padding: 0 2.5rem 2.5rem;
}

.test-item {
    background: #f9fafb;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.test-item:hover {
    background: white;
    border-color: #667eea;
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.test-info {
    flex: 1;
}

.test-difficulty-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.test-difficulty-badge.easy {
    background: #d1fae5;
    color: #059669;
}

.test-difficulty-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.test-difficulty-badge.hard {
    background: #fee2e2;
    color: #dc2626;
}

.test-item h5 {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.test-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.test-preview {
    color: #9ca3af;
    font-size: 0.875rem;
    margin: 0;
}

.btn-start-test {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-start-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #9ca3af;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.search-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #9ca3af;
    background: #f9fafb;
    border-radius: 16px;
    margin-top: 1rem;
}

.search-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #6b7280;
}

.search-empty-state h5 {
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.search-empty-state p {
    color: #6b7280;
    margin: 0;
}

/* Tips Card */
.tips-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.3);
}

.tips-header {
    text-align: center;
    color: white;
    margin-bottom: 2.5rem;
}

.tips-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.tips-header h4 {
    font-weight: 800;
    margin: 0;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.tip-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-4px);
}

.tip-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.tip-item h6 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tip-item p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

/* Custom Alert */
.custom-alert {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-weight: 600;
}

.custom-alert.show {
    transform: translateX(0);
}

/* New Filter Form Styles */
.filter-form {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 1.5rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
}

.filter-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: white;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 46px;
}

.filter-select:hover {
    border-color: #007bff;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
}

.search-input-field {
    width: 100%;
    height: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input-field:hover {
    border-color: #007bff;
}

.search-input-field:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #0056b3;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        min-width: 100%;
    }
}

.custom-alert.alert-warning {
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }

    .test-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .test-action {
        width: 100%;
        margin-top: 1rem;
    }

    .btn-start-test {
        width: 100%;
    }
}

/* Custom Typing Button */
.btn-custom-typing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-custom-typing:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}