/* =========================================
   compare.css
   Style specific for Compare & Extract Tool
   ========================================= */

/* Step Transitions */
.fade-in {
    animation: fadeInStep 0.4s ease-out forwards;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Clickable Steps */
.step-item.clickable-step {
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-item.clickable-step:hover:not(.active) {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Radio Card UI */
.radio-card:has(input:checked) {
    border-color: #10b981;
    /* brand-500 */
    background-color: rgba(16, 185, 129, 0.05);
}

.radio-card:has(input:checked) .radio-indicator {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='%2310b981' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='4'/%3e%3c/svg%3e");
}

/* Custom Checkbox / Radio styling overrides for dark theme */
input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}

/* File Dropzones */
.file-dropzone-container {
    perspective: 1000px;
}

.target-a {
    border-color: rgba(59, 130, 246, 0.2);
}

.target-a.drag-over {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.15);
}

.target-b {
    border-color: rgba(99, 102, 241, 0.2);
}

.target-b.drag-over {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.15);
}

/* Result Table Customizations */
#preview-table-container {
    overflow-x: auto;
    overflow-y: auto;
}

#result-table th {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
    color: theme('colors.surface.400');
    white-space: nowrap;
}

#result-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: theme('colors.surface.300');
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-match-both {
    background-color: transparent;
}

.row-only-a {
    background-color: rgba(59, 130, 246, 0.05);
}

.row-only-b {
    background-color: rgba(99, 102, 241, 0.05);
}

.col-a {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    /* Unified subtle border */
}

.col-b {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    /* Unified subtle border */
    /* Removed the subtle indigo tint background to match A strictly */
}

.col-divider {
    border-left: 2px solid rgba(255, 255, 255, 0.3) !important;
}

/* Badges inside table */
.badge-a {
    display: inline-block;
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    margin-right: 0.5rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-b {
    display: inline-block;
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    margin-right: 0.5rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Fix sticky header transparency bleed */
#result-thead {
    background-color: #1a1e2e !important;
    /* surface-800 solid */
}

#result-thead th {
    background-color: #1a1e2e !important;
}

/* ========================================
   Excel-style Column Filter Dropdown
   ======================================== */

.col-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    padding: 0;
    flex-shrink: 0;
}

.col-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.col-filter-btn.filter-active {
    background: rgba(16, 185, 129, 0.2);
}

.col-filter-btn.filter-active svg {
    color: #34d399;
}

.col-filter-dropdown {
    position: fixed;
    z-index: 200;
    min-width: 220px;
    max-width: 300px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: filterDropIn 0.15s ease-out;
}

@keyframes filterDropIn {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.col-filter-dropdown .filter-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #0f172a;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-size: 0.75rem;
    outline: none;
}

.col-filter-dropdown .filter-search::placeholder {
    color: #64748b;
}

.col-filter-dropdown .filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.5);
}

.col-filter-dropdown .filter-actions button {
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.2rem 0;
    transition: color 0.15s;
}

.col-filter-dropdown .filter-actions .btn-select-all {
    color: #34d399;
}

.col-filter-dropdown .filter-actions .btn-select-all:hover {
    color: #6ee7b7;
}

.col-filter-dropdown .filter-actions .btn-deselect-all {
    color: #94a3b8;
}

.col-filter-dropdown .filter-actions .btn-deselect-all:hover {
    color: #cbd5e1;
}

.col-filter-dropdown .filter-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.col-filter-dropdown .filter-list::-webkit-scrollbar {
    width: 5px;
}

.col-filter-dropdown .filter-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.col-filter-dropdown .filter-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    font-size: 0.7rem;
    color: #e2e8f0;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-filter-dropdown .filter-list label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.col-filter-dropdown .filter-list input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    accent-color: #10b981;
    flex-shrink: 0;
    cursor: pointer;
}

.col-filter-dropdown .filter-apply {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.col-filter-dropdown .filter-apply button {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.col-filter-dropdown .filter-apply .btn-filter-clear {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
}

.col-filter-dropdown .filter-apply .btn-filter-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.col-filter-dropdown .filter-apply .btn-filter-apply {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.col-filter-dropdown .filter-apply .btn-filter-apply:hover {
    background: rgba(16, 185, 129, 0.3);
}

.filter-empty-msg {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.7rem;
    color: #64748b;
    font-style: italic;
}