/*
 * THE ASSIST V2 — TOOL LIBRARY PAGE
 * File: /assets/css/tool-library.css
 *
 * Styles for the filterable AI Tools table page.
 * WPBakery class equivalent: this whole page is a PHP template
 * (template-tool-library.php), not a WPBakery page — too interactive.
 *
 * Table of Contents:
 *  1. Filter Tag Row
 *  2. Active Filter Pill
 *  3. Sort + Search Controls
 *  4. Table
 *  5. Tool Category Tag Colors
 *  6. Pagination
 *  7. Responsive
 */


/* 1. FILTER TAG ROW
   */

.ta-tool-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

/* "Most Popular" gets a star + teal fill when active to match the design */
.ta-tool-filters .ta-filter-tab[data-filter="most-popular"].is-active {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}


/* 2. ACTIVE FILTER PILL
   (shows e.g. "Educators ×" below the tag row when a category is picked) */

.ta-active-filter-row {
    min-height: 0;
    margin-bottom: var(--space-4);
}

.ta-active-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-teal);
    color: var(--color-white);
    border-radius: var(--radius-pill);
    padding: 6px 8px 6px 16px;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
}

.ta-active-filter-pill button {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: var(--color-white);
    width: 20px;
    height: 20px;
    border-radius: var(--radius-circle);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.ta-active-filter-pill button:hover {
    background: rgba(255, 255, 255, 0.4);
}


/* 3. SORT + SEARCH CONTROLS */

.ta-tool-controls {
    margin-bottom: var(--space-6);
}

.ta-sort-select {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-text-body);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-pill);
    padding: 10px 36px 10px 16px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: border-color var(--transition-fast);
}

.ta-sort-select:focus {
    border-color: var(--color-teal);
}

.ta-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}


/* 4. TABLE */

.ta-tool-table-wrap {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.ta-tool-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-white);
}

.ta-tool-table thead th {
    background: var(--color-navy);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    text-align: left;
    padding: 14px 20px;
    white-space: nowrap;
}

.ta-sort-arrow {
    opacity: 0.6;
    margin-left: 4px;
    font-size: 0.8em;
}

.ta-tool-table tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--transition-fast);
}

.ta-tool-table tbody tr:nth-child(even) {
    background: var(--color-teal-light);
}

.ta-tool-table tbody tr:hover {
    background: var(--color-gray-100);
}

.ta-tool-table tbody tr.ta-row-hidden {
    display: none;
}

.ta-tool-table td {
    padding: 16px 20px;
    vertical-align: middle;
    font-size: var(--text-sm);
}

.ta-col-name {
    width: 180px;
}

.ta-tool-name-text {
    font-weight: var(--weight-bold);
    color: var(--color-teal-dark);
}

.ta-col-logo {
    width: 60px;
}

.ta-tool-row__logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--color-gray-50);
    padding: 4px;
    display: block;
}

.ta-tool-row__logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gray-400);
}

.ta-col-type {
    width: 220px;
}

.ta-col-type .ta-tool-tag {
    margin-right: 4px;
    margin-bottom: 4px;
}

.ta-col-desc {
    color: var(--color-text-body);
    line-height: var(--leading-normal);
    max-width: 320px;
}

.ta-col-best {
    color: var(--color-text-muted);
    width: 160px;
}

.ta-col-action {
    width: 130px;
    text-align: right;
}

.ta-tool-empty {
    text-align: center;
    padding: var(--space-12) !important;
    color: var(--color-text-muted);
}


/* 5. TOOL CATEGORY TAG COLORS
   Rotates through 6 palette colors based on slug hash*/

.ta-tool-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    white-space: nowrap;
}

.ta-tag-color-1 { background: var(--color-teal-light);    color: var(--color-teal-dark); }
.ta-tag-color-2 { background: var(--color-pink-light);    color: var(--color-pink-dark); }
.ta-tag-color-3 { background: var(--color-purple-light);  color: var(--color-purple-dark); }
.ta-tag-color-4 { background: var(--color-orange-light);  color: #B86A00; }
.ta-tag-color-5 { background: var(--color-green-light);   color: #2D7A2D; }
.ta-tag-color-6 { background: var(--color-gray-100);      color: var(--color-gray-600); }


/* 6. PAGINATION */

.ta-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.ta-pagination__count {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.ta-pagination__controls {
    display: flex;
    gap: var(--space-2);
}

.ta-pagination__btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-gray-300);
    background: var(--color-white);
    color: var(--color-text-body);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.ta-pagination__btn:hover:not(:disabled) {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: var(--color-white);
}

.ta-pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ta-tool-no-results {
    padding: var(--space-12);
    text-align: center;
    color: var(--color-text-muted);
    background: var(--color-white);
}


/* 7. RESPONSIVE */

@media (max-width: 1024px) {
    .ta-col-best { display: none; }
}

@media (max-width: 768px) {
    .ta-tool-controls {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
    }

    .ta-search__input {
        width: 100%;
    }

    .ta-search__input:focus {
        width: 100%;
    }

    .ta-tool-table-wrap {
        overflow-x: auto;
    }

    .ta-tool-table {
        min-width: 640px;
    }

    .ta-pagination {
        justify-content: center;
    }
}
