/* Shannon - app shell styles (Claude.ai-style chat layout, built on tokens.css) */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-xl);
  flex: none;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
}

.topbar__mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-brand);
  color: var(--gray-0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: none;
}

.topbar__controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Segmented control, reused for both the language and the theme switch */
.segmented {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2px;
}

.segmented button {
  appearance: none;
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--bg-selected);
  color: var(--text-primary);
  font-weight: 500;
}

/* Chat column */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat > :not(.bg-video) {
  position: relative;
  z-index: 1;
}

.bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scrim für Lesbarkeit von Begrüßung und Footer */
.bg-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-page);
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .bg-video video { display: none; }
}

.chat__scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0 var(--spacing-lg) 8vh;
  gap: var(--spacing-lg);
  text-align: center;
}

.empty-state__greeting {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  margin: 0;
}

.empty-state__spark {
  color: var(--accent-brand);
  font-size: 26px;
  line-height: 1;
}

.messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

/* Message row / bubble */
.message-row {
  display: flex;
  width: 100%;
}

.message-row--user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 80%;
  border-radius: var(--radius-bubble);
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: 15px;
  line-height: 22px;
  white-space: pre-wrap;
}

.message-bubble--user {
  background: var(--bg-bubble);
}

.message-bubble--assistant {
  padding: var(--spacing-md) 0;
}

.message-bubble--thinking {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.message-bubble--thinking span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
  animation: shannon-thinking 1.2s infinite ease-in-out;
}

.message-bubble--thinking span:nth-child(2) {
  animation-delay: 0.2s;
}

.message-bubble--thinking span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes shannon-thinking {
  0%,
  80%,
  100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

/* Portfolio images/video attached to an assistant reply */
.message-bubble__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.message-bubble__figure {
  margin: 0;
  width: 220px;
}

.message-bubble__figure img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  display: block;
}

.message-bubble__figure figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-bubble__video {
  margin-top: var(--spacing-md);
  max-width: 480px;
}

.message-bubble__video iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: var(--radius-lg);
}

/* Composer dock */
.composer-dock {
  flex: none;
  padding: 0 var(--spacing-lg) var(--spacing-md);
}

.composer {
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-composer);
  padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-xs);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

[data-theme="dark"] .composer {
  box-shadow: none;
}

.composer textarea {
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 21px;
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-sm) 0 var(--spacing-md);
  max-height: 160px;
}

.composer textarea::placeholder {
  color: var(--text-muted);
}

.composer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-xs) var(--spacing-xs) var(--spacing-sm);
}

.composer__tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-selected);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.composer button[type="submit"] {
  appearance: none;
  border: none;
  cursor: pointer;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.composer button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.footer-note a {
  color: inherit;
}
