/**
 * Estilos del Hacce WordPress Chatbot
 * ✅ v6.3.1: Estilos para sección "Ver también:" (Related Content)
 * ✅ v5.1.2-QUICK-REPLIES: Estilos para Quick Replies interactivos
 * 
 * @package HacceChatbot
 * @since 1.0.0
 * @version 6.3.1
 */

/* Variables CSS */
:root {
    --chatbot-primary-color: #2271b1;
    --chatbot-primary-dark: #135e96;
    --chatbot-primary-light: #72aee6;
    --chatbot-bg-color: #ffffff;
    --chatbot-text-color: #1e1e1e;
    --chatbot-text-secondary: #757575;
    --chatbot-border-color: #dcdcdc;
    --chatbot-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    --chatbot-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.2);
    --chatbot-radius: 12px;
    --chatbot-radius-sm: 8px;
    --chatbot-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --chatbot-z-index: 999999;
    
    /* ✅ NUEVO v5.1.2: Variables para Quick Replies */
    --quick-reply-ask-color: #2271b1;
    --quick-reply-link-color: #00a32a;
    --quick-reply-callback-color: #f0b849;
}

/* Contenedor principal */
.chatbot-widget {
    position: fixed;
    z-index: var(--chatbot-z-index);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Posicionamiento */
.chatbot-widget[data-position="bottom-right"] {
    bottom: 20px;
    right: 20px;
}

.chatbot-widget[data-position="bottom-left"] {
    bottom: 20px;
    left: 20px;
}

.chatbot-widget[data-position="top-right"] {
    top: 20px;
    right: 20px;
}

.chatbot-widget[data-position="top-left"] {
    top: 20px;
    left: 20px;
}

/* Botón flotante */
.chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: var(--chatbot-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chatbot-trigger:hover {
    background: var(--chatbot-primary-dark);
    transform: scale(1.05);
    box-shadow: var(--chatbot-shadow-lg);
}

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

.chatbot-trigger svg {
    width: 28px;
    height: 28px;
}

/* Badge de notificaciones */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ventana del chat */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 800px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--chatbot-bg-color);
    border-radius: var(--chatbot-radius);
    box-shadow: var(--chatbot-shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: var(--chatbot-transition);
}

.chatbot-widget[data-state="open"] .chatbot-window {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

.chatbot-widget[data-state="minimized"] .chatbot-window {
    height: auto;
}

/* Cabecera */
.chatbot-header {
    background: var(--chatbot-primary-color);
    color: white;
    padding: 16px;
    border-radius: var(--chatbot-radius) var(--chatbot-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.chatbot-header-text {
    flex: 1;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.chatbot-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin: 2px 0 0;
}

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

.chatbot-header-actions button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-header-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

.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-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

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

/* Mensajes */
.chatbot-message {
    display: flex;
    gap: 8px;
    animation: messageAppear 0.3s ease-out;
    opacity: 0;
}

.chatbot-message.chatbot-message-appear {
    opacity: 1;
}

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

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

.chatbot-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: var(--chatbot-radius-sm);
    word-wrap: break-word;
}

.chatbot-message-bot .chatbot-message-content {
    background: white;
    color: var(--chatbot-text-color);
    border: 1px solid var(--chatbot-border-color);
}

.chatbot-message-user .chatbot-message-content {
    background: var(--chatbot-primary-color);
    color: white;
}

.chatbot-message-content a {
    color: inherit;
    text-decoration: underline;
}

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

.chatbot-message-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.chatbot-message-content li {
    margin: 4px 0;
}

.chatbot-message-time {
    font-size: 11px;
    color: var(--chatbot-text-secondary);
    margin-top: 4px;
    text-align: right;
}

.chatbot-message-user .chatbot-message-time {
    text-align: left;
}

/* Acciones de mensaje */
.chatbot-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-action-button {
    background: var(--chatbot-primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-action-button:hover {
    background: var(--chatbot-primary-dark);
}

.chatbot-action-button svg {
    width: 12px;
    height: 12px;
}

/* Indicador de escritura */
.chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: var(--chatbot-radius-sm);
    width: fit-content;
    border: 1px solid var(--chatbot-border-color);
}

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

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

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

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

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chatbot-typing-text {
    font-size: 12px;
    color: var(--chatbot-text-secondary);
}

/* ========================================
   ✅ NUEVO v5.1.2: QUICK REPLIES
   ======================================== */

/* Contenedor de Quick Replies */
.chatbot-quick-replies {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--chatbot-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Botón individual de Quick Reply */
.chatbot-quick-reply {
    background: white;
    border: 2px solid var(--chatbot-border-color);
    color: var(--chatbot-text-color);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Animación de aparición */
.chatbot-quick-reply-appear {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Estados hover y active */
.chatbot-quick-reply:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chatbot-quick-reply:active {
    transform: translateY(0) scale(0.98);
}

/* Icono del Quick Reply */
.chatbot-quick-reply-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Texto del Quick Reply */
.chatbot-quick-reply-text {
    line-height: 1.2;
}

/* ========================================
   Tipos de Quick Reply (ask, link, callback)
   ======================================== */

/* Tipo: ASK (enviar pregunta) - Azul */
.chatbot-quick-reply-ask {
    border-color: var(--quick-reply-ask-color);
    color: var(--quick-reply-ask-color);
}

.chatbot-quick-reply-ask:hover {
    background: var(--quick-reply-ask-color);
    color: white;
    border-color: var(--quick-reply-ask-color);
}

/* Tipo: LINK (abrir URL) - Verde */
.chatbot-quick-reply-link {
    border-color: var(--quick-reply-link-color);
    color: var(--quick-reply-link-color);
}

.chatbot-quick-reply-link:hover {
    background: var(--quick-reply-link-color);
    color: white;
    border-color: var(--quick-reply-link-color);
}

/* Tipo: CALLBACK (función personalizada) - Naranja */
.chatbot-quick-reply-callback {
    border-color: var(--quick-reply-callback-color);
    color: var(--quick-reply-callback-color);
}

.chatbot-quick-reply-callback:hover {
    background: var(--quick-reply-callback-color);
    color: white;
    border-color: var(--quick-reply-callback-color);
}

/* Color personalizado (si se define en el quick reply) */
.chatbot-quick-reply[style*="--quick-reply-color"] {
    border-color: var(--quick-reply-color);
    color: var(--quick-reply-color);
}

.chatbot-quick-reply[style*="--quick-reply-color"]:hover {
    background: var(--quick-reply-color);
    color: white;
}

/* ========================================
   FIN QUICK REPLIES
   ======================================== */

/* ========================================
   ✅ NUEVO v6.3.1: VER TAMBIÉN (Related Content)
   ======================================== */

/* Contenedor principal */
.chatbot-related-content {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid var(--chatbot-border-color);
    padding: 12px 16px;
    margin: 0;
}

/* Título de la sección */
.chatbot-related-title {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-related-title::before {
    content: '📚';
    font-size: 14px;
}

/* Lista de enlaces relacionados */
.chatbot-related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Ítem individual */
.chatbot-related-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: var(--chatbot-text-color);
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chatbot-related-item:hover {
    background: white;
    border-color: var(--chatbot-primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

/* Icono del tipo de contenido */
.chatbot-related-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* Texto del enlace */
.chatbot-related-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Flecha indicadora */
.chatbot-related-arrow {
    font-size: 12px;
    color: #adb5bd;
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
}

.chatbot-related-item:hover .chatbot-related-arrow {
    color: var(--chatbot-primary-color);
    transform: translateX(3px);
}

/* Estilo para enlaces externos (con URL) */
.chatbot-related-item[target="_blank"] .chatbot-related-arrow {
    font-size: 11px;
}

.chatbot-related-item[target="_blank"]:hover .chatbot-related-arrow {
    transform: translate(2px, -2px);
}

/* Animación de entrada */
.chatbot-related-content {
    animation: slideInUp 0.3s ease;
}

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

/* Tema oscuro */
.chatbot-theme-dark .chatbot-related-content {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

.chatbot-theme-dark .chatbot-related-title {
    color: #a0aec0;
}

.chatbot-theme-dark .chatbot-related-item {
    background: #2d3748;
    color: #e2e8f0;
}

.chatbot-theme-dark .chatbot-related-item:hover {
    background: #3d4a5c;
    border-color: var(--chatbot-primary-color);
}

.chatbot-theme-dark .chatbot-related-arrow {
    color: #718096;
}

/* Responsive: pantallas pequeñas */
@media (max-width: 480px) {
    .chatbot-related-content {
        padding: 10px 12px;
    }
    
    .chatbot-related-item {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .chatbot-related-icon {
        font-size: 14px;
        width: 20px;
    }
}

/* ========================================
   FIN VER TAMBIÉN
   ======================================== */

/* Sugerencias tradicionales (diferente de Quick Replies) */
.chatbot-suggestions {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid var(--chatbot-border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-suggestion {
    background: var(--chatbot-primary-light);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.chatbot-suggestion:hover {
    background: var(--chatbot-primary-color);
}

/* Footer */
.chatbot-footer {
    border-top: 1px solid var(--chatbot-border-color);
    background: white;
    border-radius: 0 0 var(--chatbot-radius) var(--chatbot-radius);
}

.chatbot-form {
    padding: 12px;
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--chatbot-border-color);
    border-radius: var(--chatbot-radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--chatbot-primary-color);
}

.chatbot-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.chatbot-send {
    background: var(--chatbot-primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--chatbot-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover:not(:disabled) {
    background: var(--chatbot-primary-dark);
}

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

.chatbot-powered {
    text-align: center;
    padding: 8px 12px 12px;
}

.chatbot-powered small {
    font-size: 11px;
    color: var(--chatbot-text-secondary);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-widget[data-position="bottom-right"],
    .chatbot-widget[data-position="bottom-left"] {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-window {
        width: 100%;
        height: calc(100vh - 100px);
        max-width: none;
        bottom: 70px;
    }
    
    .chatbot-trigger {
        width: 56px;
        height: 56px;
    }
    
    /* ✅ NUEVO v5.1.2: Quick Replies responsivos */
    .chatbot-quick-reply {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .chatbot-quick-reply-icon {
        font-size: 14px;
    }
}

/* Estado minimizado */
.chatbot-widget[data-state="minimized"] .chatbot-messages,
.chatbot-widget[data-state="minimized"] .chatbot-suggestions,
.chatbot-widget[data-state="minimized"] .chatbot-quick-replies,
.chatbot-widget[data-state="minimized"] .chatbot-footer {
    display: none;
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.chatbot-badge {
    animation: pulse 2s infinite;
}

/* ✅ NUEVO v5.1.2: Animación de brillo para Quick Replies */
@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.chatbot-quick-reply::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
    pointer-events: none;
}

.chatbot-quick-reply:hover::before {
    opacity: 1;
    animation: shimmer 1.5s infinite;
}

/* Dark mode (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --chatbot-bg-color: #1e1e1e;
        --chatbot-text-color: #ffffff;
        --chatbot-text-secondary: #b0b0b0;
        --chatbot-border-color: #3a3a3a;
    }
    
    .chatbot-messages {
        background: #2a2a2a;
    }
    
    .chatbot-message-bot .chatbot-message-content {
        background: #2a2a2a;
        color: var(--chatbot-text-color);
        border-color: var(--chatbot-border-color);
    }
    
    /* ✅ NUEVO v5.1.2: Quick Replies en dark mode */
    .chatbot-quick-reply {
        background: #2a2a2a;
        color: var(--chatbot-text-color);
    }
    
    .chatbot-quick-reply:hover {
        background: #3a3a3a;
    }
}

/* Accesibilidad */
.chatbot-widget button:focus {
    outline: 2px solid var(--chatbot-primary-light);
    outline-offset: 2px;
}

.chatbot-input:focus {
    outline: 2px solid var(--chatbot-primary-light);
    outline-offset: -2px;
}

/* ✅ NUEVO v5.1.2: Accesibilidad para Quick Replies */
.chatbot-quick-reply:focus {
    outline: 2px solid var(--chatbot-primary-light);
    outline-offset: 2px;
}

.chatbot-quick-reply:focus-visible {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

/* Utilidades */
.chatbot-hidden {
    display: none !important;
}

.chatbot-error .chatbot-message-content {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}
/* ============================================
   🚨 PARCHE EMERGENCIA - Forzar Sugerencias
   Agregar al FINAL de chatbot-styles.css
   ============================================ */

/* Forzar visibilidad del contenedor de sugerencias */
.chatbot-suggestions,
#chatbot-suggestions {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 12px !important;
    background: #f8f9fa !important;
    border-top: 1px solid #e1e4e8 !important;
    min-height: 50px !important;
    max-height: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Cuando está vacío, ocultarlo */
.chatbot-suggestions:empty,
#chatbot-suggestions:empty {
    display: none !important;
    padding: 0 !important;
    min-height: 0 !important;
}

/* Forzar visibilidad de botones de sugerencias */
.chatbot-suggestion,
.chatbot-suggestions button,
#chatbot-suggestions button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 11 !important;
    padding: 8px 16px !important;
    background: #2271b1 !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    max-width: calc(100% - 16px) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

/* Hover en botones */
.chatbot-suggestion:hover,
.chatbot-suggestions button:hover,
#chatbot-suggestions button:hover {
    background: #135e96 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Active (cuando se hace click) */
.chatbot-suggestion:active,
.chatbot-suggestions button:active,
#chatbot-suggestions button:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* Focus (accesibilidad) */
.chatbot-suggestion:focus,
.chatbot-suggestions button:focus,
#chatbot-suggestions button:focus {
    outline: 2px solid #2271b1 !important;
    outline-offset: 2px !important;
}

/* Quick replies (soporte para v5.1.2) */
.chatbot-quick-replies {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 12px !important;
    background: #f8f9fa !important;
    border-top: 1px solid #e1e4e8 !important;
}

.chatbot-quick-reply {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 8px 16px !important;
    background: #2271b1 !important;
    color: white !important;
    border: none !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.3s ease !important;
}

.chatbot-quick-reply:hover {
    background: #135e96 !important;
    transform: translateY(-2px) !important;
}

/* Iconos en quick replies */
.chatbot-quick-reply-icon {
    font-size: 16px !important;
    line-height: 1 !important;
}

.chatbot-quick-reply-text {
    line-height: 1.4 !important;
}

/* Animación de aparición */
@keyframes chatbot-suggestion-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-suggestion,
.chatbot-quick-reply {
    animation: chatbot-suggestion-appear 0.3s ease forwards !important;
}

/* Responsive - Móviles */
@media (max-width: 480px) {
    .chatbot-suggestions,
    #chatbot-suggestions,
    .chatbot-quick-replies {
        padding: 10px !important;
        gap: 6px !important;
    }
    
    .chatbot-suggestion,
    .chatbot-quick-reply {
        padding: 6px 12px !important;
        font-size: 13px !important;
    }
}

/* Prevenir que otros estilos oculten */
.chatbot-window .chatbot-suggestions,
.chatbot-window #chatbot-suggestions {
    display: flex !important;
}

.chatbot-window .chatbot-suggestions:not(:empty),
.chatbot-window #chatbot-suggestions:not(:empty) {
    display: flex !important;
}

/* Debugging (comentar en producción) */
/*
.chatbot-suggestions::before,
#chatbot-suggestions::before {
    content: "🔍 SUGERENCIAS: " !important;
    display: block !important;
    width: 100% !important;
    padding: 4px !important;
    background: yellow !important;
    color: black !important;
    font-size: 11px !important;
    font-weight: bold !important;
}
*/

/**
 * Estilos para el Panel de Escalado - Hacce Chatbot v6.4.0
 * 
 * Añadir estos estilos al final de chatbot-styles.css
 * o crear un archivo separado chatbot-escalation.css
 */

/* 
============================================
   PANEL DE ESCALADO - Detección de Frustración
   ============================================ */

.chatbot-escalation-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-escalation-panel.chatbot-escalation-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Mensaje de escalado */
.chatbot-escalation-message {
    font-size: 14px;
    color: #495057;
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.5;
    padding: 0 24px;
}

/* Contenedor de botones */
.chatbot-escalation-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* Botones de escalado */
.chatbot-escalation-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: white;
    background-color: #6c757d;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    min-width: 140px;
}

.chatbot-escalation-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.chatbot-escalation-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Colores específicos por tipo */
.chatbot-escalation-whatsapp {
    background-color: #25D366;
}

.chatbot-escalation-phone {
    background-color: #4CAF50;
}

.chatbot-escalation-email {
    background-color: #2196F3;
}

.chatbot-escalation-contact_form,
.chatbot-escalation-contact_page {
    background-color: #FF9800;
}

/* Iconos */
.chatbot-escalation-icon {
    font-size: 16px;
    line-height: 1;
}

/* Texto del botón */
.chatbot-escalation-text {
    white-space: nowrap;
}

/* Botón de cerrar */
.chatbot-escalation-dismiss {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.chatbot-escalation-dismiss:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #343a40;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 400px) {
    .chatbot-escalation-panel {
        padding: 12px;
        margin: 8px 4px;
    }
    
    .chatbot-escalation-message {
        font-size: 13px;
        padding: 0 16px;
        margin-bottom: 12px;
    }
    
    .chatbot-escalation-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .chatbot-escalation-button {
        min-width: unset;
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   TEMA OSCURO (opcional)
   ============================================ */

.chatbot-theme-dark .chatbot-escalation-panel {
    background: linear-gradient(135deg, #2d3436 0%, #1e272e 100%);
    border-color: #4a5568;
}

.chatbot-theme-dark .chatbot-escalation-message {
    color: #e2e8f0;
}

.chatbot-theme-dark .chatbot-escalation-dismiss {
    background: rgba(255, 255, 255, 0.1);
    color: #a0aec0;
}

.chatbot-theme-dark .chatbot-escalation-dismiss:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes escalation-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.chatbot-escalation-panel.chatbot-escalation-visible {
    animation: escalation-pulse 2s ease-in-out 1;
}

/* Animación de entrada para botones */
.chatbot-escalation-button {
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
}

.chatbot-escalation-button:nth-child(1) { animation-delay: 0.1s; }
.chatbot-escalation-button:nth-child(2) { animation-delay: 0.2s; }
.chatbot-escalation-button:nth-child(3) { animation-delay: 0.3s; }
.chatbot-escalation-button:nth-child(4) { animation-delay: 0.4s; }

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

/* ════════════════════════════════════════════════════════════════════════
 * ✅ v8.2.0 — Feedback (👍/👎) por respuesta del bot
 *
 * Universal: estilos discretos, sin colores que asuman branding específico.
 * Hereda el `--chatbot-primary-color` que ya está definido para el resto del
 * widget. Sólo afecta a `.chatbot-message-bot`.
 * ════════════════════════════════════════════════════════════════════════ */

.chatbot-feedback {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 12px;
}

.chatbot-feedback-label {
    color: #6b7280;
    font-size: 11px;
    margin-right: 4px;
}

.chatbot-feedback-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #6b7280;
    transition: all 0.15s ease-out;
}
.chatbot-feedback-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}
.chatbot-feedback-btn:focus {
    outline: 2px solid var(--chatbot-primary-color, #0066cc);
    outline-offset: 1px;
}
.chatbot-feedback-btn.is-selected {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}
.chatbot-feedback-btn.is-faded {
    opacity: 0.3;
}
.chatbot-feedback-btn[disabled] {
    cursor: default;
}

/* ════════════════════════════════════════════════════════════════════════
 * ✅ v8.2.0-beta.2 — Comment box opcional tras voto negativo
 *
 * Universal: estilos discretos, sin asumir branding. Aparece debajo de los
 * botones 👍/👎 cuando el usuario vota 👎 y el toggle allowComment está ON.
 * ════════════════════════════════════════════════════════════════════════ */

.chatbot-feedback-comment {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    animation: chatbot-feedback-comment-in 0.2s ease-out;
}
@keyframes chatbot-feedback-comment-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.chatbot-feedback-comment.chatbot-feedback-comment-done {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
.chatbot-feedback-comment-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    color: #374151;
    background: #fafafa;
    resize: vertical;
    min-height: 44px;
    box-sizing: border-box;
}
.chatbot-feedback-comment-input:focus {
    outline: none;
    border-color: var(--chatbot-primary-color, #0066cc);
    background: #fff;
}
.chatbot-feedback-comment-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}
.chatbot-feedback-comment-send,
.chatbot-feedback-comment-skip {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 3px 10px;
    cursor: pointer;
    font-size: 11px;
    color: #4b5563;
    transition: all 0.15s ease-out;
}
.chatbot-feedback-comment-send {
    background: var(--chatbot-primary-color, #0066cc);
    color: #fff;
    border-color: transparent;
}
.chatbot-feedback-comment-send:hover { opacity: 0.9; }
.chatbot-feedback-comment-skip:hover { background: rgba(0, 0, 0, 0.05); }
.chatbot-feedback-comment-send[disabled],
.chatbot-feedback-comment-skip[disabled] { opacity: 0.5; cursor: default; }
