/* Triuvo Chat Widget */
:root {
    --chat-bg: #ffffff;
    --chat-header-bg: #1b1b1b;
    --chat-header-text: #ffffff;
    --chat-accent: #50E3C2; /* Neon Jade */
    --chat-accent-dark: #3dbda0;
    --chat-bubble-bot: #f1f3f5;
    --chat-bubble-user: #e6fffa;
    --chat-text: #1b1b1b;
}

/* Launcher Button */
.chat-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--chat-header-bg);
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chat-launcher:hover {
    transform: scale(1.1);
}

.chat-launcher i {
    color: var(--chat-accent);
    font-size: 28px;
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: 80vh;
    background-color: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.chat-window.active {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

/* Header */
.chat-header {
    background-color: var(--chat-header-bg);
    color: var(--chat-header-text);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--chat-accent);
}

.chat-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.1em;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.chat-close {
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.7;
    transition: 0.2s;
}
.chat-close:hover { opacity: 1; }

/* Body */
.chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95em;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.chat-bubble.bot {
    background-color: var(--chat-bubble-bot);
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.chat-bubble.user {
    background-color: var(--chat-bubble-user);
    color: var(--chat-text);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    border: 1px solid rgba(80, 227, 194, 0.3);
}

/* Options Container */
.chat-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.chat-btn {
    background: white;
    border: 1px solid #ddd;
    color: var(--chat-text);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 0.9em;
    transition: all 0.2s;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
}

.chat-btn:hover {
    border-color: var(--chat-accent);
    background: rgba(80, 227, 194, 0.05);
    color: var(--chat-accent-dark);
}

/* Inputs within chat */
.chat-input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.chat-field {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9em;
    flex: 1;
}

.chat-field:focus {
    outline: none;
    border-color: var(--chat-accent);
}

.chat-submit-btn {
    background: var(--chat-header-bg);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.chat-submit-btn:hover {
    background: #333;
}

/* New Utilities for V2 Flow */
.chat-link {
    color: var(--chat-accent-dark);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.chat-link:hover {
    border-color: var(--chat-accent-dark);
}

.full-width {
    width: 100%;
    box-sizing: border-box;
}

.chat-form-container {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 10px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--chat-bubble-bot);
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    width: fit-content;
    align-self: flex-start;
}

.dot {
    width: 6px;
    height: 6px;
    background: #bbb;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

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

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

@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    .chat-launcher {
        bottom: 20px;
        right: 20px;
    }
}
