/* ============================================
   Chatbot Styles
   ============================================ */
.chatbot-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #157237 0%, #20ba5a 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4444;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.chatbot-badge.active {
    opacity: 1;
    transform: scale(1);
}

.chatbot-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1001;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.chatbot-container.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.chatbot-header {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-medium) 100%);
    color: white;
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.chatbot-header-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chatbot-header-info p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    background: #f5f5f5;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.chatbot-message {
    display: flex;
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
}

.chatbot-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-message-bot {
    align-self: flex-start;
}

.message-content {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 12px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chatbot-message-user .message-content {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-medium) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message-bot .message-content {
    background: white;
    color: var(--black);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-content p {
    margin: 0;
}

/* Badge de IA - Mauricinho */
.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    margin-right: 4px;
    vertical-align: top;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    line-height: 1.4;
}

.chatbot-message-bot .message-content {
    position: relative;
}

/* Destaque sutil para mensagens da IA */
.chatbot-message-bot .message-content:has(.ai-badge) {
    border-left: 3px solid #667eea;
    padding-left: calc(var(--spacing-md) - 3px);
}

.chatbot-quick-questions {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-question-btn {
    background: var(--green-lighter);
    border: 1px solid var(--green-light);
    color: var(--green-dark);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quick-question-btn:hover {
    background: var(--green-light);
    transform: translateY(-1px);
}

.quick-question-btn:active {
    transform: translateY(0);
}

.chatbot-input-container {
    display: flex;
    padding: var(--spacing-sm);
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    gap: var(--spacing-xs);
}

.chatbot-input {
    flex: 1;
    border: 2px solid var(--green-light);
    border-radius: 24px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: var(--font-primary);
}

.chatbot-input:focus {
    border-color: var(--green-medium);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--spacing-sm);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
        border-radius: 12px;
    }
    
    .chatbot-toggle {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }
}

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

