/* ChatBot Frontend - WhatsApp Style Fullscreen */

.cbam-chatbot-fullscreen {
    --cbam-primary: #25D366;
    --cbam-secondary: #128C7E;
    --cbam-bubble: #DCF8C6;
    
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999999 !important;
    background: #e5ddd5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    overflow: hidden !important;
}

/* Força container pai a ser fullwidth */
.cbam-chatbot-fullscreen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: inherit;
    z-index: -1;
}

/* Sobrescreve containers do tema */
.page .cbam-chatbot-fullscreen,
.single .cbam-chatbot-fullscreen,
.container .cbam-chatbot-fullscreen,
.content .cbam-chatbot-fullscreen,
.site-content .cbam-chatbot-fullscreen,
.entry-content .cbam-chatbot-fullscreen,
div[class*="container"] .cbam-chatbot-fullscreen,
div[class*="wrapper"] .cbam-chatbot-fullscreen {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
}

.cbam-chat-window {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: #e5ddd5;
    position: relative;
}

/* Header */
.cbam-header {
    background: var(--cbam-primary);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.cbam-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cbam-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    flex-shrink: 0;
}

.cbam-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbam-info {
    flex: 1;
}

.cbam-name {
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cbam-verified {
    opacity: 0.9;
}

.cbam-status {
    font-size: 13px;
    opacity: 0.9;
}

.cbam-status.online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cbam-icon-btn {
    background: none;
    border: none;
    color: white;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.cbam-icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

/* Messages Area */
.cbam-messages {
    flex: 1;
    overflow-y: auto;
    background: #e5ddd5;
}

.cbam-messages-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
}

/* Message */
.cbam-msg {
    display: flex;
    gap: 5px;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

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

.cbam-msg.cbam-sent {
    flex-direction: row-reverse;
}

.cbam-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #ddd;
}

.cbam-msg.cbam-sent .cbam-msg-avatar {
    display: none;
}

.cbam-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cbam-msg-content {
    max-width: 70%;
}

.cbam-msg-bubble {
    background: white;
    padding: 6px 7px 8px 9px;
    border-radius: 7.5px;
    box-shadow: 0 1px 0.5px rgba(0,0,0,0.13);
    word-wrap: break-word;
    position: relative;
    font-size: 14.2px;
    line-height: 19px;
    min-width: 60px;
    max-width: 100%;
}

.cbam-msg-text {
    display: inline;
}

.cbam-msg-time {
    font-size: 11px;
    color: rgba(0,0,0,0.45);
    display: inline;
    white-space: nowrap;
    margin-left: 6px;
}

.cbam-msg.cbam-sent .cbam-msg-bubble {
    background: #d9fdd3;
}

.cbam-msg-time {
    font-size: 11px;
    color: rgba(0,0,0,0.45);
    margin-left: 8px;
    display: inline;
    float: right;
    margin-top: 4px;
}

/* Question Buttons */
.cbam-question-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cbam-ans-btn {
    background: var(--cbam-primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 100%;
}

.cbam-ans-btn:hover {
    background: var(--cbam-secondary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cbam-ans-btn:active {
    transform: translateY(0);
}

/* Ad Container */
.cbam-ad-wrap {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    margin: 12px auto;
    width: fit-content;
    max-width: 90%;
}

.cbam-ad-label {
    display: none;
}

.cbam-ad-content {
    text-align: center;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* CTAs */
.cbam-ctas-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.cbam-cta-link {
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center !important;
    text-decoration: none;
    display: block;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    width: 100%;
}

.cbam-cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.cbam-cta-link:active {
    transform: translateY(0);
}

/* CTA Pulsante */
.cbam-cta-pulse {
    animation: ctaPulse 1.5s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        box-shadow: 0 1px 2px rgba(0,0,0,0.15);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 1px 2px rgba(0,0,0,0.15), 0 0 0 6px rgba(37, 211, 102, 0.5);
        transform: scale(1.02);
    }
}

/* Footer */
.cbam-footer {
    background: #f0f0f0;
    padding: 8px 16px;
    border-top: 1px solid #ddd;
    flex-shrink: 0;
}

.cbam-input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    outline: none;
}

.cbam-input:focus {
    box-shadow: 0 0 0 2px var(--cbam-primary);
}

/* Typing Indicator */
.cbam-typing {
    display: none !important;
}

/* Scrollbar */
.cbam-messages::-webkit-scrollbar {
    width: 6px;
}

.cbam-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cbam-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.cbam-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .cbam-msg-content {
        max-width: 80%;
    }
}
