/* =============================================
   CONVERSATION SHOWCASE — High-Conversion Chat
   Domus-IA v6.1 · Emotional 8-step flow
   ============================================= */

/* ── Container ── */
.conv-showcase {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e2e8f0);
    box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    background: var(--surface-0, #fff);
}

/* ── Chat header ── */
.conv-showcase-header {
    background: #0f172a;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.conv-showcase-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.conv-showcase-header-left img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.15);
}
.conv-showcase-header-name {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: -0.01em;
}
.conv-showcase-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.conv-showcase-header-status .dot {
    width: 5px;
    height: 5px;
    background: #22c55e;
    border-radius: 50%;
}
.conv-showcase-header-status span {
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    font-weight: 450;
}

/* Progress bar */
.conv-showcase-progress {
    height: 2px;
    background: rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}
.conv-showcase-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #2ec4b6, #3b82f6);
    transition: width 0.6s ease;
    width: 0%;
}

/* ── Messages area ── */
.conv-showcase-messages {
    padding: 20px 18px;
    min-height: 360px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    position: relative;
    background: var(--surface-0, #fff);
    /* Hide scrollbar for cleaner look */
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.08) transparent;
}
.conv-showcase-messages::-webkit-scrollbar {
    width: 4px;
}
.conv-showcase-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
}
.conv-showcase-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* ── Message bubbles ── */
.conv-msg {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    opacity: 0;
    transform: translateY(16px);
    animation: convMsgAppear 0.5s ease forwards;
}
.conv-msg.conv-msg-visible {
    opacity: 1;
    transform: translateY(0);
}
@keyframes convMsgAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sofia messages (left) */
.conv-msg-sofia {
    align-items: flex-start;
}
.conv-msg-sofia .conv-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-light, #e2e8f0);
}
.conv-msg-sofia .conv-msg-bubble {
    background: var(--surface-1, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 14px 14px 14px 4px;
    padding: 12px 16px;
    max-width: 85%;
}
.conv-msg-sofia .conv-msg-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary, #475569);
}
.conv-msg-sofia .conv-msg-text strong {
    color: var(--text-primary, #1e293b);
    font-weight: 600;
}
.conv-msg-sofia .conv-msg-text em {
    font-style: italic;
    color: var(--text-tertiary, #64748b);
}

/* User messages (right) */
.conv-msg-user {
    justify-content: flex-end;
}
.conv-msg-user .conv-msg-bubble {
    background: #1e293b;
    border-radius: 14px 14px 4px 14px;
    padding: 12px 16px;
    max-width: 80%;
}
.conv-msg-user .conv-msg-text {
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255,255,255,0.92);
}

/* ── Typing indicator ── */
.conv-typing {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
    opacity: 0;
    animation: convMsgAppear 0.3s ease forwards;
}
.conv-typing .conv-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-light, #e2e8f0);
}
.conv-typing-dots {
    background: var(--surface-1, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    border-radius: 14px 14px 14px 4px;
    padding: 12px 18px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.conv-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #94a3b8);
    animation: convTypingBounce 1.2s ease-in-out infinite;
}
.conv-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.conv-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes convTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Phase labels ── */
.conv-phase-label {
    text-align: center;
    margin: 18px 0 14px;
    opacity: 0;
    animation: convMsgAppear 0.5s ease forwards;
}
.conv-phase-label span {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #94a3b8);
    background: var(--surface-1, #f8fafc);
    border: 1px solid var(--border-light, #e2e8f0);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ── Bottom bar ── */
.conv-showcase-bottom {
    border-top: 1px solid var(--border-light, #e2e8f0);
    padding: 12px 16px;
    background: var(--surface-0, #fff);
    display: flex;
    align-items: center;
    gap: 10px;
}
.conv-showcase-input-fake {
    flex: 1;
    border: 1px solid var(--border-medium, #cbd5e1);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    background: var(--surface-0, #fff);
}
.conv-showcase-send-btn {
    width: 34px;
    height: 34px;
    background: var(--brand-accent, #2ec4b6);
    color: #fff;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.15s;
}
.conv-showcase-send-btn:hover {
    transform: scale(1.08);
}

/* ── Pause/Play overlay ── */
.conv-showcase-control {
    position: absolute;
    bottom: 60px;
    right: 16px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.conv-showcase:hover .conv-showcase-control,
.conv-showcase-control.visible {
    opacity: 1;
    pointer-events: auto;
}
.conv-showcase-control button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.conv-showcase-control button:hover {
    background: rgba(0,0,0,0.8);
}

/* ── CTA that appears at the end ── */
.conv-showcase-cta {
    padding: 16px;
    text-align: center;
    opacity: 0;
    animation: convMsgAppear 0.6s ease forwards;
}
.conv-showcase-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-accent, #2ec4b6);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(46,196,182,0.3);
}
.conv-showcase-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(46,196,182,0.35);
}
.conv-showcase-cta-sub {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 8px;
}

/* ── Section wrapper (replaces old hero right) ── */
.conv-showcase-section {
    position: relative;
}
.conv-showcase-section .conv-showcase-label {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted, #94a3b8);
    margin-top: 12px;
}

/* ── Paused state subtle overlay ── */
.conv-showcase.is-paused .conv-showcase-messages::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, rgba(255,255,255,0.7));
    pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .conv-showcase {
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    .conv-showcase-messages {
        min-height: 320px;
        max-height: 380px;
        padding: 16px 14px;
    }
    .conv-msg-sofia .conv-msg-bubble,
    .conv-msg-user .conv-msg-bubble {
        padding: 10px 14px;
    }
    .conv-msg-sofia .conv-msg-text,
    .conv-msg-user .conv-msg-text {
        font-size: 13px;
    }
}

/* ── Sofia Agente card gradient ── */
.sofia-agente-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}
