/**
 * TLB Tool Cross-Promotion — Sidebar, related tools grid, post-result widget, workflow.
 *
 * Mirrors CdS tool-sidebar.css + tool-ecosystem-widget.css pattern.
 * Classes: .tlb-tool-flex, .tlb-tool-sidebar, .tsl-*, .tlb-tew-*, .tlb-wf-*, .tlb-xp-*
 * Theme: TLB blue (--diario-primary: #1565c0)
 *
 * @since 2026-03-14
 */

/* ==========================================================================
   DESKTOP FLEX LAYOUT (sidebar LEFT + tool RIGHT — like CdS)
   ========================================================================== */
.tlb-tool-flex {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.tlb-tool-main {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   LEFT SIDEBAR (280px sticky — mirrors CdS .tool-sidebar)
   ========================================================================== */
.tlb-tool-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 4px;
}

.tlb-tool-sidebar::-webkit-scrollbar {
    width: 4px;
}
.tlb-tool-sidebar::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
}

/* --- Social Proof (top of sidebar) --- */
.tsl-social-proof {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tsl-social-proof strong {
    font-weight: 700;
    color: #1e293b;
}

/* --- Sidebar sections --- */
.tsl-section {
    margin-bottom: 18px;
}

.tsl-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin: 0 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

/* --- Tool links (no border, hover bg + translateX) --- */
.tsl-tool-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.15s, transform 0.1s;
    margin-bottom: 6px;
}
.tsl-tool-link:hover {
    background: #f1f5f9;
    transform: translateX(2px);
    color: #1e293b;
    text-decoration: none;
}

.tsl-tool-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}
.tsl-tool-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: #e3f2fd;
    color: #1565c0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}

.tsl-tool-info {
    flex: 1;
    min-width: 0;
}
.tsl-tool-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    line-height: 1.3;
}
.tsl-tool-context {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.35;
    margin: 0;
}

/* --- Sidebar workflow steps --- */
.tsl-wf-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tsl-wf-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}

.tsl-wf-step--current {
    background: #1565c0;
    color: #fff;
}

.tsl-wf-step--used {
    background: #e8f5e9;
    color: #2e7d32;
}
a.tsl-wf-step--used:hover {
    background: #c8e6c9;
    color: #1b5e20;
    text-decoration: none;
    transform: translateX(2px);
}

.tsl-wf-step--pending {
    color: #94a3b8;
}
a.tsl-wf-step--pending:hover {
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transform: translateX(2px);
}

.tsl-wf-step i {
    font-size: 0.7rem;
}

/* --- Sidebar tank teaser --- */
.tsl-tank-widget {
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border: 1px solid #b3e5fc;
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

.tsl-tank-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0d47a1;
    margin: 0 0 8px 0;
}

.tsl-tank-stat {
    font-size: 0.78rem;
    color: #1565c0;
    margin: 0 0 4px 0;
}

.tsl-tank-cta {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #1565c0;
    color: #fff;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.tsl-tank-cta:hover {
    background: #0d47a1;
    color: #fff;
}

/* --- Browse all tools link --- */
.tsl-all-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.tsl-all-tools:hover {
    background: #f1f5f9;
    color: #1565c0;
    text-decoration: none;
}

/* ==========================================================================
   POST-RESULT ECOSYSTEM WIDGET (full-width, below flex layout)
   ========================================================================== */
.tlb-tew {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    animation: tlbTewFadeIn 0.4s ease;
}

.tlb-tew-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1565c0;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tlb-tew-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.tlb-tew-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}

.tlb-tew-card:hover {
    border-color: #1565c0;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
    transform: translateY(-1px);
    color: #1e293b;
    text-decoration: none;
}

.tlb-tew-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #e3f2fd;
    color: #1565c0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.tlb-tew-card-body {
    flex: 1;
    min-width: 0;
}

.tlb-tew-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 3px 0;
    line-height: 1.3;
}

.tlb-tew-card-desc {
    font-size: 0.76rem;
    color: #64748b;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.tlb-tew-card-cta {
    font-size: 0.74rem;
    font-weight: 600;
    color: #1565c0;
}

/* ==========================================================================
   RELATED TOOLS GRID (full-width section, below flex — like CdS "Explore Também")
   ========================================================================== */
.tlb-xp-related {
    margin-top: 32px;
    padding: 24px 0;
}

.tlb-xp-related-header {
    margin-bottom: 20px;
}

.tlb-xp-related-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.tlb-xp-related-subtitle {
    font-size: 0.88rem;
    color: #64748b;
    margin: 0;
}

.tlb-xp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.tlb-xp-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tlb-xp-tool-card:hover {
    border-color: #1565c0;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.1);
    transform: translateY(-2px);
    color: #1e293b;
    text-decoration: none;
}

.tlb-xp-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #e3f2fd;
    color: #1565c0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tlb-xp-tool-card img.tlb-xp-tool-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}

.tlb-xp-tool-body {
    flex: 1;
    min-width: 0;
}

.tlb-xp-tool-name {
    font-size: 0.92rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.tlb-xp-tool-context {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.tlb-xp-tool-cta {
    font-size: 0.78rem;
    font-weight: 600;
    color: #1565c0;
}

.tlb-xp-tool-cta .tlb-xp-cta-arrow {
    display: inline-block;
    transition: transform 0.15s;
}
.tlb-xp-tool-card:hover .tlb-xp-cta-arrow {
    transform: translateX(3px);
}

/* ==========================================================================
   WORKFLOW PROGRESS (mobile inline / sidebar uses tsl-wf-*)
   ========================================================================== */
.tlb-wf {
    margin-top: 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.tlb-wf-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tlb-wf-steps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tlb-wf-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    border: 1px solid transparent;
}

.tlb-wf-step--current {
    background: #1565c0;
    color: #fff;
    border-color: #1565c0;
}

.tlb-wf-step--used {
    background: #e8f5e9;
    color: #2e7d32;
    border-color: #c8e6c9;
}

a.tlb-wf-step--used:hover {
    background: #c8e6c9;
    color: #1b5e20;
    text-decoration: none;
}

.tlb-wf-step--pending {
    background: #f5f5f5;
    color: #9e9e9e;
    border-color: #e0e0e0;
}

a.tlb-wf-step--pending:hover {
    background: #eeeeee;
    color: #616161;
    text-decoration: none;
    transform: translateY(-1px);
}

.tlb-wf-step i {
    font-size: 0.7rem;
}

/* ==========================================================================
   TANK TEASER (mobile inline)
   ========================================================================== */
.tlb-xp-tank {
    margin-top: 16px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #e3f2fd 0%, #e1f5fe 100%);
    border: 1px solid #b3e5fc;
    border-radius: 10px;
}

.tlb-xp-tank-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0d47a1;
    margin: 0 0 8px 0;
}

.tlb-xp-tank-stat {
    font-size: 0.78rem;
    color: #1565c0;
    margin: 0 0 4px 0;
}

.tlb-xp-tank-cta {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #1565c0;
    color: #fff;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}

.tlb-xp-tank-cta:hover {
    background: #0d47a1;
    color: #fff;
}

/* ==========================================================================
   SOCIAL PROOF BADGE (mobile inline)
   ========================================================================== */
.tlb-xp-stats {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #475569;
    margin-bottom: 8px;
}

.tlb-xp-stats strong {
    color: #1e293b;
    font-weight: 700;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes tlbTewFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    .tlb-tool-sidebar {
        display: none !important;
    }
    .tlb-tool-flex {
        display: block;
    }
}

@media (max-width: 768px) {
    .tlb-xp-related-grid,
    .tlb-tew-cards {
        grid-template-columns: 1fr;
    }

    .tlb-xp-related {
        padding: 16px 0;
    }

    .tlb-tew {
        padding: 16px;
    }

    .tlb-wf-steps {
        gap: 6px;
    }

    .tlb-wf-step {
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}
