/* Compare Page Styles */

.page-header {
    background: linear-gradient(to bottom, var(--bg-body), var(--bg-card));
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.compare-container {
    padding: 40px 20px;
    min-height: 60vh;
}

.compare-step {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease-out;
}

.compare-step.hidden {
    display: none;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-header h3 {
    font-size: 1.25rem;
    margin: 0;
    flex: 1;
}

.step-instruction {
    color: var(--text-muted);
    margin-bottom: 24px;
    margin-left: 48px;
}

/* Category Selection */
.category-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-left: 48px;
}

.category-select-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.category-select-card:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Tools Selection */
.tools-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-left: 48px;
    margin-bottom: 30px;
}

.tool-checkbox-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.tool-checkbox-card:hover {
    background: var(--bg-card-hover);
}

.tool-checkbox-card.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.tool-checkbox-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.step-actions {
    margin-left: 48px;
    display: flex;
    gap: 16px;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    /* Ensure horizontal scroll on mobile */
}

.comparison-table th,
.comparison-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    vertical-align: top;
}

.comparison-table th:last-child,
.comparison-table td:last-child {
    border-right: none;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

/* Sticky First Column (Labels) */
.comparison-table th:first-child,
.comparison-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--bg-card);
    z-index: 10;
    font-weight: 600;
    color: var(--text-muted);
    width: 200px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

/* Table Headers (Tool Names) */
.comparison-table thead th {
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 5;
}

.comparison-table thead th:first-child {
    z-index: 15;
    /* Higher z-index for top-left corner */
    background: var(--bg-card);
}

.comparison-table .tool-header-cell h4 {
    margin: 0 0 8px 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.comparison-table .tool-header-cell .remove-tool-btn {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.comparison-table .tool-header-cell .remove-tool-btn:hover {
    color: #ef4444;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .step-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .step-number {
        margin-top: 4px;
    }

    .category-selection-grid,
    .tools-selection-grid,
    .step-instruction,
    .step-actions {
        margin-left: 0;
    }

    .comparison-table th:first-child,
    .comparison-table td:first-child {
        width: 120px;
        font-size: 0.9rem;
    }
}