/* Chatbot Styles - FlowGenia */

/* Contenedor principal */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: var(--font-primary);
}

/* Botón flotante */
.chatbot-toggle {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.6);
}

.chatbot-toggle.active {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.chatbot-toggle.active i::before {
    content: "\f00d";
}

.chatbot-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Ventana del chat */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #0a1f16;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(16, 185, 129, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid rgba(16, 185, 129, 0.3);
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

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

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #10b981, #34d399);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    object-fit: contain;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.chatbot-status {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: pulse-dot 2s infinite;
}

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

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #0a1f16;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(16, 185, 129, 0.1);
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 3px;
}

.chatbot-message {
    display: flex;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    padding: 4px;
    object-fit: contain;
}

.message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message-content p {
    background: rgba(16, 185, 129, 0.15);
    color: #b4d1c5;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin: 0;
    line-height: 1.5;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.bot-message .message-content p {
    background: rgba(16, 185, 129, 0.15);
    border-radius: 12px 12px 12px 4px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    align-items: flex-end;
}

.user-message .message-content p {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    border-radius: 12px 12px 4px 12px;
    border: none;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 0;
}

.typing-indicator .message-content {
    background: rgba(16, 185, 129, 0.15);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    gap: 0.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: typing 1.4s infinite;
}

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

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

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

/* Quick replies */
.chatbot-quick-replies {
    padding: 0.75rem 1rem;
    background: rgba(16, 185, 129, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.quick-reply-btn {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.quick-reply-btn:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: #10b981;
    transform: translateY(-2px);
}

.quick-reply-btn i {
    font-size: 0.9rem;
}

/* Input */
.chatbot-input-container {
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.chatbot-input {
    flex: 1;
    background: #1a3a2e;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    padding: 0.75rem 1rem;
    color: #b4d1c5;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    resize: none;
    max-height: 100px;
    transition: all 0.3s ease;
}

.chatbot-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.chatbot-input::placeholder {
    color: rgba(180, 209, 197, 0.5);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #34d399);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

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

/* Footer */
.chatbot-footer {
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.05);
    text-align: center;
    border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.chatbot-footer p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(180, 209, 197, 0.7);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 70px;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }

    .quick-reply-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}