/* Panel zuverlässig ausblenden */
[hidden] { display: none !important; }

/* ASCOMP Farben */
:root{
  --brand:#0b5cff;
  --brand-dark:#0a52e0;
  --accent:#10b981;          /* Elegantes Grün */
  --bg:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --bubble:#f9fafb;
  --bubble-user:#eff6ff;
  --shadow:0 8px 24px rgba(11,92,255,.12), 0 2px 6px rgba(0,0,0,.04);
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#18181b;
    --text:#f4f4f5;
    --muted:#a1a1aa;
    --bubble:#27272a;
    --bubble-user:#1e3a8a;
    --shadow:0 12px 40px rgba(0,0,0,.4);
  }
}

/* Floating Chat-Button mit Text */
#ascomp-chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: auto;
  min-width: 60px;
  height: 60px;
  padding: 0 20px 0 16px;
  border-radius: 30px;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  box-shadow: 0 4px 16px rgba(11, 92, 255, .28);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;  /* Icon-Größe */
  font-weight: 500;
  z-index: 9999;
  transition: transform .2s ease, box-shadow .2s ease, padding .2s ease;
}

#ascomp-chat-button span {
  font-size: 16px;  /* Text-Größe */
}

#ascomp-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 92, 255, .35);
}

#ascomp-chat-button:active {
  transform: translateY(0) scale(.97);
}

#ascomp-chat-button:focus {
  outline: 2px solid rgba(11, 92, 255, .4);
  outline-offset: 2px;
}

/* Online-Status mit Puls */
#ascomp-chat-button::after{
  content:""; position:absolute; bottom:4px; left:4px;
  width:12px; height:12px; border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px var(--brand), 0 0 8px rgba(16,185,129,.6);
  animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes pulse{
  0%, 100%{ opacity:1; }
  50%{ opacity:.7; }
}

/* Panel – saubere Kanten */
#ascomp-chat-panel{
  position:fixed; right:24px; bottom:96px;
  width:420px; max-height:700px; display:flex; flex-direction:column;
  background:var(--bg); border:none; border-radius:16px;
  box-shadow:var(--shadow); overflow:hidden; z-index:9999;
  font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transform:translateY(12px) scale(.96) translateZ(0);
  opacity:0;
  transition:transform 180ms cubic-bezier(.4,0,.2,1), opacity 180ms ease;
  -webkit-backface-visibility:hidden;
  -webkit-transform:translateZ(0);
  will-change:transform, opacity;
  isolation:isolate;
}
#ascomp-chat-panel.show{
  transform:translateY(0) scale(1) translateZ(0);
  opacity:1;
}

/* Header mit elegantem Farbverlauf */
.chat-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 18px; color:#fff;
  background:linear-gradient(135deg, #0b5cff 0%, #ec4899 100%);
}
.chat-header-left{ 
  display:flex; 
  align-items:center; 
  gap:12px; 
  flex: 1; /* ✅ Nimmt verfügbaren Platz */
}

/* ✅ NEU: Header-Buttons Container (rechts) */
.chat-header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
  padding: 4px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.title-wrap{ display:flex; flex-direction:column; gap:2px; line-height:1.2; }
.chat-title{ font-weight:600; font-size:15px; }
.chat-status{
  font-size:12px; opacity:.92; display:flex; align-items:center; gap:6px; font-weight:400;
}
.dot{
  width:7px; height:7px; border-radius:50%; background:var(--accent);
  box-shadow:0 0 6px rgba(16,185,129,.6);
}

/* ✅ Clear-Button (Support-Mode) */
.chat-clear {
  background: rgba(255,255,255,.12);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all .2s ease;
  padding: 0;
  line-height: 1;
  margin: 0; /* ✅ WICHTIG: Kein Margin! */
}

.chat-clear:hover {
  background: rgba(255,255,255,.2);
  transform: rotate(90deg);
}

.chat-close{
  background:rgba(255,255,255,.12); border:none; color:#fff;
  width:28px; height:28px; border-radius:8px; cursor:pointer;
  display:flex;
  align-items: center;
  justify-content: center;
  font-size:18px;
  transition:background .2s ease;
  padding: 0;
  line-height: 1;
  margin: 0; /* ✅ WICHTIG: Kein Margin! */
}
.chat-close:hover{ background:rgba(255,255,255,.2); }

/* Messages */
.chat-messages{
  flex:1; padding:16px; overflow-y:auto; display:flex; flex-direction:column; gap:12px;
  background:var(--bg);
}

/* Bubbles – kein Border */
.msg{
  padding:11px 14px; border-radius:16px; max-width:90%;
  line-height:1.5; color:var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  font-size: 14px;
}
.msg.bot{ 
  align-self:flex-start; 
  background:var(--bubble); 
  border-radius:12px 12px 12px 4px;
}
.msg.user{
  align-self:flex-end; background:var(--bubble-user); color:#1e40af;
}
.msg.system{
  align-self:center; background:transparent; box-shadow:none;
  color:var(--muted); font-size:13px; padding:6px;
}

/* Listen in Bot-Nachrichten einrücken */
.msg.bot ul,
.msg.bot ol {
  margin: 0px 0;
  padding-left: 24px;
}

.msg.bot li {
  margin: 0px 0;
  line-height: 1.6;
}

.msg.bot ul li {
  list-style-type: disc;
}

.msg.bot ol li {
  list-style-type: decimal;
}

/* Verschachtelte Listen */
.msg.bot ul ul,
.msg.bot ol ul,
.msg.bot ul ol,
.msg.bot ol ol {
  margin: 0px 0;
  padding-left: 20px;
}

/* Absätze in Bot-Nachrichten */
.msg.bot p {
  margin: 12px 0;
}

.msg.bot p:first-child {
  margin-top: 0;
}

.msg.bot p:last-child {
  margin-bottom: 0;
}

/* Code in Bot-Nachrichten */
.msg.bot code {
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 0.9em;
}

.msg.bot pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.msg.bot pre code {
  background: transparent;
  padding: 0;
}

/* Input */
.chat-form{
  display:flex; gap:10px; padding:14px 16px;
  border-top:1px solid rgba(0,0,0,.06); background:rgba(249,250,251,.5);
  position: relative;
}
.chat-form input{
  flex:1; padding:12px 16px; border-radius:24px;
  border:1px solid rgba(0,0,0,.08); background:#fff; color:var(--text);
  font-size:14px; transition:all .2s ease;
}
.chat-form input:focus{
  outline:none; border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(11,92,255,.1);
}
.chat-form input::placeholder{ color:var(--muted); opacity:.65; }

/* ✅ Textarea im Support-Mode */
.chat-form textarea {
  flex: 1;
  padding: 12px 50px 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  max-height: 150px;
  transition: all .2s ease;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11,92,255,.1);
}

.chat-form textarea::placeholder {
  color: var(--muted);
  opacity: .65;
}

.chat-send{
  background:linear-gradient(135deg, var(--brand), var(--brand-dark));
  color:#fff; border:none; border-radius:50%; width:44px; height:44px;
  cursor:pointer; font-size:17px; display:grid; place-items:center;
  box-shadow:0 2px 8px rgba(11,92,255,.2);
  transition:transform .15s ease, box-shadow .2s ease;
  flex-shrink: 0;
}

.chat-send:hover{
  transform:scale(1.04);
  box-shadow:0 4px 12px rgba(11,92,255,.3);
}
.chat-send:active{ transform:scale(.96); }

/* Footer */
.chat-footer{
  padding:10px 16px; color:var(--muted); font-size:11px;
  text-align:center; background:rgba(249,250,251,.7);
  border-top:1px solid rgba(0,0,0,.04);
}

/* Links im Chat */
.msg a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.msg a:hover {
  color: #0052a3;
  text-decoration: none;
}

.msg.bot a {
  color: #0077ed;
}

.msg.bot a:hover {
  color: #005bb5;
}

/* mailto-Links */
.msg a[href^="mailto:"] {
  color: #d63384;
}

.msg a[href^="mailto:"]:hover {
  color: #b02a69;
}

/* Externe Link-Indicator (optional) */
.msg a[href^="http"]:after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.6;
}

/* Interne ASCOMP-Links ohne Indicator */
.msg a[href*="ascomp.de"]:after,
.msg a[href*="ascompsoftware.com"]:after {
  content: "";
}

/* Dark Mode Anpassungen */
@media (prefers-color-scheme: dark) {
  .msg.bot code {
    background: rgba(255, 255, 255, 0.08);
  }
  
  .msg.bot pre {
    background: rgba(255, 255, 255, 0.08);
  }
  
  /* Input-Feld im Dark Mode */
  .chat-form input,
  .chat-form textarea {
    background: var(--bubble);
    color: var(--text);
    border-color: rgba(255,255,255,.12);
  }
  
  /* Footer im Dark Mode */
  .chat-footer {
    color: var(--muted);
    background: rgba(39,39,42,.7);
  }
  
  .chat-footer a {
    color: var(--muted);
  }
  
  .msg.user {
    background: #60a5fa;
    color: #ffffff;
  }
}

/* Tablets (optional) */
@media (min-width: 769px) and (max-width: 1024px) {
  #ascomp-chat-panel:not([data-support-mode="true"]) {
    width: 90vw;
    max-width: 500px;
  }
}

/* ===== FEEDBACK BUTTONS (Training Mode) ===== */
.feedback-buttons {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(0,0,0,.06);
}

.feedback-buttons p {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.feedback-btn {
  padding: 10px 20px;
  margin-right: 10px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform .15s ease, box-shadow .2s ease;
  color: #fff;
}

.feedback-btn:hover {
  transform: scale(1.04);
}

.feedback-btn:active {
  transform: scale(.96);
}

.feedback-yes {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, .2);
}

.feedback-yes:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, .3);
}

.feedback-no {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239, 68, 68, .2);
}

.feedback-no:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, .3);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .feedback-buttons {
    border-top-color: rgba(255,255,255,.12);
  }
  
  .feedback-buttons p {
    color: var(--text);
  }
}

/* ===== HELPDESK-MODE ===== */
#ascomp-chat-panel.helpdesk-mode {
  position: fixed !important;
  top: calc(70px + 25px) !important; /* Header-Höhe + 25px Abstand */
  right: 25px !important;
  bottom: 25px !important;
  left: auto !important;
  width: calc(66.667% - 50px) !important; /* 2/3 der Breite minus Abstände */
  height: auto !important;
  max-width: none !important;
  max-height: calc(100vh - 70px - 50px) !important; /* Viewport minus Header minus Abstände */
  transform: none !important;
}

#ascomp-chat-panel.helpdesk-mode.show {
  transform: none !important;
}

#ascomp-chat-panel.helpdesk-mode:not(.show) {
  transform: translateY(12px) scale(0.96) !important;
}

/* ===== CONSENT-MODAL ===== */
.consent-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.consent-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.consent-modal-content {
  position: relative;
  max-width: 480px;
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.consent-modal-content .consent-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: bounce 2s infinite;
}

.consent-modal-content h3 {
  margin: 0 0 12px 0;
  font-size: 24px;
  font-weight: 700;
}

.consent-modal-content p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  font-size: 15px;
}

.consent-modal-content .consent-details {
  font-size: 14px;
  opacity: 0.95;
}

.consent-modal-content .consent-legal {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.consent-modal-content .consent-legal a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
}

.consent-modal-content .consent-info-box {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 16px;
  margin: 20px 0;
  text-align: left;
  font-size: 13px;
}

.consent-modal-content .consent-info-box strong {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.consent-modal-content .consent-info-box ul {
  margin: 0;
  padding-left: 20px;
}

.consent-modal-content .consent-info-box li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.consent-modal-content .consent-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.consent-modal-content .btn-accept {
  background: white;
  color: #667eea;
  border: none;
  padding: 16px 24px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.consent-modal-content .btn-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.consent-modal-content .btn-decline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.consent-modal-content .btn-decline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
}

@media (max-width: 480px) {
  .consent-modal-content {
    padding: 24px 20px;
  }
  
  .consent-modal-content h3 {
    font-size: 20px;
  }
  
  .consent-modal-content p {
    font-size: 14px;
  }
}

/* Consent Banner Links */
#ascomp-consent-banner a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

#ascomp-consent-banner a:hover {
  opacity: 0.8;
}

/* Consent Banner Hover-Effekte */
#ascomp-consent-banner #consent-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

#ascomp-consent-banner #consent-decline:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.7);
}

/* Mobile Anpassung */
@media (max-width: 480px) {
  #ascomp-consent-banner {
    width: calc(100vw - 32px) !important;
    right: 16px !important;
    bottom: 16px !important;
    padding: 20px !important;
  }
  
  #ascomp-consent-banner strong:first-child {
    font-size: 17px !important;
  }
  
  #ascomp-consent-banner p {
    font-size: 13px !important;
  }
}

/* ===== CONSENT WIDERRUFEN LINK ===== */
.revoke-link {
  color: var(--muted);
  text-decoration: underline;
  font-size: 10px;
  margin-left: 5px;
  transition: color 0.2s ease;
}

.revoke-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .revoke-link {
    color: var(--muted);
  }
  
  .revoke-link:hover {
    color: #60a5fa;
  }
}

/* ========================================
   ✅ PRODUKT-AUSWAHL (Support-Mode)
   ======================================== */

#ascomp-product-selector {
  padding: 20px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

#product-buttons-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.product-select-btn {
  margin: 0;
  padding: 10px 16px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
}

.product-select-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-select-btn.selected {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

/* "Allgemeine Frage"-Button */
.product-select-btn[data-product-slug=""] {
  border-color: #9e9e9e;
  color: #666;
}

.product-select-btn[data-product-slug=""]:hover {
  border-color: #757575;
}

.product-select-btn[data-product-slug=""].selected {
  background: #9e9e9e;
  border-color: #9e9e9e;
  color: white;
}

/* "Weiter"-Button */
#product-continue-btn {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#product-continue-btn:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#product-continue-btn:active {
  transform: translateY(0);
}

/* Dark Mode für Produktauswahl */
@media (prefers-color-scheme: dark) {
  #ascomp-product-selector {
    background: #27272a;
    border-bottom-color: rgba(255,255,255,.12);
  }
  
  .product-select-btn {
    background: #3f3f46;
    border-color: #52525b;
    color: #f4f4f5;
  }
  
  .product-select-btn:hover {
    background: #52525b;
  }
  
  .product-select-btn[data-product-slug=""] {
    border-color: #71717a;
    color: #a1a1aa;
  }
}

/* ========================================
   ✅ SUPPORT-MODE ACTION BUTTONS
   ======================================== */

.support-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.support-action-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.support-action-btn:hover {
  background: #f5f5f5;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
}

.support-action-btn:active {
  transform: translateY(0);
}

.support-action-btn.copied {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .support-actions {
    border-top-color: rgba(255, 255, 255, 0.12);
  }
  
  .support-action-btn {
    background: #3f3f46;
    border-color: #52525b;
    color: #f4f4f5;
  }
  
  .support-action-btn:hover {
    background: #52525b;
    border-color: #667eea;
    color: #a5b4fc;
  }
}

/* ========================================
   ✅ KOSTENANZEIGE (Support-Mode)
   ======================================== */

.support-cost-info {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  font-size: 11px;
  color: #666;
  text-align: right;
  font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.support-cost-info strong {
  color: #333;
  font-weight: 600;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .support-cost-info {
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
  }
  
  .support-cost-info strong {
    color: #f4f4f5;
  }
}

/* ========================================
   ✅ SUPPORT-MODE (Eigener Mode)
   ======================================== */

#ascomp-chat-panel.support-mode {
  position: fixed !important;
  top: 125px !important;
  left: 50% !important;  /* ✅ Horizontal zentrieren */
  right: auto !important;
  bottom: 25px !important;
  width: calc(80vw) !important;
  height: calc(80vh) !important;
  transform: translateX(-50%) !important;  /* ✅ Exakt zentrieren */
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  z-index: 9999 !important;
  max-width: none !important;
  max-height: none !important;
}

#ascomp-chat-panel.support-mode.show {
  transform: translateX(-50%) translateY(0) scale(1) !important;  /* ✅ Zentriert bleiben */
  opacity: 1 !important;
}

#ascomp-chat-panel.support-mode:not(.show) {
  transform: translateX(-50%) translateY(12px) scale(0.96) !important;  /* ✅ Zentriert bleiben */
  opacity: 0 !important;
}

/* Produktauswahl kompakter im Support-Mode */
#ascomp-chat-panel.support-mode #ascomp-product-selector {
  padding: 12px 20px;
  background: #f5f5f5;
}

#ascomp-chat-panel.support-mode #product-continue-btn {
  margin-top: 12px;
  padding: 10px;
}

/* Send-Button bei Textarea (Support-Mode) */
#ascomp-chat-panel.support-mode .chat-send {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  #ascomp-chat-panel.support-mode #ascomp-product-selector {
    background: #27272a;
  }
}

/* Mobile: Support-Mode auch Vollbild */
@media (max-width: 768px) {
  #ascomp-chat-panel.support-mode {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;  /* ✅ Kein Transform auf Mobile */
    border-radius: 0 !important;
  }
  
  #ascomp-chat-panel.support-mode.show {
    transform: none !important;  /* ✅ Kein Transform auf Mobile */
  }
  
  #ascomp-chat-panel.support-mode:not(.show) {
    transform: translateY(12px) scale(0.96) !important;  /* ✅ Nur Slide-Animation */
  }
}

/* ✅ Training-Modal Styles */
.training-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.training-modal {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.training-modal h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 24px;
}

.training-modal .form-group {
    margin-bottom: 20px;
}

.training-modal .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.training-modal .form-group input[type="text"],
.training-modal .form-group input[type="number"],
.training-modal .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.3s;
}

.training-modal .form-group input:focus,
.training-modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.training-modal .form-group textarea {
    resize: vertical;
}

.training-modal .form-group small {
    display: block;
    color: #666;
    margin-top: 5px;
    font-size: 12px;
}

.training-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.training-modal .checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.training-modal .checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.training-modal .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.training-modal .modal-actions button {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.training-modal .btn-cancel {
    background: #e0e0e0;
    color: #666;
}

.training-modal .btn-cancel:hover {
    background: #d0d0d0;
}

.training-modal .btn-submit {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.training-modal .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
    .training-modal {
        width: 95%;
        padding: 20px;
    }
    
    .training-modal .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ✅ MOBILE RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  /* ✅ Chat-Panel VOLLBILD auf Mobile */
  #ascomp-chat-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
    
  /* Header kompakter */
  .chat-header {
    padding: 14px 16px;
  }
  
  .chat-title {
    font-size: 14px;
  }
  
  .chat-status {
    font-size: 11px;
  }
  
  .avatar {
    width: 32px;
    height: 32px;
  }
  
  /* Messages kompakter */
  .chat-messages {
    padding: 12px;
    gap: 10px;
  }
  
  .msg {
    max-width: 85%;
    font-size: 13px;
    padding: 10px 12px;
  }
  
  /* Input-Form kompakter */
  .chat-form {
    padding: 12px;
    gap: 8px;
  }
  
  .chat-form input,
  .chat-form textarea {
    font-size: 16px; /* ✅ Verhindert Auto-Zoom auf iOS! */
    padding: 10px 14px;
  }
  
  .chat-send {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  /* Produktauswahl kompakter */
  #ascomp-product-selector {
    padding: 12px;
  }
  
  #product-buttons-container {
    gap: 6px;
  }
  
  .product-select-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  #product-continue-btn {
    padding: 10px;
    font-size: 14px;
  }
  
  /* Support-Actions kompakter */
  .support-actions {
    gap: 6px;
  }
  
  .support-action-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Feedback-Buttons kompakter */
  .feedback-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
  
  /* Footer kompakter */
  .chat-footer {
    padding: 8px 12px;
    font-size: 10px;
  }
  
  /* Training-Modal Vollbild */
  .training-modal {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    padding: 20px;
  }
  
  .training-modal h2 {
    font-size: 20px;
  }
  
  .training-modal .form-group input,
  .training-modal .form-group textarea {
    font-size: 16px; /* ✅ Verhindert Auto-Zoom! */
  }
}

/* ✅ Sehr kleine Smartphones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .msg {
    max-width: 80%;
    font-size: 12px;
  }
  
  .chat-header {
    padding: 12px;
  }
  
  .chat-title {
    font-size: 13px;
  }
  
  .avatar {
    width: 28px;
    height: 28px;
  }
}

/* ✅ Landscape-Mode auf Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  #ascomp-chat-panel {
    height: 100vh !important;
  }
  
  .chat-messages {
    max-height: calc(100vh - 180px);
  }
}

/* ========================================
   ✅ SPRACH-BUTTONS (Support-Mode)
   ======================================== */

.product-section-title {
  font-weight: 700;
  font-size: 14px;
  color: #333;
  margin: 16px 0 8px 0;
}

.product-section-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 16px 0;
}

.language-buttons-row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.language-select-btn {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
}

.language-select-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.language-select-btn.selected {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  .product-section-title {
    color: #f4f4f5;
  }
  
  .product-section-divider {
    background: rgba(255,255,255,.12);
  }
  
  .language-select-btn {
    background: #3f3f46;
    border-color: #52525b;
    color: #f4f4f5;
  }
  
  .language-select-btn:hover {
    background: #52525b;
  }
}