/* Extraia Chat Widget UI Styles - Slide-over Drawer (ChatSalesFlow Style) */

#extraia-chat-widget-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: none; /* Let clicks pass through when hidden */
}

/* Soft Dimmed & Blurred Backdrop */
.chat-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 1;
}

.chat-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-over Right Drawer - 50% width for comfortable reading */
.chat-window {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50vw;
    min-width: 480px;
    max-width: 920px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    box-shadow: -10px 0 45px rgba(0, 0, 0, 0.18), -1px 0 0 rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    z-index: 2;
}

.chat-window.open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Crisp Clean Header - ChatSalesFlow Aesthetic */
.chat-header {
    background: #ffffff;
    color: #0f172a;
    padding: 0.95rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    position: relative;
    flex-shrink: 0;
}

.chat-header-identity {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.chat-header-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #18382b 0%, #2b5744 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(24, 56, 43, 0.22);
    flex-shrink: 0;
}

.avatar-letter {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.15rem;
    color: #ffffff;
    line-height: 1;
}

.avatar-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.chat-header-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header-name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
    line-height: 1.25;
}

.chat-header-role {
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.3;
    font-weight: 500;
}

/* Minimalist Close Icon Button */
.chat-close-btn {
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
    padding: 0;
}

.chat-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: scale(1.05);
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    background: #f8fafc;
}

/* Welcome Card Presentation */
.chat-welcome-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 1.5rem 1.6rem 1.35rem;
    box-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.05);
    margin-bottom: 0.25rem;
    animation: fadeIn 0.3s ease;
}

.chat-welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.chat-welcome-title {
    margin: 0 0 0.65rem 0 !important;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.25rem !important;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.3px;
    line-height: 1.3 !important;
}

.chat-welcome-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
}

.chat-welcome-body p {
    margin: 0 !important;
    font-size: 0.93rem !important;
    line-height: 1.65 !important;
    color: #334155 !important;
}

.chat-welcome-body strong {
    color: #0f172a;
    font-weight: 600;
}

.chat-suggestions-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 1rem;
}

.chat-suggestions-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.65rem;
}

.chat-suggestions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-suggestion-chip {
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    padding: 0.65rem 0.95rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 9px;
    font-family: inherit;
    width: 100%;
}

.chat-suggestion-chip .chip-arrow-icon {
    flex-shrink: 0;
    color: #18382b;
    opacity: 0.6;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-suggestion-chip:hover {
    background: #f0fdf4;
    border-color: #86efac;
    color: #14532d;
    transform: translateX(4px);
    box-shadow: 0 2px 6px rgba(22, 101, 52, 0.08);
}

.chat-suggestion-chip:hover .chip-arrow-icon {
    opacity: 1;
    transform: scale(1.1);
}

.chat-bubble {
    max-width: 84%;
    padding: 13px 18px;
    border-radius: 16px;
    font-size: 0.94rem;
    line-height: 1.65;
    word-wrap: break-word;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.ai {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chat-bubble.user {
    background: linear-gradient(135deg, #18382b 0%, #234d3c 100%);
    color: #ffffff;
    align-self: flex-end;
    border: 1px solid #18382b;
    border-bottom-right-radius: 4px;
    box-shadow: 0 3px 12px rgba(24, 56, 43, 0.2);
}

.chat-citation-link {
    display: inline-block;
    color: #18382b;
    text-decoration: none;
    font-weight: 600;
    margin: 0 2px;
    padding: 2px 7px;
    background: rgba(24, 56, 43, 0.08);
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.88rem;
}

.chat-citation-link:hover {
    background: rgba(24, 56, 43, 0.16);
    text-decoration: underline;
}

.chat-footer-area {
    padding: 1.15rem 1.4rem 1.1rem;
    background: #ffffff;
    border-top: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
}

.chat-input-area {
    padding: 0;
    background: transparent;
    display: flex;
    gap: 0.65rem;
    align-items: center;
    border-top: none;
}

#extraia-chat-widget-container p {
    font-size: inherit;
    line-height: inherit;
    margin: 0;
}

.chat-disclaimer {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.45;
    text-align: left;
    padding-left: 1px;
}

.chat-disclaimer p {
    font-size: 0.74rem !important;
    line-height: 1.45 !important;
    margin: 0 0 0.35rem 0 !important;
    color: #64748b;
}

.chat-disclaimer p:last-child {
    margin-bottom: 0 !important;
}

.chat-disclaimer a {
    color: #18382b;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.15s ease;
}

.chat-disclaimer a:hover {
    color: #0c1c15;
}

.chat-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.15rem;
}

.extraia-turnstile-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.extraia-turnstile-slot {
    margin: 0;
    padding: 0;
}

.chat-input-area input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    outline: none;
    font-size: 0.94rem;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.chat-input-area input:focus {
    background: #ffffff;
    border-color: #18382b;
    box-shadow: 0 0 0 3px rgba(24, 56, 43, 0.12);
}

.chat-input-area button {
    background: #18382b;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.chat-input-area button:hover {
    background: #0f241c;
    transform: translateY(-1px);
}

.chat-input-area button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: inline-block;
    width: 30px;
}
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #18382b;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 860px) {
    .chat-window {
        width: 100vw;
        min-width: unset;
        max-width: 100vw;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
    }
}

/* Floating Assistant Launcher Widget - AlpIA Style */
.chat-launcher-btn {
    position: fixed !important;
    bottom: 75px !important;
    right: 30px !important;
    z-index: 99998 !important;
    pointer-events: auto !important;
    display: inline-flex !important;
    align-items: center;
    gap: 11px;
    padding: 14px 28px !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, #18382b 0%, #295b45 50%, #1a3c2e 100%) !important;
    color: #ffffff !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.2px;
    border: 1.5px solid rgba(255, 216, 117, 0.55) !important;
    box-shadow: 0 10px 32px rgba(24, 56, 43, 0.5), 0 0 24px rgba(255, 216, 117, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.45) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    user-select: none;
    animation: assistant-glow 3.5s infinite ease-in-out;
}

.chat-launcher-btn .launcher-sparkle-icon {
    color: #ffe082; /* Warm gold accent matching L'Artzon AI highlight */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255, 224, 130, 0.85));
    animation: sparkle-glow 3.5s infinite ease-in-out;
}

@keyframes assistant-glow {
    0%, 100% {
        box-shadow: 0 10px 32px rgba(24, 56, 43, 0.5), 0 0 20px rgba(255, 216, 117, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.45);
        border-color: rgba(255, 216, 117, 0.5);
    }
    50% {
        box-shadow: 0 12px 40px rgba(24, 56, 43, 0.65), 0 0 32px rgba(255, 216, 117, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.7);
        border-color: rgba(255, 216, 117, 0.95);
    }
}

@keyframes sparkle-glow {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 6px rgba(255, 224, 130, 0.75));
    }
    50% {
        transform: scale(1.15) rotate(12deg);
        filter: drop-shadow(0 0 14px rgba(255, 224, 130, 1));
    }
}

.chat-launcher-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 16px 45px rgba(24, 56, 43, 0.7), 0 0 38px rgba(255, 216, 117, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(255, 216, 117, 1) !important;
    background: linear-gradient(135deg, #153226 0%, #326e54 50%, #1c3e30 100%) !important;
}

.chat-launcher-btn:active {
    transform: translateY(0) scale(0.99);
    box-shadow: 0 6px 20px rgba(24, 56, 43, 0.5) !important;
}

.chat-launcher-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
}

@media (max-width: 600px) {
    .chat-launcher-btn {
        bottom: 65px !important;
        right: 18px !important;
        padding: 11px 20px !important;
        font-size: 0.92rem !important;
    }
}

