/* Contenedor principal del chatbot */
.aalp-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 800px;
    margin: 30px auto;
    border: 1px solid #ddd;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: white;
}

/* Header del chat */
.aalp-chat-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.aalp-chat-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5em;
}

.aalp-chat-header p {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

/* Contador de consultas */
.aalp-query-counter {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.aalp-counter-text {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.aalp-progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.aalp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
}

/* Área de mensajes */
.aalp-chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

/* Mensajes individuales */
.aalp-message {
    margin-bottom: 15px;
    max-width: 80%;
}

.aalp-user-message {
    margin-left: auto;
}

.aalp-bot-message {
    margin-right: auto;
}

.aalp-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

.aalp-user-message .aalp-message-content {
    background: #007AFF;
    color: white;
    border-bottom-right-radius: 5px;
}

.aalp-bot-message .aalp-message-content {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Mensaje de bienvenida */
.aalp-welcome-message {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.aalp-welcome-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.aalp-welcome-message li {
    margin-bottom: 5px;
}

/* Área de entrada */
.aalp-chat-input {
    border-top: 1px solid #eee;
    padding: 20px;
    background: white;
}

#aalp-message-input {
    width: 100%;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    resize: vertical;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#aalp-message-input:focus {
    outline: none;
    border-color: #007AFF;
}

#aalp-message-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.aalp-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.aalp-send-btn {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.aalp-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #0056CC 0%, #0040A0 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
}

.aalp-send-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.aalp-btn-icon {
    font-size: 18px;
}

.aalp-remaining {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Disclaimer */
.aalp-disclaimer {
    background: #fff8e1;
    border-top: 2px solid #ffd54f;
    padding: 15px 20px;
    font-size: 13px;
    color: #5d4037;
}

.aalp-disclaimer p {
    margin: 0;
    line-height: 1.4;
}

/* Indicador de escritura */
.aalp-typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 18px;
    margin-bottom: 15px;
}

.aalp-typing-dots {
    display: flex;
    align-items: center;
}

.aalp-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: aalpTyping 1.4s infinite ease-in-out;
}

.aalp-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.aalp-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aalpTyping {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .aalp-chatbot-container {
        margin: 15px;
        border-radius: 10px;
    }
    
    .aalp-chat-messages {
        height: 400px;
    }
    
    .aalp-message {
        max-width: 90%;
    }
    
    .aalp-input-actions {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .aalp-send-btn {
        justify-content: center;
    }
}