:root {
  --color-primary: #C0140C;
  --color-primary-hover: #A0100A;
  --color-event-button: #6e2434;
  --color-bg-input: #eeeded;
  --color-bg-dark: #282828;
  --color-text-muted: #878787;
  --color-text-secondary: #777;
  --color-text-primary: #222;
  --color-text-light: #333;
  --spacing-card: 1.2rem;
  --border-radius-input: 25px;
  --border-radius-card: 8px;
  --border-radius-message: 0.8rem;
  
  /* Content-Karten */
  --card-width: 948px;
  --card-height: 394px;
  --card-date-width: 112px;
  --card-content-width: 410px;
  --card-image-width: 328px;
}

body {
  font-family: system-ui, -apple-system, 'DIN Pro', sans-serif;
  background: #f5f5f5;
  color: var(--color-text-primary);
  padding: 2rem 2rem 0 2rem;
  max-width: 1200px;
  margin: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 0;
}

h1 { 
  font-size: 1.4rem; 
  margin-bottom: 1rem; 
}

#output {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
  flex: 1;
  padding-bottom: 120px; /* Platz für fixiertes Input-Feld */
}

.message {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.message .label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  font-weight: 600;
}

.message.user {
  align-items: flex-end;
}

.message.user .label {
  color: var(--color-primary);
}

.message.user .user-bubble {
  background: var(--color-bg-input);
  color: var(--color-text-primary);
  padding: 0.9rem 1rem;
  border-radius: var(--border-radius-input);
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  max-width: 100%;
  line-height: 1.6;
  white-space: pre-wrap;
}

.message.bot .bot-message {
  align-self: flex-start;
  max-width: 100%;
}

.bot-message {
  background: transparent;
  padding: 1.2rem;
  border-radius: var(--border-radius-card);
  line-height: 1.7;
  color: var(--color-text-light);
}

.bot-message strong {
  font-weight: 600;
  color: var(--color-primary);
}

.bot-message h1,
.bot-message h2,
.bot-message h3,
.bot-message h4,
.bot-message h5,
.bot-message h6 {
  margin: 1rem 0 0.6rem 0;
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.3;
}

.bot-message h1 { font-size: 1.4rem; }
.bot-message h2 { font-size: 1.3rem; }
.bot-message h3 { font-size: 1.2rem; }
.bot-message h4 { font-size: 1.1rem; }
.bot-message h5 { font-size: 1rem; }
.bot-message h6 { font-size: 0.95rem; color: #555; }

.bot-message ol {
  margin: 1rem 0;
  padding-left: 1.8rem;
}

.bot-message ul {
  margin: 1rem 0;
  padding-left: 1.8rem;
}

.bot-message li {
  margin: 0.8rem 0;
  line-height: 1.6;
}

.bot-message li strong {
  font-size: 1.05em;
}

.bot-message p {
  margin: 1rem 0;
  line-height: 1.7;
}

.bot-message p:first-child {
  margin-top: 0;
}

.bot-message p:last-child {
  margin-bottom: 0;
}

.matches {
  margin-top: 1rem;
  display: grid;
  gap: .6rem;
}

.card {
  background: #fff;
  border-radius: var(--border-radius-card);
  padding: .8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

.card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--color-primary);
}

.card .similarity {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.5rem;
}

.card a { 
  color: var(--color-primary); 
  text-decoration: none;
}

button { 
  padding: .65rem; 
  border: none; 
  background: var(--color-primary); 
  color: #fff; 
  border-radius: .3rem; 
  cursor: pointer; 
}

button:hover { 
  background: var(--color-primary-hover); 
}

button:disabled { 
  background: #ccc; 
  cursor: not-allowed; 
}

.loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #f0f0f0;
  border-radius: var(--border-radius-card);
  margin-top: 0.5rem;
}

.loading-dots {
  display: flex;
  gap: 0.4rem;
}

.loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: pulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(1) {
  animation-delay: 0s;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%, 60%, 100% {
    transform: scale(1);
    opacity: 0.7;
  }
  30% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input-Feld mit Zeichenzähler - Fixiert am unteren Rand */
.input-wrapper {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  background: var(--color-bg-input);
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 25px;
}

#query {
  width: 90%;
  border: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  resize: none; /* Kein manuelles Resize */
  outline: none; /* Kein Rahmen beim Fokus */
  overflow: hidden; /* Verhindert Scrollbar */
  height: 1.5rem; /* Initiale Höhe = eine Zeile (explizit gesetzt) */
  max-height: 200px; /* Maximale Höhe */
  line-height: 1.5;
  padding: 0;
  margin: 0;
  vertical-align: top; /* Verhindert zusätzliche Höhe */
}

#query:focus {
  outline: none;
}

.char-counter {
  bottom: 0.5rem;
  right: 3.5rem;
  font-size: 0.625rem;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  font-weight: 500;
  pointer-events: none;
  z-index: 1;
}

.send-button-wrapper {
  bottom: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.9375rem;
  z-index: 2;
}

.send-button {
  width: 37px;
  height: 37px;
  border-radius: 18.5px;
  background: var(--color-bg-dark);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 6px 4px -3px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0px 8px 6px -3px rgba(0,0,0,0.3);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.send-button svg {
  width: 20px;
  height: 20px;
}

/* Content-Karten (Figma-Design) */
.content-card {
  display: flex;
  background: #fff;
  border-radius: var(--border-radius-card);
  box-shadow: 0px 12.307px 12.307px -8.204px rgba(0,0,0,0.25);
  overflow: hidden;
  margin: 1.5rem 0;
  width: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.content-card--clickable {
  cursor: pointer;
}

.content-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0px 16px 16px -8px rgba(0,0,0,0.3);
}

.content-card__date {
  width: var(--card-date-width);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  flex-shrink: 0;
}

.content-card__date::after {
  content: '';
  position: absolute;
  right: 0;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 1px;
  background: #e0e0e0;
}

.date-day {
  font-size: 2.65rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-primary);
  font-family: 'DIN Pro Condensed', system-ui, sans-serif;
}

.date-month {
  font-size: 0.99rem;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--color-text-primary);
  margin-top: 0.5rem;
  font-family: 'DIN Pro Condensed', system-ui, sans-serif;
}

.content-card__content {
  flex: 1;
  padding: 2rem 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.82rem;
  min-width: 0;
}

.content-card__title {
  font-size: 1.64rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.2;
  font-family: 'DIN Pro Condensed', system-ui, sans-serif;
}

.content-card__description {
  font-size: 1rem;
  line-height: 1.65;
  color: #636363;
  margin: 0;
  flex: 1;
}

.content-card__description p {
  margin: 0.5rem 0;
}

.content-card__description p:first-child {
  margin-top: 0;
}

.content-card__description p:last-child {
  margin-bottom: 0;
}

.content-card__image {
  width: var(--card-image-width);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.content-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content-card__image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 65.147%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}

.content-card__button {
  position: absolute;
  bottom: 0.54rem;
  right: 0.52rem;
  background: var(--color-event-button);
  color: #fff;
  padding: 0.51rem 0.77rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  z-index: 1;
  pointer-events: none; /* Verhindert Klicks - nur visuell */
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
}

/* Hover-Effekt auf der ganzen Karte */
.content-card--clickable:hover .content-card__button {
  background: #5a1d2a;
  transform: translateY(-1px);
}

/* Content-Karten ohne Datum (für andere Typen) */
.content-card--web_pages .content-card__date,
.content-card--places .content-card__date,
.content-card--tours .content-card__date,
.content-card--routes .content-card__date,
.content-card--posts .content-card__date,
.content-card--jobs .content-card__date {
  display: none;
}

.content-card--web_pages .content-card__content,
.content-card--places .content-card__content,
.content-card--tours .content-card__content,
.content-card--routes .content-card__content,
.content-card--posts .content-card__content,
.content-card--jobs .content-card__content {
  padding-left: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-card {
    flex-direction: column;
    max-width: 100%;
  }
  
  .content-card__date {
    width: 100%;
    padding: 1rem;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
  }
  
  .content-card__date::after {
    display: none;
  }
  
  .content-card__content {
    padding: 1.5rem;
  }
  
  .content-card__image {
    width: 100%;
    height: 300px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .content-card {
    margin: 1rem 0;
  }
  
  .content-card__title {
    font-size: 1.3rem;
  }
  
  .content-card__description {
    font-size: 0.9rem;
  }
}
