/**
 * Azulero Chatbot - Estilos CSS
 * Archivo: assets/css/azulero-chatbot.css
 */

/* Contenedor principal */
#azulero-container {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

#azulero-container.azulero-left {
    left: 20px;
}

#azulero-container.azulero-right {
    right: 20px;
}

/* Botón de toggle */
#azulero-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

#azulero-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#azulero-toggle i {
    font-size: 24px;
}

/* Ventana de chat */
#azulero-chat-window {
    position: absolute;
    bottom: 80px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 350px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

#azulero-chat-window.azulero-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.azulero-left #azulero-chat-window {
    left: 0;
}

.azulero-right #azulero-chat-window {
    right: 0;
}

/* Cabecera */
.azulero-header {
    background-color: #0073aa;
    color: #fff;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.azulero-header-title {
    display: flex;
    align-items: center;
}

.azulero-header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.azulero-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.azulero-header-name {
    font-weight: 600;
    font-size: 16px;
}

.azulero-header-actions {
    display: flex;
}

.azulero-header-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    padding: 5px;
}

.azulero-header-button:hover {
    color: #fff;
}

/* Área de mensajes */
.azulero-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    max-height: 300px;
}

#azulero-messages {
    display: flex;
    flex-direction: column;
}

/* Mensajes */
.azulero-message {
    margin-bottom: 15px;
    max-width: 80%;
    display: flex;
    align-items: flex-start;
}

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

.azulero-user-message {
    align-self: flex-end;
    justify-content: flex-end;
}

.azulero-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #0073aa;
    overflow: hidden;
    flex-shrink: 0;
}

.azulero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.azulero-message-content {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    color: #333;
    word-wrap: break-word;
}

.azulero-bot-message .azulero-message-content {
    background-color: #f1f1f1;
    border-top-left-radius: 0;
}

.azulero-user-message .azulero-message-content {
    background-color: #e3f2fd;
    color: #0c5460;
    border-top-right-radius: 0;
}

/* Indicador de escritura */
.azulero-typing-indicator {
    display: flex;
    align-items: center;
}

.azulero-typing-indicator span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    animation: azulero-typing 1.4s infinite ease-in-out both;
}

.azulero-typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes azulero-typing {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1.0);
    }
}

/* Área de entrada de mensaje */
.azulero-input-container {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
}

.azulero-input-wrapper {
    flex: 1;
    position: relative;
}

#azulero-message-input {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    padding: 10px 15px;
    outline: none;
    resize: none;
    max-height: 100px;
    font-family: inherit;
    font-size: 14px;
}

#azulero-message-input:focus {
    border-color: #0073aa;
}

.azulero-send-btn {
    background-color: #0073aa;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.azulero-send-btn:hover {
    background-color: #005c8a;
}

.azulero-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Footer */
.azulero-footer {
    padding: 8px 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #777;
}

.azulero-powered-by {
    display: flex;
    align-items: center;
}

.azulero-powered-by img {
    height: 16px;
    margin-left: 5px;
}

.azulero-actions {
    display: flex;
}

.azulero-action-btn {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    margin-left: 10px;
    text-decoration: underline;
}

.azulero-action-btn:hover {
    color: #0073aa;
}

/* Formulario de feedback */
#azulero-feedback-container {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: none;
}

.azulero-feedback-title {
    font-weight: 600;
    margin-bottom: 10px;
}

.azulero-rating {
    display: flex;
    margin-bottom: 10px;
    justify-content: center;
}

.azulero-rating-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #ccc;
    margin: 0 5px;
    transition: transform 0.2s ease;
}

.azulero-rating-btn:hover {
    transform: scale(1.2);
}

.azulero-rating-btn.active {
    color: #0073aa;
}

#azulero-feedback-text {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 8px 12px;
    margin-bottom: 10px;
    resize: none;
    height: 80px;
    font-family: inherit;
    font-size: 14px;
}

#azulero-submit-feedback {
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    display: block;
    margin: 0 auto;
}

#azulero-submit-feedback:hover {
    background-color: #005c8a;
}

/* Responsive */
@media screen and (max-width: 480px) {
    #azulero-chat-window {
        width: 300px;
        bottom: 70px;
    }
    
    .azulero-message {
        max-width: 90%;
    }
}

@media screen and (max-width: 360px) {
    #azulero-chat-window {
        width: 280px;
        max-height: 450px;
    }
    
    .azulero-messages-container {
        max-height: 250px;
    }
    
    .azulero-header {
        padding: 10px 15px;
    }
    
    .azulero-header-name {
        font-size: 14px;
    }
}

/* Estilos para los contenidos del mensaje */
.azulero-message-content ul {
    padding-left: 20px;
    margin: 5px 0;
}

.azulero-message-content li {
    margin-bottom: 3px;
}

.azulero-message-content a {
    color: #0073aa;
    text-decoration: none;
}

.azulero-message-content a:hover {
    text-decoration: underline;
}

.azulero-message-content strong {
    font-weight: 600;
}

.azulero-message-content em {
    font-style: italic;
}

/* Animaciones */
@keyframes azulero-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.azulero-message {
    animation: azulero-fade-in 0.3s ease-out;
}

/* Temas personalizados (puede ser sobrescrito desde las opciones) */
.azulero-theme-green #azulero-toggle,
.azulero-theme-green .azulero-header,
.azulero-theme-green .azulero-avatar,
.azulero-theme-green .azulero-send-btn,
.azulero-theme-green .azulero-rating-btn.active,
.azulero-theme-green #azulero-submit-feedback {
    background-color: #46b450;
}

.azulero-theme-green .azulero-action-btn:hover,
.azulero-theme-green .azulero-message-content a {
    color: #46b450;
}

.azulero-theme-purple #azulero-toggle,
.azulero-theme-purple .azulero-header,
.azulero-theme-purple .azulero-avatar,
.azulero-theme-purple .azulero-send-btn,
.azulero-theme-purple .azulero-rating-btn.active,
.azulero-theme-purple #azulero-submit-feedback {
    background-color: #826eb4;
}

.azulero-theme-purple .azulero-action-btn:hover,
.azulero-theme-purple .azulero-message-content a {
    color: #826eb4;
}

.azulero-theme-orange #azulero-toggle,
.azulero-theme-orange .azulero-header,
.azulero-theme-orange .azulero-avatar,
.azulero-theme-orange .azulero-send-btn,
.azulero-theme-orange .azulero-rating-btn.active,
.azulero-theme-orange #azulero-submit-feedback {
    background-color: #f56e28;
}

.azulero-theme-orange .azulero-action-btn:hover,
.azulero-theme-orange .azulero-message-content a {
    color: #f56e28;
}

/* Desactivar en dispositivos móviles si está configurado */
@media screen and (max-width: 767px) {
    #azulero-container.azulero-hide-mobile {
        display: none;
    }
}