/* ============================================
   TOOL CARD - STRICT 6-ROW LAYOUT (LOCKED)
   ============================================ */

.bfai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-6, 24px);
    width: 100%;
}

.bfai-tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    background: var(--bg-surface, #1e1e2e);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 12px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    position: relative;
    box-sizing: border-box;
}

.bfai-tool-card:hover {
    border-color: var(--border-default, rgba(255, 255, 255, 0.2));
    box-shadow: var(--shadow-card-hover, 0 8px 30px rgba(0, 0, 0, 0.3));
    transform: translateY(-3px);
}

/* --- Row 1: Trust + Utility --- */
.card-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 24px;
    margin-bottom: 4px;
}

.row-1-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Trending / New Badge (Row 1) */
.trending-badge-label {
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    /* Amber 500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(245, 158, 11, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.new-badge-label {
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #10b981;
    /* Emerald 500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.verified-badge-label {
    /* Kept for reference but moved in HTML */
    display: flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.row-1-right {
    display: flex;
    align-items: center;
}

.save-btn-row1 {
    background: transparent;
    border: none;
    color: var(--text-dim, #64748b);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.save-btn-row1:hover {
    color: var(--text-primary, #ffffff);
    background: rgba(255, 255, 255, 0.05);
}

.save-btn-row1.saved {
    color: var(--brand-primary, #a855f7);
}

/* --- Row 2: Identity --- */
.card-row-2 {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.row-2-logo-link {
    flex-shrink: 0;
    text-decoration: none;
}

.tool-logo-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: visible;
    /* To allow verified overlay */
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    background: var(--bg-base, #11111b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.verified-icon-overlay {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #3b82f6;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-surface, #1e1e2e);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

[data-theme="light"] .verified-icon-overlay {
    border-color: #ffffff;
}

.tool-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-logo-placeholder {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    background: var(--brand-gradient, linear-gradient(135deg, #a855f7, #3b82f6));
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.row-2-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    /* Text truncation fix */
    gap: 4px;
}

.tool-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rating-stars-interactive {
    display: flex;
    gap: 1px;
}

.rating-stars-interactive .star-btn {
    padding: 0;
    width: 14px;
    height: 14px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-stars-interactive .star-btn svg {
    width: 10px;
    height: 10px;
}

.rating-stats {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

/* --- Row 3: Value Metrics --- */
.card-row-3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    height: 34px;
    /* Explicit height */
}

.row-3-left .pricing-text {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

/* ALL PRICING MODELS (Green) */
.row-3-left .pricing-text.free,
.row-3-left .pricing-text.freemium,
.row-3-left .pricing-text.paid,
.row-3-left .pricing-text.deal,
.row-3-left .pricing-text.contact {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.row-3-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim, #64748b);
    font-weight: 500;
}

/* --- Row 4: Description --- */
.card-row-4 {
    min-height: 40px;
    /* Fixed height for 2 lines */
    overflow: hidden;
    margin-bottom: 8px;
}

.tool-description {
    font-size: 14px !important;
    line-height: 1.35 !important;
    color: var(--text-muted, #94a3b8) !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Row 5: Tags --- */
.card-row-5 {
    display: flex;
    align-items: center;
    gap: 1px;
    min-height: 20px;
    overflow: hidden;
    margin-bottom: 4px;
}

.hashtag {
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    background: transparent;
    padding: 2px 4px;
    border-radius: 4px;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.hashtag:hover {
    color: #a855f7;
    background: transparent;
    text-decoration: underline;
}

/* --- Row 6: Action Zone --- */
.card-row-6 {
    display: flex;
    margin-top: auto;
    padding-top: 12px;
    width: 100%;
}

.bfai-tool-card .featured-badge {
    background-color: #f59e0b !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.25);
    line-height: 1;
    border: none !important;
}

.bfai-tool-card .featured-badge svg,
.bfai-tool-card .featured-badge .badge-icon {
    color: #ffffff !important;
    margin-right: 3px;
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}

/* Row 6 left: badge container */
.row-6-left {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Badge icon spacing (replaces inline margin-right:3px) */
.badge-icon {
    margin-right: 3px;
    flex-shrink: 0;
}

/* Verified badge compact (replaces inline style block) */
.verified-badge-label.compact-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #3b82f6;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
}



.trending-badge-label,
.new-badge-label {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trending-badge-label {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    /* Red gradient */
    color: #fff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.new-badge-label {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    /* Green gradient */
    color: #fff;
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    background: var(--brand-gradient, linear-gradient(135deg, #a855f7 0%, #7c3aed 100%));
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: none;
}

/* Coupon & Action Wrapper */
.card-actions-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.coupon-action {
    width: 100%;
}

.coupon-copy-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 6px 10px;
    background: rgba(168, 85, 247, 0.05); /* brand-primary with alpha */
    border: 1px dashed var(--brand-primary, #a855f7);
    border-radius: 8px;
    color: var(--text-primary, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* Variant for Single Hero / Inline display */
.coupon-copy-btn.single-hero-coupon {
    width: auto;
    display: inline-flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    height: 34px; /* Match pricing pill height */
}

[data-theme="light"] .coupon-copy-btn {
    background: rgba(168, 85, 247, 0.03);
    color: var(--text-primary);
}

.coupon-copy-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    border-style: solid;
}

.coupon-icon {
    color: var(--brand-primary, #a855f7);
    display: flex;
    align-items: center;
}

.coupon-code-text {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-primary);
}

.copy-hint {
    font-size: 9px;
    font-weight: 800;
    color: var(--brand-primary, #a855f7);
    background: rgba(168, 85, 247, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coupon-copy-btn.copied {
    border-color: #10b981; /* accent-success */
    border-style: solid;
}

.coupon-copy-btn.copied .copy-hint {
    background: #10b981;
    color: #fff;
}

.visit-btn:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* --- Mobile Rules (Parity) --- */
@media (max-width: 640px) {
    .bfai-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .bfai-tool-card {
        padding: 14px;
        gap: 6px;
    }

    .card-row-6 {
        padding-top: 10px;
    }

    .visit-btn {
        padding: 10px 14px !important;
        font-size: 10px !important;
        letter-spacing: 0.2px;
    }
}

