/* ============================================
   ARO-Secure Chat Widget - Styles
   Fuer aro-security.de
   ============================================ */

/* Container - wird vom JS dynamisch erstellt */
.aro-widget-container {
  --aro-primary: #071019;
  --aro-accent: #c99846;
  --aro-bg: #0d1822;
  --aro-surface: #12202b;
  --aro-border: rgba(206, 218, 232, 0.16);
  --aro-text: #f7f5f0;
  --aro-text-sec: rgba(240, 237, 230, 0.72);
  --aro-radius: 14px;
  --aro-shadow: 0 28px 60px rgba(0,0,0,0.32);

  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-body, 'Segoe UI', Arial, sans-serif);
}

/* Toggle Button */
.aro-widget-toggle {
  min-width: 168px;
  height: 64px;
  padding: 8px 16px 8px 10px;
  border-radius: 50%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--aro-accent), #e1b15f);
  color: #071019;
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--aro-shadow);
  transition: transform 0.2s ease, filter 0.2s ease;
}
.aro-widget-toggle:hover {
  transform: scale(1.05);
  filter: brightness(1.08);
}
.aro-widget-toggle-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #071019;
  color: var(--aro-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aro-widget-toggle-icon svg {
  width: 24px;
  height: 24px;
}
.aro-widget-toggle-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
}
.aro-widget-toggle-copy strong { font-size: 14px; }
.aro-widget-toggle-copy small { font-size: 11px; opacity: 0.78; margin-top: 3px; }

/* Chat Window */
.aro-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: var(--aro-bg);
  border-radius: var(--aro-radius);
  box-shadow: var(--aro-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: grab;
}
.aro-chat-window--left { left: 28px; right: auto; }
.aro-chat-window.dragging { transition: none; }
.aro-chat-window.dragging { cursor: grabbing; }
.aro-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.aro-chat-header {
  background: var(--aro-primary);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  user-select: none;
}
.aro-chat-header-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aro-chat-header-icon svg {
  width: 20px;
  height: 20px;
}
.aro-chat-header-text {
  flex: 1;
  min-width: 0;
}
.aro-chat-header-text h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.aro-chat-header-text p {
  font-size: 12px;
  opacity: 0.8;
  margin: 2px 0 0 0;
  line-height: 1.3;
}
.aro-chat-ai-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(190,227,248,.65);
  border-radius: 999px;
  background: rgba(190,227,248,.18);
  color: #d9f1ff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}
.aro-chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.aro-chat-close:hover {
  opacity: 1;
}

/* Messages Area */
.aro-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.aro-messages::-webkit-scrollbar {
  width: 6px;
}
.aro-messages::-webkit-scrollbar-thumb {
  background: var(--aro-border);
  border-radius: 3px;
}

/* Message Bubbles */
.aro-msg {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: var(--aro-radius);
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}
.aro-msg.user {
  align-self: flex-end;
  background: rgba(201, 152, 70, 0.16);
  color: var(--aro-text);
  border: 1px solid rgba(201, 152, 70, 0.46);
  border-bottom-right-radius: 4px;
}
.aro-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.045);
  color: var(--aro-text);
  border: 1px solid rgba(206, 218, 232, 0.09);
  border-bottom-left-radius: 4px;
}
.aro-msg.bot strong {
  color: var(--aro-accent);
  font-weight: 600;
}
.aro-msg.bot code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 13px;
}
.aro-msg.bot pre {
  background: #1a1a1a;
  color: #f0f0f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.aro-msg.bot pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.aro-msg.bot a {
  color: var(--aro-accent);
  text-decoration: none;
}
.aro-msg.bot a:hover {
  text-decoration: underline;
}
.aro-msg.bot ul,
.aro-msg.bot ol {
  margin: 8px 0 8px 20px;
  padding: 0;
}
.aro-msg.bot li {
  margin: 4px 0;
}
.aro-msg.bot p {
  margin: 0 0 8px 0;
}
.aro-msg.bot p:last-child {
  margin-bottom: 0;
}
.aro-bullet-line {
  display: flex;
  gap: 8px;
  margin: 2px 0;
  line-height: 1.45;
}
.aro-bullet-line span {
  flex: 0 0 auto;
  color: var(--aro-accent);
  font-weight: 600;
}

/* Sources */
.aro-sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--aro-border);
}
.aro-sources-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--aro-text-sec);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.aro-source-item {
  font-size: 12px;
  color: var(--aro-text-sec);
  margin: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.aro-source-item a {
  color: var(--aro-accent);
  text-decoration: none;
  word-break: break-all;
}
.aro-source-item a:hover {
  text-decoration: underline;
}
.aro-source-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(196, 30, 58, 0.1);
  color: var(--aro-accent);
  font-weight: 500;
  flex-shrink: 0;
}
.aro-source-badge.web {
  background: rgba(26, 26, 26, 0.08);
  color: var(--aro-text-sec);
}

/* Typing Indicator */
.aro-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  align-self: flex-start;
}
.aro-typing span {
  width: 8px;
  height: 8px;
  background: var(--aro-text-sec);
  border-radius: 50%;
  animation: aroTyping 1.4s infinite ease-in-out both;
}
.aro-typing span:nth-child(1) { animation-delay: -0.32s; }
.aro-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes aroTyping {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.aro-input-area {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--aro-border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.aro-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--aro-border);
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background: rgba(255,255,255,0.055);
  color: var(--aro-text);
}
.aro-input:focus {
  border-color: var(--aro-accent);
  box-shadow: 0 0 0 3px rgba(201, 152, 70, 0.22);
}
.aro-input::placeholder {
  color: rgba(240, 237, 230, 0.58);
  opacity: 1;
}
.aro-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--aro-accent);
  color: #071019;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.aro-send-btn:hover {
  background: #e1b15f;
}
.aro-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Disclaimer */
.aro-disclaimer {
  font-size: 10px;
  color: var(--aro-text-sec);
  text-align: center;
  padding: 8px 16px;
  border-top: 1px solid var(--aro-border);
  line-height: 1.4;
  flex-shrink: 0;
}
.aro-disclaimer a {
  color: var(--aro-text-sec);
  text-decoration: underline;
}

/* Error Message */
.aro-error {
  background: #fff0f0;
  border: 1px solid #ffcdd2;
  color: #c41e3a;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin: 8px 16px;
}

/* Responsive */
@media (max-width: 480px) {
  .aro-widget-container {
    bottom: 16px;
    right: 16px;
  }
  .aro-widget-toggle { min-width: 154px; height: 58px; padding-right: 12px; }
  .aro-widget-toggle-icon { width: 36px; height: 36px; }
  .aro-chat-window {
    width: calc(100vw - 32px);
    right: 16px;
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
  }
  .aro-chat-window--left { left: 16px; right: auto; }
}
