/**
 * FUNDIVEL Chatbot - Estilos
 */

/* Toggle Button */
#fundivel-chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--color-primary-dark, #0D3B12), var(--color-primary, #1B5E20));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(27, 94, 32, 0.4);
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#fundivel-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(27, 94, 32, 0.5);
}

.chatbot-icon { font-size: 28px; }

/* Container */
#fundivel-chatbot-container,
.fundivel-chatbot-embed {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.fundivel-chatbot-embed {
    position: relative;
    bottom: auto;
    right: auto;
    width: 100%;
    max-width: 500px;
    max-height: 500px;
    margin: 0 auto;
}

.chatbot-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--color-primary-dark, #0D3B12), var(--color-primary, #1B5E20));
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-avatar { font-size: 24px; }

.chatbot-header-info strong {
    display: block;
    font-size: 14px;
    color: #fff;
}

.chatbot-status {
    font-size: 11px;
    opacity: 0.8;
}

.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 360px;
}

.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.chatbot-msg p { margin: 0; }

.chatbot-msg-bot {
    background: var(--color-bg-light, #F8F9FA);
    border: 1px solid var(--color-border, #E0E0E0);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chatbot-msg-user {
    background: var(--color-primary, #1B5E20);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Suggestions */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

/* Action Button (CTA en respuestas) */
.chatbot-action {
    padding: 8px 0;
}

.chatbot-action-btn {
    display: inline-block;
    background: var(--color-primary, #1B5E20);
    color: #fff !important;
    padding: 10px 18px;
    border-radius: var(--radius, 8px);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.chatbot-action-btn:hover {
    background: var(--color-primary-dark, #0D3B12);
    transform: translateY(-1px);
    color: #fff !important;
}

.chatbot-suggestion-btn {
    background: rgba(27, 94, 32, 0.08);
    border: 1px solid rgba(27, 94, 32, 0.2);
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--color-primary, #1B5E20);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.chatbot-suggestion-btn:hover {
    background: var(--color-primary, #1B5E20);
    color: #fff;
    border-color: var(--color-primary, #1B5E20);
}

/* Input */
.chatbot-input-area {
    display: flex;
    padding: 12px;
    border-top: 1px solid var(--color-border, #E0E0E0);
    gap: 8px;
}

#chatbot-input,
.chatbot-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border, #E0E0E0);
    border-radius: var(--radius, 8px);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

#chatbot-input:focus,
.chatbot-input-field:focus {
    border-color: var(--color-primary, #1B5E20);
}

#chatbot-send,
.chatbot-send-btn {
    background: var(--color-primary, #1B5E20);
    color: #fff;
    border: none;
    border-radius: var(--radius, 8px);
    width: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

#chatbot-send:hover,
.chatbot-send-btn:hover {
    background: var(--color-primary-dark, #0D3B12);
}

/* Responsive */
@media (max-width: 480px) {
    #fundivel-chatbot-container {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 84px;
        max-height: 70vh;
    }
    #fundivel-chatbot-toggle {
        bottom: 16px;
        right: 16px;
    }
}
