/* REPORT CHAT */
.report-chat-box {
    max-width: 580px;
    margin: 30px auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-header {
    padding: 24px;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.header-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.chat-header h3 {
    margin: 0 0 4px 0;
    font-family: "DM Sans", Sans-serif;
    font-size: 15px !important;
    font-weight: 700;
    line-height: 22px;
    color: #53075B;
}

.chat-header p {
    margin: 0;
    font-size: 14px;
    color: #374151;
}
.chat-input::placeholder { color: #000 !important; opacity: 1; }
.chat-input::-webkit-input-placeholder { color: #000; }
.chat-input:-ms-input-placeholder { color: #000; }
.chat-input::-ms-input-placeholder { color: #000; }

/* Chat Messages Area */
.chat-messages {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px 24px;
    background: #fafafa;
}

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

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-user .message-content {
    align-self: flex-end;
    background: #6366f1;
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 0 12px;
    max-width: 80%;
}

.message-assistant .message-content {
    align-self: flex-start;
    background: white;
    color: #111827;
    padding: 16px;
    border-radius: 0 12px 12px 12px;
    max-width: 90%;
    border: 1px solid #e5e7eb;
    line-height: 1.6;
}

.message-assistant .message-content a {
    color: #6366f1;
    text-decoration: underline;
}

.message-error .message-content {
    align-self: center;
    background: #fee;
    color: #c00;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #fcc;
}

/* Sources */
.message-sources {
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.sources-title {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.source-link {
    display: block;
    padding: 6px 0;
    font-size: 13px;
    color: #6366f1;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
}

.source-link:last-child {
    border-bottom: none;
}

.source-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Follow-up suggestions in chat */
.followup-suggestions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.suggestion-btn.mini {
    padding: 8px 12px;
    font-size: 13px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

/* Suggestions Section */
.chat-suggestions {
    padding: 24px;
}

.chat-suggestions > p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #374151;
}

.suggestion-btn {
    display: block;
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-btn:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateX(4px);
}

/* Input Area */
.chat-input-area {
    padding: 20px 24px 24px;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

.input-wrapper {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 2px solid #6366f1;
    border-radius: 10px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: #6366f1;
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #111827;
    outline: none;
}

.chat-input::placeholder {
    color: #9ca3af;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: #6366f1;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #4f46e5;
    transform: translateY(-1px);
}

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

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
    color: #6b7280;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
/* Fix long links inside assistant messages */
.message-assistant .message-content {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.message-assistant .message-content a {
  word-break: break-all;
  display: inline-block;
  max-width: 100%;
}
.message-assistant .message-content a[href*=".pdf"] {
  display: inline-block;
  padding: 6px 10px;
  background: #eef2ff;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}
/* Report AI Summary */
.report-ai-summary {
  display: grid;
  gap: 24px;
}
.ai-tldr-text {
	color: #000;
}
.ai-summary-card,
.ai-insights-card {
  background: #faf7ff;
  border: 1px solid #e6dbff;
  border-radius: 12px;
  padding: 20px;
}

.ai-summary-content.loading {
  opacity: 0.6;
}

.ai-insights-list {
  margin: 12px 0;
  padding-left: 18px;
}

.ai-insights-list li {
  margin-bottom: 6px;
}

.ai-reset {
  font-size: 14px;
  color: #6b4eff;
  text-decoration: none;
}
.ai-tldr-card {
  background: #f7f4ff;
  border: 1px solid #e3dcff;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ai-tldr-card a {
  word-break: break-all;
}
.ai-tldr-header {
  font-weight: 600;
  margin-bottom: 12px;
}

.ai-tldr-controls {
  display: flex;
  gap: 12px;
}

.ai-tldr-controls select,
.ai-tldr-controls button {
  height: 44px;
}

.ai-tldr-controls select {
  flex: 1;
}

.ai-tldr-controls button {
  background: #6f42ff;
  color: #fff;
  border: none;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.ai-summary-text {
  margin: 0 0 12px;
}

.ai-insights-list {
  padding-left: 18px;
}
.ai-tldr-card {
  background: #fff;
  border: 1px solid #fff;
  border-radius: 16px;
  padding: 20px;
  margin: 24px 0;
}

.ai-tldr-header {
  font-weight: 600;
  color: #5b3cc4;
  margin-bottom: 12px;
}

/* Stack vertical */
.ai-tldr-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Select wrapper */
.ai-select {
  width: 100%;
  position: relative;
}

/* Select */
.ai-select select.ai-tldr-industry {
  width: 100%;
  display: block;
  box-sizing: border-box;
  padding: 10px 40px 10px 15px;
  border-radius: 12px;
  border: 2px solid #7c3aed;
  font-size: 16px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  margin-bottom: 10px;
  height: 60px;
  line-height: 20px;
}

/* Arrow
.ai-select::afte
  content: "
  position: absolu
  right: 16px;
  transform: translateY(-200
  pointer-events: no
  color: #7C3A
} */

.ai-tldr-card:has(.ai-tldr-result) {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.ai-loading-text .ai-dots {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 2px;
}


.ai-tldr-result {
  width: 100% !important;
}


.ai-tldr-result,
.ai-tldr-summary-card,
.ai-tldr-insights-card {
  max-width: none !important;
}


.elementor-widget-shortcode .elementor-widget-container,
.elementor-shortcode,
.elementor-shortcode > div {
  width: 100% !important;
}


.ai-tldr-card {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.ai-tldr-summary-card {
  background: linear-gradient(
    to bottom right,
    rgba(124, 58, 237, 0.08),
    rgba(167, 139, 250, 0.12),
    rgba(124, 58, 237, 0.08)
  );
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 16px;
  padding: 24px;
}

/* Button */
.ai-tldr-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(90deg, #7c3aed, #5b21b6);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.ai-tldr-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.25);
}

.ai-tldr-btn:disabled {
  opacity: .6;
  cursor: default;
  box-shadow: none;
  transform: none;
}
/* Loading dots */
.ai-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-loading span {
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  animation: ai-bounce 1.4s infinite ease-in-out both;
}

.ai-loading span:nth-child(1) {
  animation-delay: -0.32s;
}
.ai-loading span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes ai-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
.ai-tldr-summary-card {
background: #faf7ff !important;
    border: 1px solid #e6dbff !important;
    border-radius: 12px !important;
    padding: 20px !important;
   font-family: "Open Sans", Sans-serif !important;
  font-size: 16px !important;
  line-height: 28px !important;
 color: #20262D !important;
}

.ai-tldr-insights-card {
background: #faf7ff !important;
    border: 1px solid #e6dbff !important;
    border-radius: 12px !important;
    padding: 20px !important;
   font-family: "Open Sans", Sans-serif !important;
  font-size: 16px !important;
  line-height: 28px !important;
 color: #20262D !important;
}

.ai-tldr-reset {
  background: linear-gradient(90deg, hsl(var(--primary)/0.15), hsl(var(--accent)/0.15));
  transition: background 0.4s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.ai-tldr-reset:hover {
  background: linear-gradient(90deg, hsl(var(--primary)/0.35), hsl(var(--accent)/0.35));
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  transform: translateY(-1px);
}
.ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,.2);
  border-top-color: rgba(0,0,0,.6);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.ai-highlight {
  background: #f1effd;
  border: 1px solid #4f46e5;
  box-shadow: 0 0 0 2px rgba(79,70,229,.15);
  transition: all .4s ease;
}
.ai-tldr-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: transparent;
  color: hsl(262 83% 58% / 0.8) !important;
  font-size: 0.875rem;
  font-weight: 500;
}
.ai-tldr-reset a {
	color: hsl(262 83% 58% / 0.8) !important;
}
.ai-tldr-reset:hover {
  background-color: hsl(262 90% 95%);
  color: hsl(262 83% 58% / 0.8);
}
/* === AI Personalized box (IDENTICAL to Lovable) === */
.ai-tldr-card {
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  padding: 24px;
}

/* Header (✨ AI-Personalized...) */
.ai-tldr-header {
  color: #7C3AED; /* violet */
  font-weight: 600;
}

/* Title inside card */
.ai-tldr-card h3 {
  color: #6D28D9;
  font-weight: 600;
}

/* Body text */
.ai-tldr-card p {
  font-family: "Open Sans", Sans-serif !important;
  font-size: 16px !important;
  line-height: 1.625 !important;
 color: #0F172A !important;
}

/* Remove Elementor prose overrides */
.ai-tldr-card.prose {
  max-width: none;
}
.ai-tldr-controls select.ai-tldr-industry {
  appearance: none !important;
  -webkit-appearance: none !important;

  width: 100%;
  height: 44px;
  padding: 0 44px 0 14px;

  border-radius: 8px;
  border: 1px solid #E5E7EB;
  background-color: #fff;

  font-size: 14px;
  font-weight: 500;
  color: #0F172A;

  background-image: none;
}

/* focus like Lovable */
.ai-tldr-controls select.ai-tldr-industry:focus {
  outline: none;
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124,58,237,.15);
}

/* arrow */
.ai-tldr-controls {
  position: relative;
}
.ai-tldr-controls::after {
  content: "▾";
  position: absolute;
  right: 25px;
  top: 23%;
  transform: translateY(-50%);
  color: #6D28D9;
  pointer-events: none;
}
.ai-tldr-industry {
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    transform .15s ease;
}

/* cuando se hace click / focus */
.ai-tldr-industry:focus {
  border-color: #7C3AED;
  box-shadow:
    0 0 0 3px rgba(124,58,237,.15),
    0 4px 12px rgba(124,58,237,.12);
  transform: translateY(-1px);
}
/* Card principal como Lovable */
.ai-tldr-controls {
  border: 1px solid #E6DAFF;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

/* Espacio entre select y botón */
.ai-tldr-controls select {
  margin-bottom: 12px;
}
.report-chat-sticky {
  position: sticky;
  top: 120px; /* header + admin bar */
}

.elementor-widget-wrap,
.elementor-widget-shortcode,
.elementor-column {
  overflow: visible !important;
}
.ai-tldr-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 6px;
  font-size: 14px;
}
.ai-loading-note {
  font-size: 14px;
  opacity: .8;
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
}
