:root {
  --bg-start: #f0faf2;
  --bg-end: #e6f7ea;
  --card-bg: #ffffff;
  --bot-bg-start: #e4f9eb;
  --bot-bg-end: #c6f2d0;
  --bot: #155a2b;
  --user-bg-start: #fffbee;
  --user-bg-end: #ffedb3;
  --user: #2a1f00;
  --accent: #2ecc71;
  --dark-accent: #1aab5a;
  --muted: #7a8c82;
  --info: #5a4200;
  --radius: 18px;
  --radius-mid: 28px;
  --radius-big: 60px;
  --shadow-sm: 0 2px 12px rgba(30,80,40,0.07);
  --shadow-md: 0 6px 28px rgba(30,80,40,0.10);
  --shadow-lg: 0 16px 48px rgba(30,80,40,0.13);
}

/* Page level */
html,body{
  height:100%;
  width: 100%;
  overflow: hidden;
  overflow-x: hidden;
  margin:0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(180deg,var(--bg-start), var(--bg-end));
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  box-sizing:border-box;
  scroll-behavior: smooth;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background:
    radial-gradient(ellipse 70% 50% at 10% 10%, rgba(46,204,113,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 90% 90%, rgba(255,220,100,0.10) 0%, transparent 60%),
    linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

body.allow-scroll {
  overflow-x: auto;
  overflow-y: auto;
}

code {
  background: rgba(46,204,113,0.10);
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
}

.page-wrapper {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.container {
  width: 100%;
  max-width: 800px;
}

/* Header and title styling */

.header {
  text-align: center;
  margin-bottom: 18px;
}

.header.center { margin-top: 50vh; }

.back-button {
  position: fixed;
  top: 20px;        /* Abstand nach oben */
  left: 20px;       /* Abstand nach links */
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-mid);
  color: var(--bot);
  background: linear-gradient(90deg,var(--bot-bg-start), var(--bot-bg-end));
  transition: all 0.3s ease;
  z-index: 999;
}

.back-button:hover {
  transform: scale(1.2);
}


.title {
  font-family: Inter, sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 0 6px 0;
  letter-spacing: -1px;
}

.subtitle {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0;
}

.multi-a {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.multi-a a {
  color: var(--accent);
  text-decoration: none;
  padding: 10px 30px;
  border: 1px solid var(--accent);
  border-radius: 25px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.multi-a a:hover {
  background: linear-gradient(180deg, var(--accent), var(--dark-accent));
  color: #fff;
  box-shadow: 0 10px 28px rgba(10,168,79,0.14);
}

/* sections */
section {
  margin-bottom: 24px;
  padding: 24px;
  border: 2px solid var(--accent);
  border-radius: var(--radius-big);
  background: linear-gradient(180deg, var(--bot-bg-start), var(--bot-bg-end));
  color: var(--bot);
}

section:first-of-type { margin-top: 25vh; }

section h2 {
  color: var(--accent);
}

section a {
  color: var(--bot);
  text-decoration: underline;
}
section a:hover {
  cursor: pointer;
}

/* Chat container */
.chat {
  position: relative;
  width: 100%;
  height: calc(100dvh - 215px);
  margin: 0 auto 12px auto;
  overflow-y: auto;
  border-radius: var(--radius);
  padding: 18px;
  border: 1.5px solid rgba(46,204,113,0.18);
  background:
    linear-gradient(170deg, rgba(255,255,255,0.97), rgba(240,252,244,0.96));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 120ms cubic-bezier(.2,.9,.3,1), box-shadow 120ms;
  animation: pop-in 0.32s cubic-bezier(.5,1.8,.5,1) both;
}

.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a8edbe, #6dd49a);
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.6);
}

#new-chat {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 10;
  width: 0;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.15s;
}

#new-chat:hover { opacity: 1; transform: scale(1.12); }

#new-chat .icon-wrapper {
  position: relative;
  display: inline-block;
}

#new-chat .icon-wrapper i { color: var(--bot); }

#new-chat .plus-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 14px; /* kleiner als Haupticon */
  color: var(--accent) !important;
}

/* Modal styling */

.modal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: all;
  backdrop-filter: blur(1px);
  border-radius: inherit;
}

.modal {
  position: fixed;
  background: linear-gradient(180deg, var(--user-bg-start), var(--user-bg-end));
  border: 1px solid var(--user-bg-end);
  color: var(--info);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(15,23,42,0.06);
  max-width: 400px;
  width: 90%;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  transition: transform 120ms cubic-bezier(.2,.9,.3,1), box-shadow 120ms;
  animation: modal-pop-in 0.32s cubic-bezier(.5,1.8,.5,1) both;
}
.modal.pop-out {
  animation: modal-pop-in 0.32s cubic-bezier(.5,1.8,.5,1) reverse both;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.modal-buttons button {
  padding: 8px 16px;
  border-radius: var(--radius-big);
  border: 2px solid var(--muted);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-buttons .green {
  border-color: var(--accent);
  color: var(--accent);
}

@keyframes modal-pop-in {
  0% { 
    opacity: 0; 
    transform: translate(-50%, -50%) scale(0.85) translateY(20px);
  }
  100% { 
    opacity: 1; 
    transform: translate(-50%, -50%) scale(1) translateY(0);
  }
}

/* Message bubbles */
.message{
  max-width: 78%;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  word-wrap: break-word;
  line-height: 1.45;
  font-size: 0.975rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms cubic-bezier(.2,.9,.3,1);
  animation: pop-in 0.3s cubic-bezier(.45,1.6,.45,1) both;
  position: relative;
}

@keyframes pop-in {
  0% { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.message:hover{ transform: translateY(-2px); }

.message.bot {
  align-self: flex-start;
  background: linear-gradient(135deg, var(--bot-bg-start), var(--bot-bg-end));
  color: var(--bot);
  border-bottom-left-radius: 5px;
  border: 1px solid rgba(46,204,113,0.15);
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--user-bg-start), var(--user-bg-end));
  color: var(--user);
  text-align: right;
  border-bottom-right-radius: 5px;
  border: 1px solid rgba(255,200,60,0.18);
}

.message.loading {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: linear-gradient(135deg, var(--bot-bg-start), var(--bot-bg-end));
  min-width: 52px;
  min-height: 38px;
  box-shadow: var(--shadow-sm);
  padding: 10px 16px;
}

.message.loading .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--dark-accent);
  border-radius: 50%;
  opacity: 0.7;
  animation: dot-bounce 1.2s infinite both;
}
.message.loading .dot:nth-child(2) { animation-delay: 0.18s; }
.message.loading .dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-7px); opacity: 1; }
}

/* Chat input area */
.chat-form {
  display: flex;
  gap: 0px;
  margin-top: 8px;
  margin-bottom: 12px;
  width: 100%;
  align-items: center;
  border: 1.5px solid var(--dark-accent);
  border-radius: 25px;
  background: linear-gradient(90deg,var(--bot-bg-start), var(--bot-bg-end));
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.chat-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(46,204,113,0.12), var(--shadow-sm);
}

/* Input and button styling */
#input{
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 16px 14px;
  border-radius:25px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--muted);
  font-size:14px;
  transition: all 0.5s ease;
}

#input::placeholder{ color: var(--muted); opacity:0.8; }

#submit{
  flex-shrink: 0;
  padding:11px 12px;
  margin: 5px;
  border-radius:25px;
  border:1px solid var(--accent);
  background: linear-gradient(180deg,var(--accent), var(--dark-accent));
  color:#fff;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 10px 28px rgba(10,168,79,0.14);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

#submit:active{ transform: translateY(1px); }

/* Small layout helpers to keep input/button aligned on one line */
#input, #submit{ vertical-align:middle; }

/* Start-Highlight für Input */
.input-attention {
  transition: transform 120ms cubic-bezier(.2,.9,.3,1), box-shadow 120ms;
  animation: 
    pulse-glow 1.6s ease-in-out infinite,
    pop-in 0.32s cubic-bezier(.5,1.8,.5,1) both;
  scale: 1.1;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(52,199,89,0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52,199,89,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52,199,89,0);
  }
}

/* Scrollbar styling */
.chat::-webkit-scrollbar{ width:10px; }
.chat::-webkit-scrollbar-track{ background: transparent; }
.chat::-webkit-scrollbar-thumb{ background: linear-gradient(180deg,#cfe9ff,#a1d2ff); border-radius:999px; border:3px solid rgba(255,255,255,0.6); }

/* Notice / Hinweis-Box */
.notice{
  display:flex;
  gap:12px;
  align-items:flex-start;
  background: linear-gradient(90deg, rgba(255,247,224,0.9), rgba(255,255,255,0.85));
  border:1px solid rgba(255,197,66,0.22);
  color: var(--info);
  padding:12px 14px;
  border-radius: var(--radius);
  justify-content: center;
  font-size:0.95rem;
  box-shadow: 0 6px 18px rgba(16,24,40,0.04);
  margin-top: 8px;
}

.notice-emoji{ font-size:1.2rem; line-height:1; margin-top:2px; color: #b35800; }
.notice strong{ color: #b35800; }
.notice a { text-decoration: underline; }

.notice a:hover { cursor: pointer; }

.fixed {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.notice-fixed-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 15, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: all;
  backdrop-filter: blur(1px);
  border-radius: inherit;
}

/* Responsive tweaks */
@media (max-width:520px){
  .chat{ height:60vh; padding:12px; }
  .message{ max-width:90%; padding:10px; }
  #input{ width: calc(100% - 96px); }
}

/* Small accessibility improvement for reduced motion */
@media (prefers-reduced-motion: reduce){
  .message{ transition:none; }
}

.layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  width: 100%;
  max-width: 1100px;
}

.avocado-figure {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 200px;
  margin-top: 0;
}

.avocado-float {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: floaty 3.2s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.avocado-shadow {
  width: 60px;
  height: 18px;
  background: radial-gradient(ellipse at center, #b2d8b2 60%, transparent 100%);
  opacity: 0.45;
  border-radius: 50%;
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%) scale(1.1);
  z-index: 0;
  animation: shadowy 3.2s ease-in-out infinite;
}

@keyframes shadowy {
  0%, 100% { opacity: 0.45; transform: translateX(-50%) scale(1.1); }
  50% { opacity: 0.25; transform: translateX(-50%) scale(0.95); }
}

@media (max-width: 900px) {
  .layout {
    gap: 12px;
  }
  .avocado-figure {
    min-width: 80px;
    min-height: 120px;
  }
  .avocado-figure svg {
    width: 80px;
    height: 120px;
  }
  .container {
    margin-right: 40px;
  }
}

@media (max-width: 700px) {
  .layout {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 0.5rem;
  }
  .page-wrapper {
    align-items: stretch;
    padding: 0;
  }
  .avocado-figure {
    margin-top: 0;
    margin-bottom: 8px;
    min-width: 60px;
    min-height: 90px;
  }
  .avocado-figure svg {
    width: 60px;
    height: 90px;
  }
  .container {
    max-width: 100vw;
    width: 100%;
    padding: 0;
    margin-right: 0;
  }
  .chat {
    max-width: 100vw;
    width: 100%;
    min-width: 0;
    height: calc(100dvh-300px);
    padding: 10px;
  }
  .header {
    margin-bottom: 10px;
  }
  .title {
    font-size: 1.3rem;
  }
  .subtitle {
    font-size: 0.95rem;
  }
  #input {
    width: calc(100% - 80px);
    font-size: 1rem;
    padding: 10px 8px;
  }
  .message {
    font-size: 1rem;
    max-width: 98%;
    padding: 8px 8px;
  }
}

@media (max-width: 420px) {
  .chat {
    height: calc(100dvh-400px);
    padding: 6px;
  }
  .avocado-figure {
    min-width: 40px;
    min-height: 60px;
  }
  .avocado-figure svg {
    width: 40px;
    height: 60px;
  }
  .title {
    font-size: 2rem;
  }
  .subtitle {
    font-size: 0.8rem;
  }
  #input {
    width: calc(100% - 60px);
    font-size: 0.95rem;
    padding: 12px 6px;
  }
  #submit {
    margin: 0 0 0 2px;
    padding: 12px;
  }
  .message {
    font-size: 0.95rem;
    padding: 6px 4px;
  }
  .input-attention {
    scale: 1;
  }
  .chat-form {
    margin: 0 5px 0 5px;
  }
  .notice {
    font-size: 11px;
  }
}

.footer {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
  margin-top: 24px;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  flex-shrink: 0;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.18s;
}
.footer-link:hover, .footer-link:focus {
  color: #0aa84f;
  text-decoration: underline;
}

@media (max-width: 700px) {
  .footer {
    font-size: 0.80rem;
    margin-top: 14px;
    margin-bottom: 4px;
    padding: 0 4px;
  }
}
