@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.chat-wrapper {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    z-index: 99999 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-toggle-btn {
    position: relative !important;
    width: 62px !important;
    height: 62px !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    border: 2.5px solid #d8c2a7 !important;
    cursor: pointer !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
    transition: transform 0.25s ease, box-shadow 0.2s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25) !important;
}

.avatar-toggle {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-toggle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 13px;
    height: 13px;
    background-color: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    z-index: 2;
}

.widget {
    width: 360px !important;
    max-width: 90vw !important;
    height: 500px !important;
    max-height: 80vh !important;
    margin-bottom: 12px;
    display: flex !important;
    flex-direction: column !important;
    background: #ffffff !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid #e5e7eb;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: all 0.25s ease-in-out;
    pointer-events: auto;
}

.widget.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(15px) scale(0.95) !important;
    pointer-events: none !important;
}

.header {
    height: 60px;
    padding: 0 16px;
    background: #1a1a1a;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #d8c2a7;
}

.persona-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-header {
    position: relative;
    width: 40px;
    height: 40px;
}

.avatar-header img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #d8c2a7;
}

.online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
}

.persona-details {
    display: flex;
    flex-direction: column;
}

.persona-nome {
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.persona-status {
    font-size: 11px;
    color: #d1d5db;
}

.close-btn {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #d8c2a7;
}

.chat {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #fdfbf7;
}

.bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;
}

.assistant {
    align-self: flex-start;
    background: #e9ecef;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.user {
    align-self: flex-end;
    background: #d8c2a7;
    color: #000000;
    font-weight: 600;
    border-bottom-right-radius: 4px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    background-color: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

@keyframes typing {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.composer {
    height: 58px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    gap: 8px;
}

.message {
    flex: 1;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    font-size: 13px;
}

.submit_message {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #1a1a1a;
    color: #d8c2a7;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.submit_message:hover {
    background: #ffc107;
    color: #000000;
}

.chat-help-tooltip {
    position: absolute;
    right: 74px;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    background: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #d8c2a7;
    padding: 8px 14px;
    border-radius: 20px 20px 4px 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-help-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #d8c2a7;
}

.chat-help-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

@media (max-width: 480px) {
    .chat-wrapper {
        bottom: 12px !important;
        right: 12px !important;
        left: 12px !important;
        align-items: flex-end;
    }

    .widget {
        width: 100% !important;
        max-width: 100% !important;
        height: 80dvh !important;
        border-radius: 16px !important;
    }

    .chat-help-tooltip {
        right: 0 !important;
        top: -45px !important;
        transform: translateY(0) scale(0.8);
    }

    .chat-help-tooltip.show {
        transform: translateY(0) scale(1);
    }
}