/* ========== HERO SECTION ========== */
.tests-hero {
    background: 
        radial-gradient(circle at 20% 80%, rgba(76, 175, 80, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(56, 142, 60, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(102, 187, 106, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tests-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    animation: float 20s linear infinite;
}

.tests-hero .container {
    position: relative;
    z-index: 2;
}

.tests-hero h1 {
    font-weight: 800;
    margin-bottom: 1.5rem;
    font-size: 3.2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tests-hero .lead {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
    100% { transform: translateY(0px) rotate(360deg); }
}

/* ========== CATEGORY TABS ========== */
.category-tabs {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-top: -50px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.nav-pills-custom {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px;
    display: inline-flex;
    border: 1px solid #e9ecef;
}

.nav-pills-custom .nav-link {
    border-radius: 10px;
    padding: 1rem 2rem;
    margin: 0.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: white;
    color: #495057;
}

.nav-pills-custom .nav-link:hover {
    color: #2c5530;
    background: coral;
}

.nav-pills-custom .nav-link.active {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    border-color: #2c5530;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 85, 48, 0.4);
}

/* ========== CATEGORY HEADER ========== */
.category-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 1rem;
    margin-top: 3rem !important;
}

.category-header h3 {
    color: #2c5530;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

.category-header p {
    font-size: 1.1rem;
    color: #6c757d;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== SUBCATEGORY GRID ========== */
.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.subcategory-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.subcategory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.subcategory-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 85, 48, 0.1), transparent);
    transition: left 0.6s;
}

.subcategory-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #2c5530;
}

.subcategory-card:hover::before {
    transform: scaleX(1);
}

.subcategory-card:hover::after {
    left: 100%;
}

.subcategory-icon {
    font-size: 3rem;
    color: #2c5530;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.subcategory-card:hover .subcategory-icon {
    transform: scale(1.1) rotate(5deg);
    color: #4a7c59;
}

.subcategory-card h4 {
    color: #2d3748;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    line-height: 1.3;
    position: relative;
    z-index: 2;
}

.subcategory-card p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
    flex-grow: 1;
    position: relative;
    z-index: 2;
}

/* ========== TEST ACTIONS ========== */
.test-actions {
    display: flex;
    gap: 1rem;
    margin-top: auto;
    position: relative;
    z-index: 2;
}

.btn-test {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-test::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.btn-test:hover::before {
    left: 100%;
}

.practice-test {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.practice-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

.exam-test {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.exam-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.4);
    color: white;
}

/* Loading state for buttons */
.btn-test.loading {
    opacity: 0.8;
    pointer-events: none;
}

.btn-test.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== BACK TO CATEGORIES BUTTON ========== */
#backButtonContainer {
    margin: 2rem 0;
    padding: 0 1rem;
    text-align: center;
}

.back-to-categories {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.back-to-categories::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.back-to-categories:hover {
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(44, 85, 48, 0.4);
}

.back-to-categories:hover::before {
    left: 100%;
}

/* ========== TEST COUNT BADGES ========== */
.tests-count {
    font-weight: 600;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ========== TAB CONTENT ANIMATIONS ========== */
.tab-pane {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== SUBCATEGORY TITLE ========== */
.subcategory-title {
    color: #2c5530;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    border-bottom: 3px solid;
    border-image: linear-gradient(135deg, #2c5530, #4a7c59) 1;
    padding-bottom: 0.75rem;
    display: inline-block;
}

/* ========== TESTS GRID (For Future Use) ========== */
.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    padding: 0 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.test-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
    transition: all 0.3s ease;
    position: relative;
}

.test-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.test-header {
    padding: 1.5rem;
    border-bottom: 1px solid #eaeaea;
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.test-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.test-description {
    opacity: 0.95;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.test-body {
    padding: 1.5rem;
}

.test-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.meta-item i {
    width: 16px;
    color: #2c5530;
    font-size: 1rem;
}

.test-action-btn {
    flex: 1;
    background: #2c5530;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.test-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.test-action-btn:hover {
    background: #4a7c59;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 85, 48, 0.4);
}

.test-action-btn:hover::before {
    left: 100%;
}

.test-action-btn.secondary {
    background: #6c757d;
}

.test-action-btn.secondary:hover {
    background: #5a6268;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #245027 0%, #3e6a4a 100%);
}

/* ========== UTILITY CLASSES ========== */
.hidden {
    display: none !important;
}

.text-gold {
    color: #ffd700 !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .subcategory-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .tests-hero {
        padding: 80px 0 40px;
    }
    
    .tests-hero h1 {
        font-size: 2.5rem;
    }
    
    .tests-hero .lead {
        font-size: 1.1rem;
    }
    
    .category-header h3 {
        font-size: 1.8rem;
    }
    
    .subcategory-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .subcategory-card {
        padding: 1.5rem;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .nav-pills-custom {
        flex-direction: column;
        border-radius: 12px;
        padding: 8px;
    }
    
    .nav-pills-custom .nav-link {
        margin: 2px 0;
        text-align: center;
    }
    
    .test-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-test {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .test-meta {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .back-to-categories {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .tests-hero {
        padding: 60px 0 30px;
    }
    
    .tests-hero h1 {
        font-size: 2rem;
    }
    
    .tests-hero .lead {
        font-size: 1rem;
    }
    
    .category-header h3 {
        font-size: 1.5rem;
    }
    
    .category-header p {
        font-size: 0.95rem;
    }
    
    .subcategory-card {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .subcategory-icon {
        font-size: 2.5rem;
    }
    
    .subcategory-card h4 {
        font-size: 1.1rem;
    }
    
    .test-card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .test-header {
        padding: 1.25rem;
    }
    
    .test-body {
        padding: 1.25rem;
    }
    
    .nav-pills-custom .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    .subcategory-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    .subcategory-grid {
        grid-template-columns: 1fr;
    }
    
    .tests-grid {
        grid-template-columns: 1fr;
    }
    
    .test-actions {
        flex-direction: column;
    }
    
    .btn-test {
        width: 100%;
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .subcategory-card:hover {
        transform: none;
    }
    
    .btn-test:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .subcategory-card {
        border: 2px solid #000;
    }
    
    .nav-pills-custom .nav-link.active {
        background: #000;
        color: #fff;
    }
}