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

/* ==========================================================
   Rtest AI Chat Widget - Clean White Theme
   ========================================================== */

:root {
    --primary-gradient: linear-gradient(135deg, #ffffff, #f8fafc);
    --secondary-gradient: linear-gradient(135deg, #10b981, #059669);
    --primary-solid: #2B5D80;
    --accent-color: #10b981;
    --dark-blue: #0f172a;
    --text-main: #1e293b;
    --text-light: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.98);
    --glass-border: rgba(226, 232, 240, 0.8);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.1);
    --radius-lg: 32px;
    --radius-md: 16px;
}

#Rtest-chat-wrapper,
#Rtest-chat-wrapper * {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

#Rtest-chat-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    -webkit-font-smoothing: antialiased;
}

/* --- Floating Bubble --- */
#Rtest-chat-bubble {
    width: 65px;
    height: 65px;
    background: var(--primary-solid);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(43, 93, 128, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: none;
    padding: 0;
}

#Rtest-chat-bubble svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.bubble-tooltip {
    position: absolute;
    right: 75px;
    background: var(--dark-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

#Rtest-chat-bubble:hover .bubble-tooltip {
    opacity: 1;
    transform: translateX(0);
}

#Rtest-chat-bubble:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 12px 35px rgba(43, 93, 128, 0.4);
}

.bubble-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid var(--dark-blue);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.pulse-animation {
    animation: premium-float 4s ease-in-out infinite, premium-pulse 3s infinite;
}

@keyframes premium-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes premium-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(43, 93, 128, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(43, 93, 128, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(43, 93, 128, 0);
    }
}

/* --- Chat Window --- */
#Rtest-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 650px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

#Rtest-chat-window.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
    visibility: hidden;
}

/* --- Header (White Background) --- */
.chat-header {
    padding: 24px 24px 30px;
    background: #ffffff;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    z-index: 2;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-avatar-new {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border: 1px solid #f1f5f9;
}

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

.chat-title-group {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 700;
    font-size: 18px;
    color: #000000;
}

.close-chat {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.close-chat:hover {
    background: #f1f5f9;
    color: #000000;
    transform: rotate(90deg);
}

.close-chat svg {
    width: 16px;
    height: 16px;
}

/* --- Messages Area --- */
#Rtest-chat-messages {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #ffffff;
}

#Rtest-chat-messages::-webkit-scrollbar {
    width: 4px;
}

#Rtest-chat-messages::-webkit-scrollbar-thumb {
    background: #f1f5f9;
    border-radius: 10px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 18px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.assistant-message {
    background: #f8fafc;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #f1f5f9;
}

.user-message {
    background: #2B5D80;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(43, 93, 128, 0.15);
}

#Rtest-chat-home {
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    animation: fadeIn 0.5s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#Rtest-quick-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.quick-action-btn {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    color: #1e293b !important;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: #ffffff;
    border-color: #2B5D80;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* --- Input Area --- */
.chat-input-area {
    padding: 15px 20px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f1f5f9;
}

#Rtest-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.3s ease;
}

#Rtest-chat-input:focus {
    outline: none;
    border-color: #2B5D80;
    background: white;
    box-shadow: 0 0 0 3px rgba(43, 93, 128, 0.05);
}

#Rtest-chat-send {
    background: #2B5D80;
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    #Rtest-chat-send:hover {
        transform: scale(1.05);
        filter: brightness(1.1);
    }

    #Rtest-chat-send svg {
        width: 18px;
        height: 18px;
    }



    /* --- Typing Indicator (Smooth Dots) --- */
    .typing-indicator {
        background: #f1f5f9;
        padding: 14px 18px;
        border-radius: 18px;
        border-bottom-left-radius: 4px;
        display: flex;
        gap: 5px;
        width: fit-content;
        align-self: flex-start;
        margin-bottom: 15px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.03);
        animation: fadeIn 0.3s ease-out;
    }

    .typing-indicator span {
        width: 6px;
        height: 6px;
        background-color: #94a3b8;
        border-radius: 50%;
        display: inline-block;
        animation: typing-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 typing-bounce {
        0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
        40% { transform: scale(1); opacity: 1; }
    }

    @media (max-width: 480px) {
        #Rtest-chat-window {
            width: calc(100vw - 30px);
            right: 15px;
            left: 15px;
            bottom: 80px;
        }
    }