/* ==================================================
   RV WP CB - STABLE ARCHITECTURE VERSION
================================================== */

#rv-wp-cb-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 5px;
    z-index: 2147483647;
}

/* =========================
   OUTER SHELL (MINIMIZE CONTROL)
========================= */

#rv-wp-cb-chat-shell {
    width: 320px;
    height: 0;
    max-height: 75vh;
    overflow: hidden;
    transition: height 0.25s ease;
}

#rv-wp-cb-chatbot-container.open #rv-wp-cb-chat-shell {
    height: 75vh;
}

/* =========================
   INNER CHAT LAYOUT
========================= */

#rv-wp-cb-chat-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 2px solid #D4AF37;
    overflow: hidden;
}

/* =========================
   HEADER
========================= */

.rv-wp-cb-header {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.rv-wp-cb-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rv-wp-cb-avatar-lg {
    background: white;
    color: #0F4C81;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #D4AF37;
}

.rv-wp-cb-minimize {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
}

/* =========================
   MESSAGES (SCROLL AREA)
========================= */

#rv-wp-cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.rv-wp-cb-message {
    margin-bottom: 12px;
}

.rv-wp-cb-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    font-size: 14px;
    line-height: 1.5;
}

.rv-wp-cb-bot .rv-wp-cb-message-content {
    background: white;
    border-radius: 18px 18px 18px 4px;
    border: 1px solid #e9ecef;
}

.rv-wp-cb-user .rv-wp-cb-message-content {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
}

.rv-wp-cb-message-time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
}

/* =========================
   INPUT
========================= */

.rv-wp-cb-input-area {
    padding: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#rv-wp-cb-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 20px;
    border: 1px solid #ddd;
    font-size: 14px;
    resize: none;
}

#rv-wp-cb-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    cursor: pointer;
}

/* =========================
   FOOTER
========================= */

.rv-wp-cb-footer {
    padding: 6px;
    font-size: 10px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* =========================
   TOGGLE BUBBLE
========================= */

#rv-wp-cb-toggle {
    margin-top: 12px;
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 2px solid #D4AF37;
}

.rv-wp-cb-avatar {
    background: white;
    color: #0F4C81;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* =========================
   TYPING INDICATOR
========================= */

.rv-wp-cb-typing .rv-wp-cb-message-content {
    background: #f0f0f0 !important;
    padding: 10px 16px !important;
    width: fit-content;
}

.rv-wp-cb-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 14px;
}

.rv-wp-cb-typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    animation: rv-wp-cb-typing-blink 1.4s infinite both;
}

.rv-wp-cb-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.rv-wp-cb-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rv-wp-cb-typing-blink {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.1); }
}
