/* Texim AI Search widget — Texim Europe brand styling. Scoped under .texim-ais.
   Mirrors tokens & button conventions from the corporate site dd_style.css. */
.texim-ais {
  --tex-blue: #2559D5;
  --tex-blue-dark: #2348A3;
  --tex-lightblue: #EBF0FB;
  --tex-yellow: #FEB904;
  --tex-yellow-hov: #f5a800;
  --tex-card: #ffffff;
  --tex-surface: #f7f9fc;
  --tex-border: #e5e7eb;
  --tex-border-soft: #eef2f7;
  --tex-text: #4A4A4A;
  --tex-muted: #6b7280;
  --tex-shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(37, 89, 213, .04);
  --tex-shadow-hover: 0 8px 28px rgba(37, 89, 213, .14);
  --tex-radius-lg: 12px;
  --tex-radius-md: 8px;
  --tex-radius-pill: 40px;
  --tex-font: "Titillium Web", Arial, sans-serif;
  --tex-transition: all .3s ease-out 0s;
  font: 15px/1.6 var(--tex-font);
  color: var(--tex-text);
  max-width: 1100px;
  margin: 0 auto;
}
.texim-ais *,
.texim-ais *::before,
.texim-ais *::after { box-sizing: border-box; }

/* Search bar */
.texim-ais__searchbar {
  padding: 14px;
  background: var(--tex-card);
  border: 1px solid var(--tex-border-soft);
  border-radius: var(--tex-radius-lg);
  box-shadow: var(--tex-shadow-card);
}
.texim-ais__form {
  display: flex; gap: 10px; align-items: stretch;
  flex-wrap: nowrap;
}
.texim-ais__input {
  flex: 1 1 auto; min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--tex-border);
  border-radius: var(--tex-radius-md);
  font: inherit; color: var(--tex-blue-dark); background: #fff;
  height: 52px;
  transition: border-color .15s, box-shadow .15s;
}
.texim-ais__input::placeholder { color: #9ca3af; }
.texim-ais__input:focus {
  outline: none;
  border-color: var(--tex-blue);
  box-shadow: 0 0 0 4px rgba(37, 89, 213, .12);
}
.texim-ais__button {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 26px; height: 52px;
  background: var(--tex-yellow); color: var(--tex-blue-dark);
  border: 2px solid var(--tex-yellow);
  border-radius: var(--tex-radius-pill);
  cursor: pointer; font: 600 15px/1.25 var(--tex-font);
  transition: var(--tex-transition);
}
.texim-ais__button:hover:not(:disabled) {
  background: var(--tex-blue); color: #fff; border-color: var(--tex-blue);
}
.texim-ais__button:disabled { opacity: .55; cursor: not-allowed; }
.texim-ais__button svg { width: 18px; height: 18px; }

/* Tabs — corporate-site .category-button */
.texim-ais__tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 22px 0 18px;
  background: none; border: 0; padding: 0;
}
.texim-ais .category-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--tex-lightblue);
  color: var(--tex-blue);
  text-decoration: none;
  font: 600 14px/1.25 var(--tex-font);
  border: 0;
  border-radius: var(--tex-radius-pill);
  cursor: pointer;
  transition: var(--tex-transition);
}
.texim-ais .category-button:hover { opacity: .8; }
.texim-ais .category-button.active {
  background: var(--tex-blue);
  color: #fff;
}

/* AI answer card */
.texim-ais__answer {
  position: relative;
  margin: 22px 0; padding: 24px;
  background: var(--tex-card);
  border: 1px solid var(--tex-border-soft);
  border-radius: var(--tex-radius-lg);
  box-shadow: var(--tex-shadow-card);
  overflow: hidden;
  animation: texim-ais-fade-in .3s ease both;
}
@keyframes texim-ais-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.texim-ais__answer::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--tex-blue), var(--tex-blue-dark));
}

.texim-ais__answer-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.texim-ais__answer-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tex-blue); margin: 0; font-weight: 700;
}
.texim-ais__answer-label svg { width: 16px; height: 16px; color: var(--tex-blue); }
.texim-ais__answer-actions { display: flex; align-items: center; gap: 8px; }

/* Copy button — corporate-site "button blue" */
.texim-ais .button-blue {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--tex-blue);
  color: #fff;
  border: 2px solid var(--tex-blue);
  border-radius: var(--tex-radius-pill);
  font: 600 13px/1.25 var(--tex-font);
  text-decoration: none;
  cursor: pointer;
  transition: var(--tex-transition);
}
.texim-ais .button-blue:hover {
  background: transparent;
  color: var(--tex-blue);
}
.texim-ais .button-blue svg { width: 14px; height: 14px; }
.texim-ais .button-blue:hover svg { color: var(--tex-blue); }
.texim-ais__copy-btn.is-copied {
  background: #16a34a; border-color: #16a34a; color: #fff;
}
.texim-ais__copy-btn.is-copied:hover { background: #16a34a; color: #fff; }

.texim-ais__answer-body { color: var(--tex-text); font-size: 16px; line-height: 1.7; }
.texim-ais__answer-body p { margin: 0 0 12px; }
.texim-ais__answer-body p:last-child { margin-bottom: 0; }
.texim-ais__answer-body ul,
.texim-ais__answer-body ol { margin: 0 0 12px; padding-left: 22px; }
.texim-ais__answer-body li { margin: 4px 0; }
.texim-ais__answer-body li::marker { color: var(--tex-blue); }

/* Inline citation chips */
.texim-ais__cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin: 0 2px;
  vertical-align: super; font-size: 10px; font-weight: 700; line-height: 1;
  background: var(--tex-lightblue); color: var(--tex-blue);
  border-radius: 9px; text-decoration: none;
  transition: var(--tex-transition);
}
.texim-ais__cite:hover { background: var(--tex-blue); color: #fff; }

/* Sources — one per line, readable spacing */
.texim-ais__sources { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--tex-border-soft); }
.texim-ais__sources-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tex-muted); margin: 0 0 12px; font-weight: 700;
}
.texim-ais__sources-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.texim-ais__source-card {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 16px 18px;
  background: var(--tex-surface);
  border: 1px solid var(--tex-border-soft);
  border-radius: var(--tex-radius-md);
  text-decoration: none; color: inherit;
  transition: var(--tex-transition);
}
.texim-ais__source-card:hover,
.texim-ais__source-card.is-highlighted {
  background: #fff; border-color: #c7d7ff;
  box-shadow: 0 4px 14px rgba(37, 89, 213, .1);
}
.texim-ais__source-num {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: var(--tex-blue); color: #fff;
  border-radius: 50%; font-size: 12px; font-weight: 700;
}
.texim-ais__source-body {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.texim-ais__source-title {
  font-size: 15px; font-weight: 600;
  color: var(--tex-blue-dark); line-height: 1.4;
}
.texim-ais__source-meta { display: flex; align-items: center; gap: 10px; }
.texim-ais__source-badge {
  padding: 3px 10px; border-radius: var(--tex-radius-pill);
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.texim-ais__source-badge--corporate { background: var(--tex-lightblue); color: var(--tex-blue); }
.texim-ais__source-badge--catalogue { background: #fef3c7; color: #92400e; }
.texim-ais__source-host {
  display: block;
  font-size: 12px;
  color: var(--tex-muted);
  word-break: break-all;
}
.texim-ais__source-ext { color: var(--tex-muted); opacity: 0; transition: opacity .15s; padding-top: 4px; }
.texim-ais__source-ext svg { width: 16px; height: 16px; }
.texim-ais__source-card:hover .texim-ais__source-ext { opacity: 1; color: var(--tex-blue); }

/* Follow-up questions — outlined button blue */
.texim-ais__followup { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--tex-border-soft); }
.texim-ais__followup-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tex-muted); margin: 0 0 12px; font-weight: 700;
}
.texim-ais__followup-list { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.texim-ais__followup-btn {
  display: inline-flex; align-items: center; justify-content: space-between;
  gap: 14px;
  width: auto; max-width: 100%;
  padding: 12px 22px;
  background: transparent;
  color: var(--tex-blue);
  border: 2px solid var(--tex-blue);
  border-radius: var(--tex-radius-pill);
  font: 600 14px/1.3 var(--tex-font);
  text-align: left;
  cursor: pointer;
  transition: var(--tex-transition);
}
.texim-ais__followup-btn:hover {
  background: var(--tex-blue); color: #fff;
}
.texim-ais__followup-text { flex: 1 1 auto; }
.texim-ais__followup-arrow { display: inline-flex; transition: transform .2s; }
.texim-ais__followup-arrow svg { width: 16px; height: 16px; }
.texim-ais__followup-btn:hover .texim-ais__followup-arrow { transform: translateX(4px); }

/* Results */
.texim-ais__results { margin-top: 8px; }
.texim-ais__section { margin: 32px 0; }
.texim-ais__section-title {
  position: relative;
  font-size: 20px; color: var(--tex-blue-dark); margin: 0 0 18px;
  font-weight: 700;
  padding-bottom: 10px;
}
.texim-ais__section-title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 36px; height: 4px;
  background: var(--tex-yellow);
  border-radius: 2px;
}

/* Result card */
.texim-ais__card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 22px; background: var(--tex-card);
  border: 1px solid var(--tex-border-soft); border-radius: var(--tex-radius-lg);
  margin-bottom: 12px; text-decoration: none; color: inherit;
  box-shadow: var(--tex-shadow-card);
  transition: var(--tex-transition);
}
.texim-ais__card:hover {
  border-color: #c7d7ff;
  box-shadow: var(--tex-shadow-hover);
  transform: translateY(-2px);
}
.texim-ais__card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--tex-muted); }
.texim-ais__badge {
  padding: 4px 10px; border-radius: var(--tex-radius-pill);
  background: var(--tex-lightblue); color: var(--tex-blue);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.texim-ais__card-title { margin: 6px 0 2px; font-size: 17px; font-weight: 700; color: var(--tex-blue-dark); line-height: 1.35; }
.texim-ais__card-snippet { margin: 0; color: var(--tex-muted); font-size: 14px; line-height: 1.6; }
.texim-ais__card-snippet b { color: var(--tex-text); font-weight: 600; }
.texim-ais__readmore {
  align-self: flex-start; margin-top: 12px;
  padding: 8px 18px; background: var(--tex-yellow); color: var(--tex-blue-dark);
  border: 2px solid var(--tex-yellow);
  border-radius: var(--tex-radius-pill); font-size: 13px; font-weight: 600;
  transition: var(--tex-transition);
}
.texim-ais__card:hover .texim-ais__readmore {
  background: var(--tex-blue); color: #fff; border-color: var(--tex-blue);
}

/* Skeleton / states */
.texim-ais__skeleton {
  height: 14px; background: linear-gradient(90deg, #f1f5f9, #e5edf7, #f1f5f9);
  background-size: 200% 100%; animation: texim-ais-skeleton 1.4s infinite;
  border-radius: 6px; margin: 8px 0;
}
@keyframes texim-ais-skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.texim-ais__error {
  padding: 16px 18px; border: 1px solid #fecaca; background: #fef2f2; color: #991b1b;
  border-radius: var(--tex-radius-md); font-size: 14px;
}
.texim-ais__empty {
  color: var(--tex-muted); font-size: 14px; padding: 24px;
  background: var(--tex-surface);
  border: 1px dashed var(--tex-border);
  border-radius: var(--tex-radius-md);
  text-align: center;
}

@media (max-width: 640px) {
  .texim-ais__form { flex-direction: column; align-items: stretch; }
  .texim-ais__button { width: 100%; justify-content: center; }
  .texim-ais__tabs { width: 100%; }
  .texim-ais__followup-btn { width: 100%; }
}
