/*
 * /assets/css/components/_loader.css
 * Estilos para el estado de carga de elementos del formulario.
 */

.select2-container--disabled .select2-selection--multiple,
.select2-container--disabled .select2-selection--single {
    cursor: wait !important;
    opacity: 0.65;
    transition: opacity 0.2s ease-in-out;
}

.select2-container--default .select2-selection--multiple {
    min-height: 38px;
}

.cr-preview-spinner {
  text-align: center;
  font-style: italic;
  color: #666;
  padding: 2rem;
}

.cr-loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0d6efd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*
 * /assets/css/components/_modal-front.css
 * Estilos para la apariencia del modal de previsualización.
 */

.cr-preview-modal-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: #333;
  line-height: 1.6;
}

.cr-preview-modal-body h1,
.cr-preview-modal-body h2,
.cr-preview-modal-body .entry-title {
  font-size: 1.6rem;
  color: #1d2327;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.cr-preview-modal-body h3,
.cr-preview-modal-body h4 {
  font-size: 1.1rem;
  color: #50575e;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}

.cr-preview-modal-body p {
  font-size: 1rem;
  margin-bottom: 1.25rem;
}

.cr-preview-modal-body a.button,
.cr-preview-modal-body button {
  display: inline-block;
  text-decoration: none;
  font-size: 1rem;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 4px;
  background-color: #2271b1;
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.cr-preview-modal-body a.button:hover,
.cr-preview-modal-body button:hover {
  background-color: #1d2327;
  color: #fff;
}

.cr-preview-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2147483647;
  align-items: center;
  justify-content: center;
}

.cr-preview-modal-overlay.is-visible {
    display: flex !important;
}

.cr-preview-modal-contenido {
  background: #fff;
  width: 90%;
  max-width: 800px;
  max-height: 85vh;
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
}

.cr-modal-hidden {
    display: none !important;
}

.cr-preview-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  color: #666;
  padding: 5px;
}

.cr-preview-modal-close:hover {
  color: #000;
}

.cr-preview-modal-body {
  padding: 1rem 1.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

.cr-preview-modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.cr-preview-modal-body th,
.cr-preview-modal-body td {
  border: 1px solid #ddd;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.95rem;
}

#cr-modal-footer-content {
  padding: 1rem 1.5rem;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
  flex-shrink: 0;
}

#cr-ai-summary-result {
  margin-top: 1rem;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px 15px;
  border-radius: 4px;
}

#cr-modal-footer-content .button-primary {
  margin-left: 5px;
}

/*
 * /assets/css/components/_tables.css
 */
.previsualizar-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  vertical-align: middle;
}

.previsualizar-btn svg {
  width: 20px;
  height: 20px;
  color: #444;
  transition: color 0.2s;
}

.previsualizar-btn:hover svg {
  color: #0b61a4;
}

.wp-list-table th a.cr-sort-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
}

.wp-list-table th a.cr-sort-link:hover {
  text-decoration: underline;
}

.cr-live-results-table th,
.cr-live-results-table td {
    text-align: center;
    vertical-align: middle;
}

.cr-live-results-table td:nth-child(3),
.cr-live-results-table th:nth-child(3) {
    text-align: left;
}

/* ========================================================================== */
/* =================== INICIO DE ESTILOS DEL CHATBOT ABI ==================== */
/* ========================================================================== */

:root {
  --color-fondo: #f4f4f9;
  --color-primario: #4A90E2;
  --color-secundario: #ffffff;
  --color-burbuja-usuario: #DCF8C6;
  --color-burbuja-bot: #ffffff;
  --color-texto: #333333;
  --color-borde-input: #cccccc;
  --color-placeholder: #999999;
  --sombra-chat: rgba(0, 0, 0, 0.1);
}

#chatContainer * {
  box-sizing: border-box;
}

#chatContainer {
  width: 100%;
  height: 70vh;
  display: flex;
  flex-direction: column;
  background-color: #eef1f5;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--sombra-chat);
  overflow: hidden;
  position: relative;
}

#chatBody {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  opacity: 1;
  overflow: visible;
  background-color: #eef1f5;
}

#chatWindow {
  flex: 1;
  min-height: 0;
  padding: 16px;
  background-color: #eef1f5;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  position: relative;
}

/* ========================================================= */
/* ===== INICIO DE CORRECCIONES FINALES DE FORMATO ===== */
/* ========================================================= */
/* 1. Forzar la negrita para que siempre sea visible con alta especificidad */
#chatWindow .chat-message strong,
#chatWindow .chat-message b {
    font-weight: 700 !important; /* Usar 700 es sinónimo de bold y a veces funciona mejor */
}

/* 2. Ajustar el margen de los párrafos para un espaciado consistente */
.chat-message p {
    margin-top: 0;
    margin-bottom: 0.5em; /* Añade un pequeño espacio debajo de cada párrafo */
}

/* 3. Asegurar que el último párrafo de un mensaje no tenga margen inferior */
.chat-message p:last-child {
    margin-bottom: 0;
}

/* 4. Mejorar el espaciado y formato de las listas */
.chat-message ol,
.chat-message ul {
    padding-left: 20px;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.chat-message li {
    margin-bottom: 0.75em; /* Añade espacio entre cada ítem de la lista */
}

.chat-message li p {
    display: inline; /* Corrige el salto de línea entre el título y la descripción */
    margin: 0;
}
/* ======================================================= */
/* ===== FIN DE CORRECCIONES FINALES DE FORMATO ===== */
/* ======================================================= */

.chat-message.thinking {
  font-style: italic;
  color: #6c757d;
}
.chat-message .list-group-item {
    padding: 0.75rem 1rem;
    font-size: 13px;
}
.chat-message.user {
  background-color: var(--color-burbuja-usuario);
  color: var(--color-texto);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 18px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

.chat-message.bot {
  background-color: var(--color-burbuja-bot);
  color: var(--color-texto);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 18px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 1px 3px var(--sombra-chat);
  padding-left: 48px;
  padding-top: 16px;
}

.chat-message.bot::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-image: url("https://soyhugoortega.com/wp-content/uploads/2025/05/Abi-Chat.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid #ddd;
}

#chatInputContainer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background-color: #fafbfc;
  border-top: 1px solid #e0e0e0;
}

#inputText {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-borde-input);
  border-radius: 20px;
  font-size: 15px;
  outline: none;
  color: var(--color-texto);
}

#inputText::placeholder {
  color: var(--color-placeholder);
}

#sendButton {
  padding: 0 16px;
  background-color: var(--color-primario);
  color: #ffffff;
  font-size: 15px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#sendButton:hover {
  background-color: #3a7dc1;
  transform: translateY(-2px);
}

#sendButton:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

#chatWindow::-webkit-scrollbar {
  width: 6px;
}

#chatWindow::-webkit-scrollbar-track {
  background: transparent;
}

#chatWindow::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

@media (max-width: 480px) {
  #activateButton {
    font-size: 15px;
    padding: 10px 20px;
  }
  #inputText,
  #sendButton {
    font-size: 14px;
    padding: 8px 10px;
  }
  .chat-message.bot {
    padding-left: 40px;
    padding-top: 12px;
  }
  .chat-message.bot::before {
    width: 28px;
    height: 28px;
    left: 6px;
    top: 6px;
  }
}

/* ======================================================================== */
/* =================== FIN DE ESTILOS DEL CHATBOT ABI ===================== */
/* ======================================================================== */

.source-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    flex-grow: 1;
    min-width: 220px;
    transition: box-shadow 0.2s ease-in-out;
}

.source-card:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.source-card-content {
    display: flex;
    flex-direction: column;
    margin-right: 1rem;
}

.source-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}

.source-card-relevance {
    font-size: 0.8rem;
    color: #6c757d;
}

.source-card-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.source-card-actions .btn .dashicons {
    vertical-align: text-bottom;
}