/* 
 * Minimalist Slate Theme - Chatbot Styles
 * Clean, understated design with refined interactions
 */

:root {
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition-ease: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base container (Desktop/Laptop, > 1000px Breite) */
/* Feste Komfortgröße statt reiner vw/vh-Skalierung: auf großen Monitoren soll das
   Chatfenster nicht proportional mitwachsen, sondern eine angenehme Lesebreite behalten. */
#gpt-chatbot-container {
  position: fixed;
  bottom: 25px;
  right: 130px;
  z-index: 9999;
  width: min(700px, 90vw);
  height: min(680px, 82vh);
  min-width: 320px;
  min-height: 400px;
  max-width: 95vw;
  max-height: 90vh;
  resize: both;
  overflow: hidden;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: none;
  transition: var(--transition-ease);
  box-shadow: 2px 12px 76px #323c4a;
}

/* Header - Understated design */
#gpt-chatbot-header {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--slate-200);
  padding: 14px 18px;
  box-sizing: border-box;
  font-family: 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--slate-50);
  height: 56px;
  position: absolute;
  top: 0;
  border-radius: 12px 12px 0 0;
}

#gpt-chatbot-title {
  width: 70%;
  margin: 0;              
  padding: 0;
  text-align: left;
  color: var(--slate-800);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

/* Redesigned close button - subtle circle */
#gpt-chatbot-close {
  width: 28px;
  height: 28px;
  text-align: center;
  font-size: 1.5em;
  position: absolute;
  top: 14px;
  right: 18px;
  background: var(--slate-100);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  padding: 0;
  color: var(--slate-600);
  opacity: 0.8;
  transition: var(--transition-ease);
  display: flex;
  align-items: center;
  justify-content: center;
}

#gpt-chatbot-close:hover {
  opacity: 1;
  background: var(--slate-200);
  color: var(--slate-800);
}



#gpt-chatbot-language {
  position: absolute;
  right: 56px;
  top: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--slate-100);
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
  padding: 0;
  color: var(--slate-600);
  transition: var(--transition-ease);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gpt-chatbot-language:hover {
  background: var(--slate-200);
  color: var(--slate-800);
}

/* App container */
#gpt-chatbot-app {
  width: 100%;
  padding: 0;
  font-family: 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.9375rem;
  position: absolute;
  top: 56px;
  bottom: 76px;
}

/* Messages area - clean with subtle scrollbar */
#gpt-chatbot-messages {
  height: calc(90% - 20px);
  overflow-y: auto;
  border: none;
  padding: 16px 18px;
  margin: 0;
  background: var(--slate-50);
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
}

#gpt-chatbot-messages::-webkit-scrollbar {
  width: 5px;
}

#gpt-chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#gpt-chatbot-messages::-webkit-scrollbar-thumb {
  background-color: var(--slate-300);
  border-radius: 20px;
}

/* Message bubbles - refined, subtle design */
.gpt-chatbot-msg, .gpt-chatbot-msg p {
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9375rem;
  font-weight: 400;
  word-wrap: break-word; 
  line-height: 1.5;
  max-width: 85%;
}

.gpt-chatbot-user, .gpt-chatbot-user p {
  background: var(--slate-100);
  color: var(--slate-800);
  margin-left: auto;
  text-align: left;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}

.gpt-chatbot-bot, .gpt-chatbot-bot p {
  background: var(--slate-50);
  color: var(--slate-700);
  margin-right: auto;
  text-align: left;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

/* Remove user/bot icons for cleaner look */
.gpt-chatbot-user::after,
.gpt-chatbot-bot::before {
  display: none;
}

/* Add subtle timestamp to messages */
.gpt-chatbot-user:after {
  content: attr(data-time);
  display: block;
  font-size: 0.7rem;
  text-align: right;
  color: var(--slate-400);
  margin-top: 4px;
  margin-right: 4px;
}

.gpt-chatbot-bot:after {
  content: attr(data-time);
  display: block;
  font-size: 0.7rem;
  text-align: left;
  color: var(--slate-400);
  margin-top: 4px;
  margin-left: 4px;
}

/* Chat suggestions - pill design */
#gpt-chatbot-suggestions {
  background: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px 0;
  padding: 0 18px;
}

#gpt-chatbot-suggestions button.gpt-chatbot-bubble {
  background: transparent;
  border: 1px solid var(--slate-300);
  color: var(--slate-600);
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: var(--transition-ease);
  font-weight: 400;
}

#gpt-chatbot-suggestions button.gpt-chatbot-bubble:hover {
  background: var(--slate-100);
  color: var(--slate-800);
  border-color: var(--slate-400);
}

/* Input area - refined, modern */
#gpt-chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 18px;
  background: var(--slate-50);
  border-top: 1px solid var(--slate-200);
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
}

#gpt-chatbot-input {
  height: 46px;
  border: 1px solid var(--slate-300);
  border-radius: 23px;
  background: var(--slate-100);
  color: var(--slate-800);
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  cursor: text;
  transition: var(--transition-ease);
  padding: 0 18px;
  flex: 1;
}

#gpt-chatbot-input:focus {
  outline: none;
  border-color: var(--slate-400);
  background: var(--slate-50);
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.35);
}

#gpt-chatbot-input::placeholder {
  color: var(--slate-400);
}

/* Redesigned action buttons */
#gpt-chatbot-send, 
#gpt-chatbot-download {
  background-color: var(--slate-200);
  color: var(--slate-700);
  height: 46px;
  width: 46px;
  border: none;
  border-radius: 23px;
  cursor: pointer;
  transition: var(--transition-ease);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
	font-size: 1.5em;
}

#gpt-chatbot-send:hover {
  background-color: var(--accent-teal);
  color: white;
}

#gpt-chatbot-download:hover {
  background-color: var(--accent-amber);
  color: white;
}

/* SVG icon for send button */




/* Footer */
#gpt-chatbot-footer {
  border-top: 1px solid var(--slate-200);
  padding: 14px 18px;
  box-sizing: border-box;
  font-family: 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  font-size: 0.75rem;
  background-color: var(--slate-100);
  color: var(--slate-500);
  min-height: 60px;
  position: absolute;
  width: 100%;
  bottom: 0;
  border-radius: 0 0 12px 12px;
}

/* Toggle buttons - minimalist floating action buttons */
#gpt-chatbot-toggle,
#gpt-chatbot-toggle-robot {
  position: fixed;
  top: 230px;
  right: 30px;
  z-index: 9998;
  cursor: pointer;
  background: #0a545a;
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1rem;
  width: 76px;
  height: 76px;
  box-shadow: var(--shadow-lg);
  transition: var(--transition-ease);
  display: flex;
  align-items: center;
  justify-content: center;
	-webkit-box-shadow: 0px 0px 12px 12px rgba(255,255,255,0.8); 
box-shadow: 0px 0px 12px 12px rgba(255,255,255,0.8);
	  z-index: 9999;
}


#chatbot-hint-strip {
  position: fixed;
  top: 231px;
  right: 50px;
  background-color: #0a545a;
  color: white;
  padding: 8px 80px 8px 16px;
  border-radius: 12px;
  font-size: 1em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.6s ease;
  z-index: 1;
}
#chatbot-hint-strip.show {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 768px) {

#gpt-chatbot-toggle,
#gpt-chatbot-toggle-robot {
  top: 160px;
-webkit-box-shadow: 0px 0px 12px 12px rgba(255,255,255,0.5); 
box-shadow: 0px 0px 12px 12px rgba(255,255,255,0.5);
}
#chatbot-hint-strip {
  top: 161px;
  right: 20px;
  font-size: .7em;
}
	
}	

#gpt-chatbot-toggle:hover,
#gpt-chatbot-toggle-robot:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 20px -5px rgba(0, 0, 0, 0.25);
  background: var(--slate-800);
}

#gpt-chatbot-toggle::before {
  content: "\f086";
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
font-family: "Font Awesome 6 Free";
	font-size: 1.6em;
}

#gpt-chatbot-toggle-robot::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'%3E%3C/rect%3E%3Ccircle cx='12' cy='5' r='2'%3E%3C/circle%3E%3Cpath d='M12 7v4'%3E%3C/path%3E%3Cline x1='8' y1='16' x2='8' y2='16'%3E%3C/line%3E%3Cline x1='16' y1='16' x2='16' y2='16'%3E%3C/line%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* Utility classes */
.source-link {
  font-weight: 400 !important;
  color: var(--slate-500) !important;
  margin: 0 0 0.1rem 0 !important;
  text-decoration: none !important;
}

.source-link a {
  font-weight: 400 !important;
  color: var(--slate-600) !important;
  text-decoration: none !important;
  border-bottom: 1px dotted var(--slate-400);
}

.right-text {
  right: 18px;
  position: absolute;
  opacity: 0.7;
  font-size: 0.7rem;
}

/* Redesigned close-details button */
.close-details {
  background: var(--slate-600);
  border: none;
  color: white;
  border-radius: 6px;
  width: 98%;
  margin: 10px 15px 10px 0;
  padding: 8px 0;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: var(--transition-ease);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-details:hover {
  background: var(--slate-700);
}



/* Modernized spinner and animations */
.icon-container {
  position: absolute;
  margin-left: -35px;
  margin-bottom: 5px;
  margin-right: 20px;
  display: inline-block;
  color: var(--slate-400);
  background: transparent;
}

.icon-container-robot {
  position: absolute;
  display: inline-block;
  color: white;
  bottom: 15px;
}

.animated-dot {
  position: absolute;
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulseAnimation 1.2s ease-in-out infinite;
}

.animated-dot-robot {
  position: absolute;
  left: 50%;
  top: -7px; 
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: pulseAnimation 1.2s ease-in-out infinite;
}

.animated-icon {
  animation: spinAnimation 1.2s ease-in-out infinite;
}

.thinking {
  color: var(--slate-400);
}

/* Modern, subtle typing indicator */
.typing-indicator {
  background-color: var(--slate-700);
  padding: 12px 16px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  display: inline-block;
  margin-bottom: 12px;
  position: relative;
  max-width: 80px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  float: left;
  margin: 0 1px;
  background-color: var(--slate-300);
  display: block;
  border-radius: 50%;
  opacity: 0.4;
}

.typing-indicator span:nth-child(1) {
  animation: pulseAnimation 1s infinite;
}

.typing-indicator span:nth-child(2) {
  animation: pulseAnimation 1s infinite 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation: pulseAnimation 1s infinite 0.3s;
}

.spinner {
  border: 2px solid rgba(0, 0, 0, 0.05);
  border-top-color: var(--slate-500);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spinAnimation 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
}

/* Animation keyframes */
@keyframes pulseAnimation {
  0%, 100% { 
    transform: scale(0.8);
    opacity: 0.5; 
  }
  50% { 
    transform: scale(1);
    opacity: 0.8; 
  }
}

@keyframes spinAnimation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Media queries */
@media screen and (max-width: 735px) {
  .gpt-chatbot-msg, .gpt-chatbot-msg p,
  .gpt-chatbot-user, .gpt-chatbot-user p,
  .gpt-chatbot-bot, .gpt-chatbot-bot p {
    font-size: .85rem;
    padding: 10px 14px;
  }
  
  #gpt-chatbot-title {
    font-size: 0.9rem;
  }
  
  #gpt-chatbot-suggestions button.gpt-chatbot-bubble {
    font-size: 0.75rem;
    padding: 5px 12px;
  }
  
  #gpt-chatbot-input-area {
    padding: 10px 14px 14px;
  }
  
  #gpt-chatbot-input {
    height: 40px;
    font-size: 0.875rem;
  }
  
  #gpt-chatbot-send, 
  #gpt-chatbot-download {
    height: 40px;
    width: 40px;
  }
}

/* Tablet & kleinere Laptops (≤ 1000px Breite): unten rechts verankert wie Desktop,
   aber kleinerer Toggle-Button und ein an den verfügbaren Platz angepasstes Fenster. */
@media only screen and (max-width: 1000px) {
  #gpt-chatbot-toggle,
  #gpt-chatbot-toggle-robot {
    bottom: 60px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  #gpt-chatbot-container {
    bottom: 90px;
    right: 20px;
    width: min(60vw, 480px);
    height: min(70vh, 640px);
    min-width: 300px;
  }
}

/* Smartphones (≤ 767px): quasi Vollbild, respektiert Kerbe/Home-Bar (safe-area) */
@media (max-width: 767px) {
  #gpt-chatbot-container {
    position: fixed;
    top: env(safe-area-inset-top, 12px);
    right: env(safe-area-inset-right, 12px);
    bottom: env(safe-area-inset-bottom, 12px);
    left: env(safe-area-inset-left, 12px);
    width: 90dvw;
    height: 90dvh;
    min-width: 0;
    min-height: 0;
    max-width: none;
    max-height: none;
    resize: none;
	margin: 2dvh 5dvw 8dvh 5dvw;
  }
}

/* Sehr niedrige Viewports (z. B. Smartphone im Querformat): Toggle-Buttons ausblenden,
   da für ein sinnvolles Chatfenster ohnehin kein Platz mehr ist. */
@media only screen and (max-height: 500px) {
  #gpt-chatbot-toggle,
  #gpt-chatbot-toggle-robot,
  #gpt-chatbot-toggle-2 {
    display: none !important;
  }
}