/* Co-Pilot UI Styles */

:root {
  --asst-grad-from: #7a00df;
  --asst-grad-to: #0693e3;
  --asst-grad: linear-gradient(135deg, var(--asst-grad-from), var(--asst-grad-to));
}

/* Floating Pill */
.asst-pill {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--asst-grad);
  color: #fff;
  border: none;
  border-radius: 28px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(122, 0, 223, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.asst-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(122, 0, 223, 0.4);
}
.asst-pill .asst-mark {
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

/* Initial Pulse-Animation 1× */
@keyframes asst-pill-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(122, 0, 223, 0.3); }
  50% { box-shadow: 0 8px 36px rgba(122, 0, 223, 0.6), 0 0 0 8px rgba(122, 0, 223, 0.15); }
}
.asst-pill.asst-pill-introduce {
  animation: asst-pill-pulse 2s ease-in-out 1;
}

/* Pill versteckt wenn Sheet offen */
.asst-sheet-open .asst-pill {
  display: none;
}

/* === In-Gallery Pill Variant ===
   Wenn Pill in einen relativen Container gemounted wird (z.B. Hero-Bild),
   überschreiben wir position fixed → absolute, plus white-glass + conic glow.
*/
@property --asst-conic-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes asst-conic-spin { to { --asst-conic-angle: 360deg; } }

/* Glow-Pill Variant — adapts delonghi-v2/.ask-ai-btn style */
.asst-pill.asst-pill-glow {
  background: transparent;
  color: #1d1d1f;
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: none;
  isolation: isolate;
  transition: filter 0.2s ease, transform 0.15s ease;
  --asst-conic-angle: 0deg;
  animation: asst-conic-spin 8s linear infinite;
}
.asst-pill.asst-pill-glow::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: conic-gradient(from var(--asst-conic-angle), #bf5af2, #0a84ff, #30d158, #ff9f0a, #ff375f, #bf5af2);
  z-index: -1;
  filter: blur(10px);
  opacity: 0.85;
  pointer-events: none;
}
.asst-pill.asst-pill-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  z-index: -1;
}
.asst-pill.asst-pill-glow .asst-mark {
  width: auto;
  height: auto;
  background: transparent;
  color: inherit;
  font-size: 13px;
  border-radius: 0;
}
.asst-pill.asst-pill-glow:hover {
  filter: brightness(0.96);
  transform: scale(1.02);
}
.asst-pill.asst-pill-glow:active {
  transform: scale(0.98);
}

/* In-Gallery: überschreibt position:fixed → absolute, oben-rechts im Container */
.asst-pill.asst-pill-in-gallery {
  position: absolute !important;
  right: 16px !important;
  top: 16px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 50 !important;
}

/* === Lightbox / Fullscreen-Image-Viewer === */
.asst-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.asst-lightbox.asst-visible {
  opacity: 1;
  pointer-events: auto;
}
.asst-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  cursor: zoom-out;
}
.asst-lightbox-close {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
}
.asst-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
.asst-lightbox .asst-pill {
  position: absolute !important;
  top: 24px !important;
  right: 24px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 51 !important;
}

/* Hint-Cursor wenn ein Image klickbar ist */
[data-asst-zoomable] { cursor: zoom-in; }

/* Backdrop */
.asst-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 9100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}
.asst-backdrop.asst-visible {
  opacity: 1;
  pointer-events: auto;
}

/* Sheet — Desktop default: Side-Panel rechts, Mobile-Override: Bottom-Sheet (siehe @media unten) */
.asst-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 92vw;
  z-index: 9200;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px 0 0 16px;
  box-shadow: -16px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
}
.asst-sheet.asst-visible {
  transform: translateX(0);
}
.asst-sheet-grabber {
  display: none;
  width: 40px;
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin: 8px auto 0;
}
.asst-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--asst-grad);
  color: #fff;
  margin-top: 4px;
}
.asst-sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}
.asst-sheet-title .asst-mark {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.asst-sheet-meta {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}
.asst-sheet-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.asst-sheet-close:hover { background: rgba(255, 255, 255, 0.25); }
.asst-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  background: #fafafa;
  font-size: 14px;
  color: #1d1d1f;
  line-height: 1.5;
}
.asst-sheet-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #fff;
}
.asst-sheet-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}
.asst-sheet-input:focus { border-color: var(--asst-grad-from); }
.asst-sheet-send {
  width: 36px;
  height: 36px;
  background: var(--asst-grad);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.asst-sheet-send:hover { transform: scale(1.05); }
.asst-sheet-send:disabled { opacity: 0.4; cursor: not-allowed; }

.asst-sheet-footer {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 8px 0;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}
.asst-sheet-footer .asst-demoup {
  color: var(--asst-grad-from);
  font-weight: 700;
}

.asst-greeting {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(122, 0, 223, 0.06), rgba(6, 147, 227, 0.06));
  border: 1px solid rgba(122, 0, 223, 0.15);
  border-radius: 12px;
}
.asst-greeting-title {
  font-weight: 700;
  font-size: 14px;
  color: #1d1d1f;
  margin-bottom: 4px;
}
.asst-greeting-sub {
  color: #555;
  font-size: 13px;
  line-height: 1.45;
}

.asst-suggested-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  color: #888;
  font-weight: 700;
  margin-bottom: 8px;
}

.asst-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.asst-chip {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-family: inherit;
  font-size: 13px;
  color: #1d1d1f;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.asst-chip:hover {
  border-color: var(--asst-grad-from);
  background: #faf6ff;
}
.asst-chip-icon {
  display: inline-block;
  margin-right: 6px;
}

.asst-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.asst-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.asst-msg-avatar-ai {
  background: var(--asst-grad);
  color: #fff;
}
.asst-msg-avatar-user {
  background: #fff;
  border: 1px solid #e8e8e8;
  overflow: hidden;
}
.asst-msg-avatar-user img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.asst-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  line-height: 1.5;
  font-size: 14px;
  color: #1d1d1f;
}
.asst-msg-bubble strong { color: #1d1d1f; }
.asst-msg-bubble ul { margin: 8px 0 0 18px; padding: 0; }
.asst-msg-bubble li { margin-bottom: 4px; }

.asst-msg-user {
  flex-direction: row-reverse;
}
.asst-msg-user .asst-msg-bubble {
  background: #f3eaff;
  border-color: #d4b8ff;
}

/* Typing-Indicator */
.asst-typing {
  display: inline-flex;
  gap: 4px;
}
.asst-typing-dot {
  width: 6px;
  height: 6px;
  background: #999;
  border-radius: 50%;
  animation: asst-typing 1.2s infinite ease-in-out;
}
.asst-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.asst-typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes asst-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Verified-Badge (Trust-Signal: Antwort auf Produktdaten basiert) */
.asst-msg-verified {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 9px 3px 7px;
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.28);
  border-radius: 10px;
  font-size: 11px;
  color: #1a7a3a;
  font-weight: 600;
  cursor: help;
  user-select: none;
  position: relative;
}
.asst-msg-verified::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  background: #30d158;
  color: #fff;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
}
.asst-msg-verified:hover .asst-verified-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.asst-verified-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 260px;
  padding: 10px 12px;
  background: #1d1d1f;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.45;
  font-weight: 400;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.asst-verified-tooltip strong {
  color: #fff;
  font-weight: 700;
}
.asst-verified-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 16px;
  border: 6px solid transparent;
  border-top-color: #1d1d1f;
}

/* Cart-CTA nach jeder AI-Antwort — expert-Orange, klar von Chat-Bubbles getrennt */
.asst-cart-cta-wrap {
  margin-top: 10px;
}
.asst-cart-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ed7300;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(237, 115, 0, 0.25);
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
}
.asst-cart-cta:hover {
  background: #d96900;
  box-shadow: 0 4px 10px rgba(237, 115, 0, 0.35);
}
.asst-cart-cta:active {
  transform: scale(0.98);
}
.asst-cart-cta-added {
  background: #1a7a3a !important;
  box-shadow: 0 2px 6px rgba(26, 122, 58, 0.3) !important;
}

/* Action-Tag (zeigt Co-Pilot-Aktion in der Bubble) */
.asst-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(122, 0, 223, 0.08), rgba(6, 147, 227, 0.08));
  border: 1px solid rgba(122, 0, 223, 0.3);
  border-radius: 10px;
  font-size: 11px;
  color: var(--asst-grad-from);
  font-weight: 600;
}

.asst-reviews {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: #fafafa;
  border-radius: 10px;
  border: 1px solid #eee;
}
.asst-review-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
}
.asst-review-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-weight: 600;
  color: #555;
}
.asst-review-stars {
  color: #f5a623;
  font-size: 11px;
}
.asst-review-text {
  color: #1d1d1f;
  font-style: italic;
}

.asst-compare {
  margin-top: 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  font-size: 12px;
}
.asst-compare-head {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  background: #f6f3ff;
  border-bottom: 1px solid #e8e0ff;
}
.asst-compare-cell {
  padding: 8px 10px;
  text-align: center;
  font-weight: 700;
  color: #1d1d1f;
}
.asst-compare-cell-label {
  text-align: left;
  background: #fafafa;
  font-weight: 600;
  color: #555;
}
.asst-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid #f0f0f0;
}
.asst-compare-row:last-child { border-bottom: none; }
.asst-compare-cell.winner-pixel {
  background: linear-gradient(135deg, rgba(122, 0, 223, 0.06), rgba(6, 147, 227, 0.06));
  font-weight: 700;
}
.asst-compare-cell.winner-competitor {
  background: rgba(0, 0, 0, 0.02);
}
.asst-compare-verdict {
  padding: 10px 12px;
  background: #faf6ff;
  border-top: 1px solid #e8e0ff;
  font-size: 12px;
  color: #1d1d1f;
  font-style: italic;
}
.asst-compare-verdict strong { font-style: normal; }

@media (max-width: 600px) {
  .asst-pill {
    right: 16px;
    bottom: 16px;
    padding: 10px 14px;
    font-size: 13px;
  }
  /* Mobile: Bottom-Sheet statt Side-Panel */
  .asst-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: 80vh;
    max-height: 720px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(100%);
  }
  .asst-sheet.asst-visible {
    transform: translateY(0);
  }
  .asst-sheet-grabber { display: block; }
}
