/* ========== FLOATING COMPARISON BAR ========== */
.comparison-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid rgba(124, 58, 237, 0.3);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.comparison-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.comparison-slots {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1;
}

.comparison-slot {
    flex: 1;
    max-width: 220px;
}

.slot-empty {
    border: 1px dashed rgba(124, 58, 237, 0.3);
    border-radius: 8px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    background: rgba(124, 58, 237, 0.02);
    min-width: 180px;
}

.slot-empty:hover {
    border-color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
}

.slot-empty i {
    font-size: 16px;
    color: #7C3AED;
    opacity: 0.6;
}

.slot-empty span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.slot-filled {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.25);
    border-radius: 8px;
    padding: 6px 12px 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    animation: popIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.slot-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #EF4444;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
}

.slot-remove:hover {
    transform: scale(1.1);
}

.slot-image {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.slot-info {
    flex: 1;
    min-width: 0;
}

.slot-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.slot-category {
    display: none;
}

.comparison-vs {
    color: #7C3AED;
    font-weight: 800;
    font-size: 14px;
    padding: 4px 8px;
    flex-shrink: 0;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.compare-now-btn {
    background: #7C3AED;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.compare-now-btn:hover:not(:disabled) {
    background: #6D28D9;
}

.compare-now-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.compare-now-btn i {
    display: none;
}

.comparison-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.comparison-close:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Selected Tool State */
.tool-card-v2.is-comparing,
.tool-card.is-comparing {
    border-color: #7C3AED !important;
    background: rgba(124, 58, 237, 0.03);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.tool-card-v2.is-comparing .compare-btn,
.tool-card.is-comparing .compare-btn {
    background: #10B981;
    color: white !important;
    border-color: #10B981;
}

/* =========================================
   MOBILE PROFESIONAL REDESIGN
   ========================================= */
@media (max-width: 768px) {
    .comparison-bar {
        padding: 0;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        background: rgba(255, 255, 255, 0.98);
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
    }

    /* Dark Mode Mobile Bar */
    html.dark .comparison-bar {
        background: #111827;
        /* Solid dark for clear contrast */
        border-top: 1px solid #374151;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    }

    .comparison-container {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .comparison-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin-bottom: 8px;
    }

    .comparison-slots {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .comparison-slot {
        width: 100%;
        max-width: 100%;
        position: relative;
        /* Contain absolute children */
    }

    /* Professional Filled Slot */
    .slot-filled {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 10px 12px;
        min-height: 60px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        /* Flex fix */
    }

    html.dark .slot-filled {
        background: #1f2937;
        border-color: #374151;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }

    .slot-image {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .slot-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .slot-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: #111827;
        padding: 0;
        max-width: none;
        margin-bottom: 2px;
    }

    html.dark .slot-name {
        color: #f3f4f6;
    }

    .slot-category {
        display: block;
        font-size: 0.75rem;
        color: #6b7280;
    }

    html.dark .slot-category {
        color: #9ca3af;
    }

    /* Fixed Circular Remove Button */
    .slot-remove {
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
        /* Center vertically */
        width: 32px;
        height: 32px;
        min-width: 32px;
        /* Force circle */
        min-height: 32px;
        /* Force circle */
        border-radius: 50%;
        background: #fee2e2;
        color: #ef4444;
        border: 1px solid #fecaca;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        z-index: 10;
        box-shadow: none;
        transition: all 0.2s;
    }

    html.dark .slot-remove {
        background: rgba(239, 68, 68, 0.15);
        border-color: rgba(239, 68, 68, 0.3);
        color: #ef4444;
    }

    .slot-remove:hover {
        background: #ef4444;
        color: white;
        transform: translateY(-50%) scale(1.1);
        /* Maintain centering */
    }

    /* VS Badge styling for mobile */
    .comparison-vs {
        align-self: center;
        background: #f3f4f6;
        color: #6b7280;
        font-size: 0.75rem;
        padding: 4px 12px;
        border-radius: 20px;
        font-weight: 700;
        margin: -6px 0;
        /* Pull items closer properly */
        z-index: 5;
    }

    html.dark .comparison-vs {
        background: #374151;
        color: #9ca3af;
    }

    .compare-now-btn {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
        border-radius: 12px;
        background: linear-gradient(135deg, #7c3aed, #6d28d9);
        box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
        margin-top: 8px;
    }
}