/* Tool Comparison Styles */

.tc-selector {
    max-width: 100%;
}

.tc-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tc-cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--moss);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tc-cat-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tc-cat-tab.active {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.tc-cat-icon {
    font-size: 1rem;
}

.tc-cat-count {
    background: var(--muted);
    color: var(--moss);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.tc-cat-tab.active .tc-cat-count {
    background: var(--primary);
    color: var(--primary-contrast);
}

.tc-tools-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tc-tools-grid.active {
    display: grid;
}

.tc-tool-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.tc-tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.tc-tool-card.selected {
    border-color: var(--primary);
    background: var(--primary-bg);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.tc-tool-card.selected::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-contrast);
    font-size: 0.75rem;
    font-weight: 700;
}

.tc-tool-card__header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.tc-tool-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.tc-tool-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.3;
    margin: 0;
}

.tc-tool-desc {
    font-size: 0.85rem;
    color: var(--moss);
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.tc-tool-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tc-tool-category {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--muted);
    color: var(--moss);
}

.tc-selected-bar {
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    position: sticky;
    bottom: 1rem;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.tc-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 2rem;
}

.tc-selected-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--card-bg);
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.75rem 0.35rem 0.5rem;
    font-size: 0.8rem;
    color: var(--ink);
}

.tc-selected-item__remove {
    background: var(--primary);
    color: var(--primary-contrast);
    border: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    transition: opacity var(--transition-fast);
}

.tc-selected-item__remove:hover {
    opacity: 0.8;
}

.tc-selected-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.tc-selected-actions .btn {
    white-space: nowrap;
}

.tc-comparison-view {
    animation: tc-fade-in 0.3s ease;
}

@keyframes tc-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tc-comparison-table-wrapper {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.tc-comparison-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.tc-comparison-table th,
.tc-comparison-table td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
}

.tc-comparison-table thead th {
    background: var(--muted);
    font-weight: 600;
    color: var(--ink);
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
}

.tc-comparison-table tbody th {
    background: var(--muted);
    font-weight: 500;
    color: var(--moss);
    width: 160px;
    position: sticky;
    left: 0;
    z-index: 3;
}

.tc-row-header-row td {
    background: var(--primary-bg);
    font-weight: 600;
    color: var(--primary);
    border-top: 2px solid var(--primary-border);
}

.tc-section-header {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    font-weight: 600;
    padding: 0.5rem 1rem !important;
}

.tc-tool-col {
    min-width: 200px;
    max-width: 280px;
}

.tc-col-placeholder {
    color: var(--moss);
    font-style: italic;
    text-align: center;
    padding: 2rem 1rem;
}

.tc-name-cell {
    font-weight: 600;
    color: var(--ink);
}

.tc-name-cell::before {
    content: attr(data-icon) ' ';
    font-size: 1.25rem;
}

.tc-action-cell {
    text-align: center;
}

.tc-action-cell .btn {
    width: 100%;
    max-width: 180px;
}

.tc-why-cell,
.tc-faqs-cell,
.tc-howto-cell {
    font-size: 0.8rem;
    line-height: 1.5;
}

.tc-why-cell ul,
.tc-faqs-cell ul,
.tc-howto-cell ol {
    margin: 0;
    padding-left: 1.25rem;
}

.tc-why-cell li,
.tc-faqs-cell li,
.tc-howto-cell li {
    margin-bottom: 0.35rem;
}

.tc-faqs-cell .tc-faq-q {
    font-weight: 600;
    color: var(--ink);
}

.tc-faqs-cell .tc-faq-a {
    color: var(--moss);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.tc-howto-cell .tc-step {
    font-weight: 500;
    color: var(--ink);
}

.tc-howto-cell .tc-step-desc {
    color: var(--moss);
    font-size: 0.75rem;
    margin-top: 0.1rem;
}

.tc-export-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 1024px) {
    .tc-tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .tc-comparison-table-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .tc-category-tabs {
        justify-content: flex-start;
    }

    .tc-tools-grid {
        grid-template-columns: 1fr;
    }

    .tc-comparison-table th,
    .tc-comparison-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .tc-tool-col {
        min-width: 160px;
    }

    .tc-selected-actions {
        flex-direction: column;
    }

    .tc-selected-actions .btn {
        width: 100%;
    }
}