/* =========================================
   What We Test - Specific Styles (tests.css)
   Inherits global CSS from styles.css
   ========================================= */

/* --- Hero Section --- */
.tests-hero {
    background-color: var(--base-color);
    padding: 10rem 5% 4rem 5%;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tests-hero-container {
    max-width: 1000px; /* Increased from 800px */
    margin: 0 auto;
}

.tests-hero h1 {
    font-size: min(10vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.tests-hero h1 em {
    font-family: var(--accent-font);
    font-style: italic;
    font-weight: 300;
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .tests-hero h1 {
        font-size: 3rem;
    }
}

.tests-hero p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--second-color);
    margin-bottom: 2.5rem;
    opacity: 0.85;
    max-width: 650px;
    margin-inline: auto;
}

/* --- Directory Layout --- */
html, body {
    overflow-x: visible !important;
}

.tests-directory-container {
    background-color: #f7f3ed;
    /* Slightly darker than base for contrast */
    padding: 80px 4%;
}

.directory-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 64px;
    align-items: start;
}

/* --- Sidebar --- */
.directory-sidebar {
    position: sticky;
    top: 100px;
    height: max-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
}

.sidebar-sticky {
    /* Kept for inner wrapper if needed, but sticky is moved to parent */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-sticky::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* Search Box */
.search-container {
    position: relative;
    margin-bottom: 32px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    padding: 16px 20px 16px 48px;
    font-size: 1rem;
    color: var(--secondary-color);
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(204, 107, 79, 0.1);
}

/* Sidebar Menu */
.sidebar-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-muted);
    margin-bottom: 16px;
    padding-left: 12px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.03);
    opacity: 1;
}

.sidebar-link.active {
    background: var(--white);
    color: var(--accent-color);
    opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* --- Main Content --- */
.category-section {
    margin-bottom: 80px;
}

.category-title {
    font-size: 2rem;
    font-weight: 500;
    color: var(--secondary-color);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.category-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.about-category-link {
    font-size: 0.95rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: none;
    outline: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.about-category-link:hover {
    color: var(--secondary-color);
}

.about-category-link .plus-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(204, 107, 79, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-category-link:hover .plus-icon {
    background: rgba(204, 107, 79, 0.2);
}

.about-category-link.active .plus-icon {
    transform: rotate(45deg);
    background: var(--accent-color);
    color: var(--white);
}

.about-category-content {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    padding: 0 20px;
    margin-bottom: 0;
    color: var(--secondary-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-category-content.show {
    max-height: 300px;
    padding: 16px 20px;
    margin-bottom: 24px;
    opacity: 1;
}

/* --- Accordion Components --- */
.accordion-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.accordion-item {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

.test-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.accordion-item.active .test-title {
    color: var(--accent-color);
}

.test-short-desc {
    font-size: 0.95rem;
    color: var(--secondary-muted);
    line-height: 1.5;
    max-width: 90%;
}

/* Icons */
.accordion-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--base-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.accordion-item.active .accordion-icon {
    background: var(--accent-color);
    color: var(--white);
}

.plus-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.accordion-item.active .plus-icon {
    transform: rotate(45deg);
}

/* Accordion Body Extracted Data */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.accordion-content {
    padding: 0 32px 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 16px;
    padding-top: 24px;
}

.test-detail-row {
    margin-bottom: 20px;
}

.test-detail-row:last-child {
    margin-bottom: 0;
}

.test-detail-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-muted);
    margin-bottom: 6px;
}

.test-detail-value {
    font-size: 1.05rem;
    color: var(--secondary-color);
    line-height: 1.6;
}

.font-medium {
    font-weight: 600;
    color: var(--secondary-color);
}

/* --- Search Empty State --- */
.no-results-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
    color: var(--secondary-muted);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 20px;
    margin-top: 24px;
}

.no-results-icon {
    color: var(--secondary-muted);
    opacity: 0.5;
    margin-bottom: 20px;
}

.no-results-message h3 {
    color: var(--secondary-color);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.no-results-message p {
    font-size: 0.95rem;
    max-width: 320px;
    line-height: 1.5;
}

/* --- Tests CTA Section --- */
.tests-cta {
    background-color: var(--white);
    padding: 120px 4%;
    text-align: center;
}

.tests-cta .cta-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    letter-spacing: -1px;
    margin-bottom: 40px;
    color: var(--secondary-color);
}


/* --- Responsive Mobile Layout --- */
@media (max-width: 992px) {
    .directory-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .sidebar-sticky {
        position: static;
        max-height: none;
        overflow-y: visible;
    }

    /* Convert sidebar into horizontal scrollable chips */
    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 16px;
        scrollbar-width: none;
    }

    .sidebar-link {
        white-space: nowrap;
        background: rgba(0, 0, 0, 0.04);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .sidebar-link.active {
        background: var(--accent-color);
        color: var(--white);
    }

    .accordion-header {
        padding: 20px;
    }

    .accordion-content {
        padding: 0 20px 20px;
    }
}