/* =====================================================================
 *  Stellwerk18 – Azure OpenAI Chat Styles  (rev-2)
 *  -------------------------------------------------
 *  Feintuning: Input-Feld & Container vertikal/padding
 * ===================================================================*/

:root {
  --sw18-blue: #0065a5;
  --sw18-blue-dark: #0065a5;
  --sw18-blue-light: #e6f3fc;
  --sw18-red: #e62329;
  --sw18-grey: #f6f7f8;
  --sw18-text: #1a1a1a;
}

/* Prevent background scrolling when chat is open on mobile */
/* MAXIMUM SPECIFICITY für Elementor/7 Elements Custom CSS Kompatibilität */
body.azure-openai-chat-scroll-locked,
html body.azure-openai-chat-scroll-locked,
body.azure-openai-chat-scroll-locked.elementor-page,
body.azure-openai-chat-scroll-locked[class*="elementor"] {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

/* Elementor-spezifische Overrides */
body.azure-openai-chat-scroll-locked #page,
body.azure-openai-chat-scroll-locked .elementor,
body.azure-openai-chat-scroll-locked .elementor-section {
  overflow: hidden !important;
}

/* --------------------------------------------------
 *  Grund-Container
 * ------------------------------------------------*/
.azure-openai-chat-container {
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--sw18-blue-light);
  border-radius: 16px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  z-index: 999;
}

/* --------------------------------------------------
 *  Nachrichtenliste
 * ------------------------------------------------*/
.azure-openai-chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 20px 18px;
  background-color: #fff;
}
.azure-openai-chat-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px; /* Increased space for copy button */
  position: relative;
}
.azure-openai-chat-message.user {
  align-items: flex-end;
}
.azure-openai-chat-message.bot {
  align-items: flex-start;
}
.azure-openai-chat-message .message-content {
  max-width: 80%;
  padding: 8px 13px; /* Reduced padding for cleaner look */
  border-radius: 18px;
  line-height: 1.4;
  font-size: 15px;
  font-weight: 400; /* Gleiche Schriftstärke wie Suggestion-Buttons */
  word-break: break-word;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  margin-bottom: 0; /* Remove margin to eliminate uneven spacing */
}

/* Copy button positioned relative to the message content bubble */
.azure-openai-chat-message .message-content .azure-openai-chat-copy-btn {
  position: absolute;
  bottom: -18px; /* Moved further down to avoid affecting content layout */
  right: 8px; /* Slightly adjusted positioning */
  transform: scale(0.85);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}
.azure-openai-chat-message.user .message-content {
  background: linear-gradient(
    135deg,
    var(--sw18-blue) 0%,
    var(--sw18-blue) 100%
  );
  color: #fff;
  border-bottom-right-radius: 4px;
}
.azure-openai-chat-message.user .message-content:hover {
  box-shadow: 0 2px 8px rgba(0, 101, 165, 0.2);
}
.azure-openai-chat-message.bot .message-content {
  background-color: #f8f9fa;
  color: var(--sw18-text);
  border: 1px solid #e9ecef;
  border-bottom-left-radius: 4px;
}
.azure-openai-chat-message.bot .message-content:hover {
  background-color: #f1f3f4;
  border-color: #dee2e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------
 *  Copy Button - Unified Styles
 * ------------------------------------------------*/

.azure-openai-chat-message:hover .azure-openai-chat-copy-btn {
  pointer-events: auto;
}

.azure-openai-chat-message:hover .azure-openai-chat-copy-btn {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

/* Different styling for user vs bot messages */
.azure-openai-chat-message.user .message-content .azure-openai-chat-copy-btn {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
  right: 12px; /* Adjusted for user messages to align with rounded corner */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
}

.azure-openai-chat-message.bot .message-content .azure-openai-chat-copy-btn {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  color: #64748b;
  right: 8px; /* Consistent with general positioning */
}

/* Hover states */
.azure-openai-chat-message .message-content .azure-openai-chat-copy-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 4px 8px rgba(0, 0, 0, 0.12);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.azure-openai-chat-message.user
  .message-content
  .azure-openai-chat-copy-btn:hover {
  background: rgba(0, 0, 0, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 4px 8px rgba(0, 0, 0, 0.25);
}

.azure-openai-chat-message.bot
  .message-content
  .azure-openai-chat-copy-btn:hover {
  background: var(--sw18-blue);
  border-color: var(--sw18-blue);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 101, 165, 0.3),
    0 4px 8px rgba(0, 101, 165, 0.2);
}

.azure-openai-chat-message .message-content .azure-openai-chat-copy-btn:active {
  transform: scale(0.95);
  transition: all 0.1s ease;
}

.azure-openai-chat-message .message-content .azure-openai-chat-copy-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  transition: all 0.2s ease;
}

/* Success state */
.azure-openai-chat-message .message-content .azure-openai-chat-copy-btn.copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4),
    0 4px 8px rgba(16, 185, 129, 0.3) !important;
}

.azure-openai-chat-message
  .message-content
  .azure-openai-chat-copy-btn.copied
  svg {
  display: none;
}

.azure-openai-chat-message
  .message-content
  .azure-openai-chat-copy-btn.copied::after {
  content: "✓";
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

/* Reset margins for markdown elements within messages */
.azure-openai-chat-message .message-content p,
.azure-openai-chat-message .message-content h1,
.azure-openai-chat-message .message-content h2,
.azure-openai-chat-message .message-content h3,
.azure-openai-chat-message .message-content h4,
.azure-openai-chat-message .message-content h5,
.azure-openai-chat-message .message-content h6,
.azure-openai-chat-message .message-content ul,
.azure-openai-chat-message .message-content ol,
.azure-openai-chat-message .message-content li {
  margin: 0;
  padding: 0;
}

.azure-openai-chat-message .message-content p:not(:last-child),
.azure-openai-chat-message .message-content h1:not(:last-child),
.azure-openai-chat-message .message-content h2:not(:last-child),
.azure-openai-chat-message .message-content h3:not(:last-child),
.azure-openai-chat-message .message-content h4:not(:last-child),
.azure-openai-chat-message .message-content h5:not(:last-child),
.azure-openai-chat-message .message-content h6:not(:last-child),
.azure-openai-chat-message .message-content ul:not(:last-child),
.azure-openai-chat-message .message-content ol:not(:last-child) {
  margin-bottom: 2px;
}

.azure-openai-chat-message .message-content ul,
.azure-openai-chat-message .message-content ol {
  padding-left: 16px;
}

/* --------------------------------------------------
 *  Eingabezeile – modern & improved
 * ------------------------------------------------*/
.azure-openai-chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 18px 2px;
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  border-top: 1px solid var(--sw18-blue-light);
  position: relative;
}

.azure-openai-chat-input-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--sw18-blue-light),
    transparent
  );
}

#azure-openai-chat-input {
  flex: 1;
  min-height: 22px;
  max-height: 50px;
  line-height: 1.4;
  padding: 12px 16px;
  border: 2px solid #e1e5e9 !important;
  border-radius: 24px;
  box-sizing: border-box;
  resize: none;
  font-family: inherit;
  font-size: 15px !important;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  color: black;
}

#azure-openai-chat-input:focus {
  outline: none;
  border-color: var(--sw18-blue);
  box-shadow: 0 4px 16px rgba(0, 101, 165, 0.12),
    0 0 0 4px rgba(0, 101, 165, 0.08);
  transform: translateY(-1px);
}

#azure-openai-chat-input::placeholder {
  color: #94a3b8;
  transition: opacity 0.3s ease;
}

#azure-openai-chat-input:focus::placeholder {
  opacity: 0.6;
}

/* Send Button */
#azure-openai-chat-send {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ba112e 0%, #a00f26 100%);
  color: #fff;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(186, 17, 46, 0.3);
  position: relative;
  overflow: hidden;
  transform: translateY(-12px);
}

#azure-openai-chat-send::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

#azure-openai-chat-send:hover {
  background: linear-gradient(135deg, #a00f26 0%, #8e0d22 100%);
  box-shadow: 0 8px 20px rgba(186, 17, 46, 0.4);
}

#azure-openai-chat-send:hover::before {
  opacity: 1;
}

#azure-openai-chat-send:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(186, 17, 46, 0.3);
  transform: translateY(-12px);
}

#azure-openai-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 6px rgba(186, 17, 46, 0.2);
}

#azure-openai-chat-send svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
  z-index: 1;
  position: relative;
}

#azure-openai-chat-send:hover svg {
  transform: scale(1.05);
}

/* --------------------------------------------------
 *  Ladeindikator
 * ------------------------------------------------*/
.azure-openai-chat-loading {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 0;
}
.azure-openai-chat-loading span {
  background-color: var(--sw18-blue);
  border-radius: 50%;
  width: 8px;
  height: 8px;
  animation: azure-openai-chat-loading 1.4s infinite ease-in-out both;
}
.azure-openai-chat-loading span:nth-child(1) {
  animation-delay: -0.32s;
}
.azure-openai-chat-loading span:nth-child(2) {
  animation-delay: -0.16s;
}
@keyframes azure-openai-chat-loading {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* --------------------------------------------------
 *  Floating-Button (Toggle)
 * ------------------------------------------------*/
.azure-openai-chat-floating-button {
  position: fixed;
  bottom: 60px;
  right: 9px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--sw18-blue-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.azure-openai-chat-floating-button:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.azure-openai-chat-floating-button:active {
  transform: scale(0.95);
}
.azure-openai-chat-floating-button svg {
  width: 32px;
  height: 32px;
  fill: #fff;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Thinking animation dots - centered in the button */
.azure-openai-chat-floating-button .thinking-dots {
  position: absolute;
  display: flex;
  gap: 4px;
  opacity: 0;
  left: 51%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.azure-openai-chat-floating-button .thinking-dots .dot {
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
  animation: thinkingPulse 1.5s infinite ease-in-out;
}

.azure-openai-chat-floating-button .thinking-dots .dot:nth-child(1) {
  animation-delay: 0s;
}

.azure-openai-chat-floating-button .thinking-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}

.azure-openai-chat-floating-button .thinking-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Hide icon and show thinking dots on hover */
.azure-openai-chat-floating-button:hover svg {
  opacity: 0;
}

.azure-openai-chat-floating-button:hover .thinking-dots {
  opacity: 1;
}

/* Thinking animation keyframes */
@keyframes thinkingPulse {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* --------------------------------------------------
 *  Floating-Chat-Container
 * ------------------------------------------------*/
.azure-openai-chat-container.floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-height: 581px;
  font-size: 14px;
  display: none;
  border-radius: 13px !important;
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* When chat is shown */
.azure-openai-chat-container.floating.chat-visible {
  display: flex !important;
  flex-direction: column;
}
.azure-openai-chat-container.floating .azure-openai-chat-messages {
  height: 380px;
}

/* Header */
.azure-openai-chat-header {
  background-color: var(--sw18-blue);
  color: #fff;
  padding: 12px 18px !important;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: -2px;
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}

.azure-openai-chat-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto !important;
}

.azure-openai-chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto !important;
}

.azure-openai-chat-rocket-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  color: #fff;
  flex-shrink: 0;
  opacity: 0.9;
  margin-left: -10px;
}

/* Header Buttons - MAXIMUM SPECIFICITY für The7 Theme Kompatibilität */
.azure-openai-chat-header .azure-openai-chat-maximize,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-width: 0 !important;
  color: #fff !important;
  cursor: pointer !important;
  padding: 4px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s, transform 0.15s !important;
  opacity: 0.8 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  font-family: inherit !important;
  line-height: 1 !important;
  min-width: auto !important;
  min-height: auto !important;
  width: auto !important;
  height: auto !important;
}

.azure-openai-chat-header .azure-openai-chat-maximize:hover,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize:hover,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  opacity: 1 !important;
  transform: scale(1.1) !important;
  border: none !important;
}

.azure-openai-chat-header .azure-openai-chat-maximize:active,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize:active,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize:active {
  transform: scale(0.95) !important;
}

.azure-openai-chat-maximize svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  stroke: #fff !important;
  fill: none !important;
  color: #fff !important;
}

.azure-openai-chat-header .azure-openai-chat-maximize svg,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize
  svg,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-maximize
  svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: #fff !important;
  stroke-width: 2 !important;
  fill: none !important;
  color: #fff !important;
  background: none !important;
  background-color: transparent !important;
}

.azure-openai-chat-header .azure-openai-chat-reset,
.azure-openai-chat-container .azure-openai-chat-header .azure-openai-chat-reset,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-width: 0 !important;
  color: #fff !important;
  cursor: pointer !important;
  padding: 4px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s, transform 0.15s !important;
  opacity: 0.8 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  font-family: inherit !important;
  line-height: 1 !important;
  min-width: auto !important;
  min-height: auto !important;
  width: auto !important;
  height: auto !important;
}

.azure-openai-chat-header .azure-openai-chat-reset:hover,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset:hover,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  opacity: 1 !important;
  transform: scale(1.1) !important;
  border: none !important;
}

.azure-openai-chat-header .azure-openai-chat-reset:active,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset:active,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset:active {
  transform: scale(0.95) !important;
}

.azure-openai-chat-reset svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  stroke: #fff !important;
  fill: none !important;
  color: #fff !important;
}

.azure-openai-chat-header .azure-openai-chat-reset svg,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset
  svg,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-reset
  svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: #fff !important;
  stroke-width: 2 !important;
  fill: none !important;
  color: #fff !important;
  background: none !important;
  background-color: transparent !important;
}

.azure-openai-chat-header .azure-openai-chat-close,
.azure-openai-chat-container .azure-openai-chat-header .azure-openai-chat-close,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-width: 0 !important;
  color: #fff !important;
  cursor: pointer !important;
  padding: 4px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background-color 0.2s, transform 0.15s !important;
  opacity: 0.8 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
  font-family: inherit !important;
  line-height: 1 !important;
  min-width: auto !important;
  min-height: auto !important;
  width: auto !important;
  height: auto !important;
}

.azure-openai-chat-header .azure-openai-chat-close:hover,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close:hover,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  opacity: 1 !important;
  transform: scale(1.1) !important;
  border: none !important;
}

.azure-openai-chat-header .azure-openai-chat-close:active,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close:active,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close:active {
  transform: scale(0.95) !important;
}

.azure-openai-chat-close svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  stroke: #fff !important;
  fill: none !important;
  color: #fff !important;
  scale: 1.2 !important;
}

.azure-openai-chat-header .azure-openai-chat-close svg,
.azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close
  svg,
html
  body
  .azure-openai-chat-container
  .azure-openai-chat-header
  .azure-openai-chat-close
  svg {
  display: block !important;
  width: 16px !important;
  height: 16px !important;
  stroke: #fff !important;
  stroke-width: 2 !important;
  fill: none !important;
  color: #fff !important;
  scale: 1.2 !important;
  background: none !important;
  background-color: transparent !important;
}

/* Maximize states */
.azure-openai-chat-container.floating.maximized {
  width: 506px;
  max-height: 696px;
  transition: width 0.3s ease, max-height 0.3s ease;
}

.azure-openai-chat-container.floating.maximized .azure-openai-chat-messages {
  height: 494px;
  transition: height 0.3s ease;
}

.azure-openai-chat-container.floating {
  transition: width 0.3s ease, max-height 0.3s ease;
}

.azure-openai-chat-container.floating .azure-openai-chat-messages {
  transition: height 0.3s ease;
}

/* Fehlermeldungen */
.azure-openai-chat-error {
  padding: 16px;
  background-color: #ffedee;
  color: #c41d1d;
  border-left: 4px solid #c41d1d;
  margin: 16px 0;
  font-size: 14px;
}

/* Admin Upload-Area */
.azure-openai-documents-container {
  margin: 24px 0;
}
.upload-section {
  margin-bottom: 32px;
  padding: 24px;
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 6px;
}
#upload_progress {
  margin-top: 12px;
}
#upload_progress progress {
  width: 100%;
  height: 22px;
}
#upload_progress span {
  display: block;
  text-align: center;
  margin-top: 6px;
}
.documents-table {
  margin-top: 24px;
}
.document-action-button {
  margin: 0 6px;
}

/* --------------------------------------------------
 *  Footer (Powered by white duck)
 * ------------------------------------------------*/
.azure-openai-chat-footer {
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  border-top: 1px solid #e9ecef;
  padding: 3px 8px 2px;
  text-align: center;
  font-size: 13px;
  color: #6c757d;
}

.azure-openai-chat-footer .footer-text {
  color: #6c757d;
}

.azure-openai-chat-footer .footer-link {
  color: var(--sw18-blue);
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s ease;
}

.azure-openai-chat-footer .footer-link:hover {
  color: var(--sw18-blue-dark);
  text-decoration: underline;
}

/* --------------------------------------------------
 *  Bulk URL Scraping Styles
 * ------------------------------------------------*/
.azure-openai-links-container .add-link-section {
  margin-bottom: 30px;
}

.azure-openai-links-container .form-table input[type="radio"] {
  margin-right: 8px;
}

.azure-openai-links-container .form-table label {
  margin-bottom: 8px;
}

.azure-openai-links-container #bulk_urls {
  font-family: "Courier New", monospace;
  line-height: 1.4;
  resize: vertical;
  min-height: 120px;
}

#bulk_progress_container {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-top: 10px;
}

#bulk_progress_container p {
  margin: 0 0 8px 0;
  font-weight: 500;
}

#bulk_progress_bar {
  width: 100%;
  height: 24px;
  border-radius: 4px;
}

#current_url_display {
  font-size: 12px;
  color: #666;
  background: #f0f0f0;
  padding: 5px 8px;
  border-radius: 4px;
  margin-top: 8px;
  word-break: break-all;
}

#bulk_results {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

#bulk_results h4 {
  margin: 0 0 10px 0;
  color: #333;
}

#success_list div {
  padding: 4px 0;
  border-bottom: 1px solid #e0e0e0;
}

#success_list div:last-child {
  border-bottom: none;
}

#error_list div {
  padding: 4px 0;
  border-bottom: 1px solid #f0c0c0;
}

#error_list div:last-child {
  border-bottom: none;
}

/* Progress indicators */
#scrape_progress {
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

#scrape_progress progress {
  appearance: none;
  border: none;
  border-radius: 4px;
  background: #e0e0e0;
}

#scrape_progress progress::-webkit-progress-bar {
  background: #e0e0e0;
  border-radius: 4px;
}

#scrape_progress progress::-webkit-progress-value {
  background: var(--sw18-blue);
  border-radius: 4px;
}

#scrape_progress progress::-moz-progress-bar {
  background: var(--sw18-blue);
  border-radius: 4px;
}

/* --------------------------------------------------
 *  Bulk Delete Styles
 * ------------------------------------------------*/
#delete_all_web_documents {
  transition: all 0.2s ease;
}

#delete_all_web_documents:hover {
  background-color: #c82333 !important;
  border-color: #bd2130 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

#delete_all_web_documents:disabled {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#delete_all_progress {
  background: #ffe6e6;
  border: 1px solid #dc3545;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

#delete_all_progress p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #721c24;
}

#delete_bulk_progress_container {
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 15px;
  margin-top: 10px;
}

#delete_bulk_progress_container p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: #721c24;
}

#delete_progress_bar {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  appearance: none;
  border: none;
  background: #f5c6cb;
}

#delete_progress_bar::-webkit-progress-bar {
  background: #f5c6cb;
  border-radius: 4px;
}

#delete_progress_bar::-webkit-progress-value {
  background: #dc3545;
  border-radius: 4px;
}

#delete_progress_bar::-moz-progress-bar {
  background: #dc3545;
  border-radius: 4px;
}

#delete_current_document {
  font-size: 12px;
  color: #721c24;
  background: #f8d7da;
  padding: 5px 8px;
  border-radius: 4px;
  margin-top: 8px;
  word-break: break-all;
}

#delete_bulk_results {
  background: #fff5f5;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

#delete_bulk_results h4 {
  margin: 0 0 10px 0;
  color: #721c24;
}

#delete_success_list div {
  padding: 4px 0;
  border-bottom: 1px solid #d4edda;
  color: #155724;
}

#delete_success_list div:last-child {
  border-bottom: none;
}

#delete_error_list div {
  padding: 4px 0;
  border-bottom: 1px solid #f5c6cb;
  color: #721c24;
}

#delete_error_list div:last-child {
  border-bottom: none;
}

/* Button group spacing */
.links-table-section > div:first-child > div {
  gap: 10px;
  align-items: center;
}

/* --------------------------------------------------
 *  Bulk Refresh Styles
 * ------------------------------------------------*/
#refresh_progress {
  background: #e6f3fc;
  border: 1px solid var(--sw18-blue-light);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

#refresh_progress p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: var(--sw18-blue-dark);
}

#refresh_bulk_progress_container {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  border-radius: 6px;
  padding: 15px;
  margin-top: 10px;
}

#refresh_bulk_progress_container p {
  margin: 0 0 8px 0;
  font-weight: 500;
  color: var(--sw18-blue-dark);
}

#refresh_progress_bar {
  width: 100%;
  height: 24px;
  border-radius: 4px;
  appearance: none;
  border: none;
  background: #b3d9ff;
}

#refresh_progress_bar::-webkit-progress-bar {
  background: #b3d9ff;
  border-radius: 4px;
}

#refresh_progress_bar::-webkit-progress-value {
  background: var(--sw18-blue);
  border-radius: 4px;
}

#refresh_progress_bar::-moz-progress-bar {
  background: var(--sw18-blue);
  border-radius: 4px;
}

#refresh_current_item {
  font-size: 12px;
  color: var(--sw18-blue-dark);
  background: #e6f3fc;
  padding: 5px 8px;
  border-radius: 4px;
  margin-top: 8px;
  word-break: break-all;
}

#refresh_bulk_results {
  background: #f0f8ff;
  border: 1px solid #b3d9ff;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

#refresh_bulk_results h4 {
  margin: 0 0 10px 0;
  color: var(--sw18-blue-dark);
}

#refresh_success_list div {
  padding: 4px 0;
  border-bottom: 1px solid #d4edda;
  color: #155724;
}

#refresh_success_list div:last-child {
  border-bottom: none;
}

#refresh_error_list div {
  padding: 4px 0;
  border-bottom: 1px solid #f5c6cb;
  color: #721c24;
}

#refresh_error_list div:last-child {
  border-bottom: none;
}

/* --------------------------------------------------
 *  Selected Delete Styles
 * ------------------------------------------------*/
#delete_selected_web_documents {
  background-color: #fd7e14;
  border-color: #fd7e14;
  color: white;
  transition: all 0.2s ease;
}

#delete_selected_web_documents:hover:not(:disabled) {
  background-color: #e8690a !important;
  border-color: #dc5f00 !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

#delete_selected_web_documents:disabled {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Checkbox styling */
#select_all_documents {
  transform: scale(1.2);
  margin: 0;
}

/* "Alle markieren" label styling */
th label[for="select_all_documents"] {
  font-weight: normal;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  user-select: none;
}

th label[for="select_all_documents"]:hover {
  color: var(--sw18-blue);
}

th label[for="select_all_documents"]:hover #select_all_documents {
  transform: scale(1.3);
}

.document-checkbox {
  transform: scale(1.1);
  margin: 0;
  cursor: pointer;
}

.document-checkbox:hover {
  transform: scale(1.2);
}

/* Table row hover effect for better UX */
.wp-list-table tbody tr:hover {
  background-color: rgba(0, 101, 165, 0.05);
}

.wp-list-table tbody tr:hover .document-checkbox {
  transform: scale(1.2);
}

/* Indeterminate checkbox styling */
#select_all_documents:indeterminate {
  opacity: 0.7;
}

/* Close button for bulk results */
.close-button {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: #f0f0f0;
  color: #333;
}

.close-button:focus {
  outline: 2px solid var(--sw18-blue);
  outline-offset: 2px;
}

.close-button span {
  font-size: 18px;
  line-height: 1;
}

/* --------------------------------------------------
 *  Beispielfragen / Suggestions (im Chat-Bereich)
 * ------------------------------------------------*/
.azure-openai-chat-suggestions {
  padding: 1px 12px 0px 12px; /* Reduziertes left/right padding für mehr Breite */
  background-color: #fff;
  transition: all 0.3s ease;
  margin-bottom: 0px;
  margin-top: 40px;
}

.azure-openai-chat-suggestions.hidden {
  opacity: 0;
  visibility: hidden;
  height: 0;
  padding: 0 12px;
  overflow: hidden;
  margin-bottom: 0;
}

.suggestion-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.suggestion-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
  border: 1px solid rgba(0, 101, 165, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  font-weight: 500;
  color: var(--sw18-text);
  text-align: left;
  width: 100%; /* Volle Breite */
  min-height: 52px;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.suggestion-button:hover {
  background: linear-gradient(135deg, var(--sw18-blue-light) 0%, #e1f0fb 100%);
  border-color: var(--sw18-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 101, 165, 0.15);
}

.suggestion-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 101, 165, 0.2);
}

.suggestion-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  filter: grayscale(0.1);
  margin-left: -8px; /* Leicht nach links verschoben für bessere Ausrichtung */
}

.suggestion-text {
  line-height: 1.3;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
}

/* Responsive Design */
@media (max-width: 480px) {
  .azure-openai-chat-suggestions {
    padding: 12px 8px 16px 8px;
  }

  .suggestion-button {
    padding: 14px 16px;
    min-height: 48px;
    font-size: 13px;
    gap: 10px;
  }

  .suggestion-icon {
    font-size: 16px;
  }

  .suggestion-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}

/* --------------------------------------------------
 *  Mobile Responsive - ROBUST gegen The7/Elementor/Custom CSS
 *  Vollbild-Chat für alle Geräte unter 490px
 * ------------------------------------------------*/

/* Vollbild-Chat für Bildschirme unter 490px - MAXIMUM SPECIFICITY */
@media (max-width: 489px) {
  /* Chat Container nimmt ganzen Bildschirm ein - The7 Theme Override */
  html body .azure-openai-chat-container.floating.chat-visible,
  html body.elementor-page .azure-openai-chat-container.floating.chat-visible,
  html
    body[class*="elementor"]
    .azure-openai-chat-container.floating.chat-visible,
  html body.the7-ver .azure-openai-chat-container.floating.chat-visible,
  html
    body[class*="theme-"]
    .azure-openai-chat-container.floating.chat-visible {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2147483647 !important; /* Maximum z-index */
    display: flex !important;
    flex-direction: column !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    overflow: hidden !important;
  }

  /* Messages-Bereich füllt verfügbaren Platz */
  html body .azure-openai-chat-container.floating .azure-openai-chat-messages,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-messages {
    flex: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Header bleibt oben fixiert und sichtbar */
  html body .azure-openai-chat-container.floating .azure-openai-chat-header,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-header {
    flex-shrink: 0 !important;
    padding: 16px 18px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    pointer-events: auto !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: var(--sw18-blue) !important;
  }

  /* Header Buttons klickbar und sichtbar - The7 Override */
  html
    body
    .azure-openai-chat-container.floating
    .azure-openai-chat-header-right,
  html body .azure-openai-chat-container.floating .azure-openai-chat-close,
  html body .azure-openai-chat-container.floating .azure-openai-chat-reset,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-header-right,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-close,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-reset {
    pointer-events: auto !important;
    z-index: 101 !important;
    opacity: 0.8 !important;
    visibility: visible !important;
    display: flex !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    color: #fff !important;
  }

  /* Button SVGs weiß halten - The7 Override */
  html body .azure-openai-chat-container.floating .azure-openai-chat-close svg,
  html body .azure-openai-chat-container.floating .azure-openai-chat-reset svg,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-close
    svg,
  html
    body.the7-ver
    .azure-openai-chat-container.floating
    .azure-openai-chat-reset
    svg {
    stroke: #fff !important;
    fill: none !important;
    color: #fff !important;
  }

  /* Maximize-Button verstecken auf Mobile */
  html body .azure-openai-chat-container.floating .azure-openai-chat-maximize {
    display: none !important;
  }

  /* Input-Container bleibt unten */
  html
    body
    .azure-openai-chat-container.floating
    .azure-openai-chat-input-container {
    flex-shrink: 0 !important;
    padding: 14px 18px !important;
    position: relative !important;
    z-index: 10 !important;
  }

  /* Send-Button klickbar */
  html body .azure-openai-chat-container.floating #azure-openai-chat-send {
    pointer-events: auto !important;
    z-index: 10 !important;
  }

  /* Footer bleibt unten */
  html body .azure-openai-chat-container.floating .azure-openai-chat-footer {
    flex-shrink: 0 !important;
  }

  /* Suggestions anpassen */
  html
    body
    .azure-openai-chat-container.floating
    .azure-openai-chat-suggestions {
    padding: 12px 12px 16px 12px !important;
  }

  html body .azure-openai-chat-container.floating .suggestion-button {
    padding: 14px 16px !important;
    min-height: 48px !important;
    font-size: 14px !important;
    pointer-events: auto !important;
  }

  /* Floating Button größer und besser positioniert */
  html body .azure-openai-chat-floating-button {
    bottom: 80px !important;
    right: 16px !important;
    width: 64px !important;
    height: 64px !important;
    z-index: 2147483646 !important;
    pointer-events: auto !important;
  }
}

/* Kleine Handys (< 400px) - ROBUST */
@media (max-width: 399px) {
  html body .azure-openai-chat-container.floating .azure-openai-chat-header {
    padding: 14px 16px !important;
    font-size: 13px !important;
  }

  html
    body
    .azure-openai-chat-container.floating
    .azure-openai-chat-input-container {
    padding: 12px 16px !important;
  }

  html body .azure-openai-chat-container.floating #azure-openai-chat-input {
    font-size: 14px !important;
    padding: 10px 14px !important;
  }

  html body .azure-openai-chat-container.floating #azure-openai-chat-send {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px !important;
    pointer-events: auto !important;
  }

  html body .azure-openai-chat-container.floating #azure-openai-chat-send svg {
    width: 18px !important;
    height: 18px !important;
  }

  html body .azure-openai-chat-container.floating .suggestion-button {
    padding: 12px 14px !important;
    min-height: 44px !important;
    font-size: 13px !important;
    pointer-events: auto !important;
  }
}

/* Floating Chat angepasst */
.azure-openai-chat-container.floating.maximized .azure-openai-chat-suggestions {
  padding: 20px 16px 24px 16px;
}

.azure-openai-chat-container.floating.maximized .suggestion-grid {
  gap: 10px;
}

.azure-openai-chat-container.floating.maximized .suggestion-button {
  padding: 18px 20px;
  min-height: 56px;
  font-size: 15px;
}
