/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    right: 3%;
    bottom: 77px; /* Más pegado al borde inferior */
    transform: translateX(50%); /* Centrado horizontalmente */
    z-index: 1001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #4b5ba2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.chatbot-button img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chatbot-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chatbot-window.minimized {
    height: 60px;
}

.chatbot-window.minimized .chatbot-body,
.chatbot-window.minimized .chatbot-footer {
    display: none;
}

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

.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #4b5ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.chatbot-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

.chatbot-title {
    flex: 1;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.chatbot-status {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
}

.chatbot-status.online {
    color: #4ade80;
}

.chatbot-status.offline {
    color: #fbbf24;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
}

.chatbot-control-btn {
    width: 25px;
    height: 25px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.chatbot-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

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

.chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.chatbot-message.bot .chatbot-message-content {
    background: #e2e8f0;
    color: #334155;
    border-bottom-left-radius: 6px;
}

.chatbot-message.user .chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #4b5ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.chatbot-typing {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #e2e8f0;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    max-width: 80px;
}

.chatbot-typing.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #64748b;
    animation: typingAnimation 1.4s infinite;
}

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

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

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

.ai-indicator {
    font-size: 11px;
    color: #667eea;
    margin-left: 8px;
    font-weight: 500;
    animation: aiPulse 2s infinite;
}

@keyframes aiPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.chatbot-quick-questions {
    margin-top: 20px;
}

.chatbot-quick-questions h5 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #64748b;
    font-weight: 600;
}

.quick-question-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-align: left;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-question-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.chatbot-footer {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chatbot-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #667eea;
}

.chatbot-send-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #4b5ba2 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-container {
        right: 20px;
        bottom: 120px;
    }
    
    .chatbot-window {
        width: 300px;
        height: 450px;
        right: -10px;
    }
    
    .chatbot-body {
        padding: 15px;
    }
    
    .chatbot-header {
        padding: 12px 15px;
    }
    
    .chatbot-footer {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        right: 14%;
        bottom: 79px;
        transform: translateX(50%);
    }
    
    .chatbot-window {
        width: 90vw; /* 90% del ancho de la pantalla */
        max-width: 300px;
        height: 70vh; /* 70% de la altura de la pantalla */
        max-height: 400px;
        right: 60;
        left: 50%;
        transform: translateX(-90%);
    }
    
    .chatbot-button {
        width: 45px;
        height: 45px;
    }
    
    .chatbot-button img {
        width: 25px;
        height: 25px;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .chatbot-container {
        right: 25px;
        bottom: 130px;
    }
    
    .chatbot-window {
        width: 320px;
        height: 480px;
    }
}

/* Desktop large screens */
@media (min-width: 1200px) {
    .chatbot-window {
        width: 380px;
        height: 520px;
    }
}