*,
*::before,
*::after { box-sizing: border-box; }

body.theme-dark {
  --bg-body: #050505;
  --bg-sidebar: #050505;
  --bg-main: radial-gradient(circle at top, #18181b 0, #050505 45%, #000 100%);
  --bg-panel: #050505;
  --bg-panel-soft: #111111;
  --border-soft: #27272a;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #f5f5f5;
  --accent-soft: rgba(250, 250, 250, 0.06);
}

body.theme-light {
  --bg-body: #f3f4f6;
  --bg-sidebar: #f9fafb;
  --bg-main: #f3f4f6;
  --bg-panel: #ffffff;
  --bg-panel-soft: #f9fafb;
  --border-soft: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #111827;
  --accent-soft: rgba(15, 23, 42, 0.04);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;     /* größer */
  line-height: 1.75;   /* luftiger */
  background: var(--bg-body);
  color: var(--text);
}

.app {
  width: 100vw;
  height: 100vh;
  display: flex;
  background: var(--bg-main);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  gap: 12px;
  transition: width 0.18s ease, padding 0.18s ease;
}
.sidebar.collapsed { width: 64px; padding-inline: 8px; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 6px;
}

.sidebar-logo-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #111111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-header-text { display: flex; flex-direction: column; flex: 1; }
.sidebar-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sidebar-role { font-size: 11px; color: var(--text-muted); }

.sidebar-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel-soft);
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-header-text { display: none; }
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

.nav-item {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  font-size: 13px;
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item-primary { background: var(--accent-soft); }
.nav-item:hover { border-color: var(--accent); }

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding-inline: 0; }

.sidebar-footer { margin-top: auto; padding-inline: 6px; padding-bottom: 2px; }
.sidebar-footnote { font-size: 10px; color: var(--text-muted); }

/* Main */
.main-column { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Landing */
.landing {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 32px 20px 24px;
}
.landing-inner {
  margin: auto;
  max-width: 820px;
  text-align: center;
  padding: 16px 0 0;
}
.landing-title {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 300;
  letter-spacing: 0.01em;
}
.landing-sub {
  margin: 0 0 20px;
  font-size: 16px;
  color: var(--text-muted);
}

/* Suggestion bubbles */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.suggestion-bubble {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel-soft);
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
}
.suggestion-bubble:hover { border-color: var(--accent); color: var(--text); }

/* Chat */
.chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.chat-header {
  flex-shrink: 0;
  padding: 10px 24px 6px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-main { width: 100%; max-width: 980px; }
.chat-title { font-size: 16px; font-weight: 500; }
.chat-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 0 10px; }
.messages { flex: 1; overflow-y: auto; padding: 8px 16px 6px; }

.message-row,
.projects-grid-container { max-width: 980px; margin-left: auto; margin-right: auto; }

.message-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
}

.message-row-assistant { background: var(--bg-panel-soft); }
.message-row-user { background: transparent; justify-content: flex-end; }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #111111;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.message-row-user .avatar { background: var(--border-soft); color: var(--text); }

.bubble {
  max-width: 100%;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}

/* Sichtbare User-Bubble (rechts) */
.message-row-user .bubble {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  padding: 10px 12px;
}

/* Assistant-Bubble (in Row-Feld) */
.message-row-assistant .bubble {
  background: transparent;
  padding: 0;
}

.bubble-image img { max-width: 260px; border-radius: 12px; display: block; }

/* Loading */
.bubble-loading { display: inline-flex; gap: 4px; align-items: center; }
.bubble-loading .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--text-muted);
  animation: bounce 1s infinite ease-in-out;
}
.bubble-loading .dot:nth-child(2) { animation-delay: 0.1s; }
.bubble-loading .dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input */
.input-form { margin-top: 10px; }
.input-form-chat { flex-shrink: 0; border-top: none; padding: 8px 16px 12px; }
.input-form-chat .input-row { max-width: 980px; margin: 0 auto; }

.input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-panel-soft);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--border-soft);
}

/* Landing: kein Rahmen, nur Underline */
.input-row-large {
  padding: 0;
  max-width: 740px;
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
}
#landingInput {
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 4px 8px;
  width: 100%;
}

textarea {
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  flex: 1;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.75;
  min-height: 30px;
  color: var(--text);
}
textarea::placeholder { color: var(--text-muted); }

.input-hint {
  max-width: 980px;
  margin: 6px auto 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
}

/* Icon buttons (Mic + Send) */
.icon-button {
  border-radius: 999px;
  border: none;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

/* Mic Icon */
.icon-mic {
  width: 16px;
  height: 16px;
  position: relative;
  display: inline-block;
}
.icon-mic::before,
.icon-mic::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.icon-mic::before {
  width: 8px;
  height: 10px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  top: 1px;
}
.icon-mic::after {
  width: 12px;
  height: 8px;
  border-bottom: 1.5px solid currentColor;
  border-radius: 0 0 10px 10px;
  bottom: 1px;
}

.voice-button-active { color: var(--accent); }

/* Send Button (ChatGPT-artig) */
.icon-send {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1.4px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.icon-send::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: translateX(1px) rotate(-45deg);
}

.send-button { color: var(--text-muted); }
.send-button.send-enabled { color: var(--accent); }

/* Assistant Speak Button */
.speak-button {
  margin-top: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.speak-button:hover { color: var(--text); background: var(--accent-soft); }

/* Projekte Grid */
.projects-grid-container {
  margin: 12px auto 14px;
  padding: 12px 12px 10px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: var(--bg-panel-soft);
}
.projects-heading { margin: 0 0 10px; font-size: 15px; font-weight: 500; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }

.project-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}
.project-thumb { height: 110px; background-size: cover; background-position: center; }
.project-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.project-title { font-size: 15px; font-weight: 600; }
.project-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.project-badge { border-radius: 999px; padding: 2px 8px; font-size: 11px; background: var(--accent-soft); color: var(--text-muted); }
.project-teaser { font-size: 14px; color: var(--text-muted); }
.project-meta { font-size: 12px; color: var(--text-muted); }
.project-actions { margin-top: 6px; }
.project-button {
  border-radius: 999px;
  border: none;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--accent);
  color: #111111;
  cursor: pointer;
}

/* Modal */
.case-modal { position: fixed; inset: 0; z-index: 40; display: none; }
.case-modal.visible { display: block; }
.case-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(12px); }
.case-modal-panel {
  position: relative;
  max-width: 920px;
  margin: 32px auto;
  max-height: calc(100vh - 64px);
  background: var(--bg-panel);
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 24px 80px rgba(0,0,0,0.85);
  overflow: hidden;
}
.case-modal-content { padding: 18px 18px 14px; overflow-y: auto; }
.case-modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; border-radius: 999px;
  border: none; background: var(--bg-panel-soft); color: var(--text-muted);
  font-size: 18px; cursor: pointer;
}

.case-modal-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: 14px;
  margin-bottom: 16px;
}
.case-modal-image { border-radius: 18px; background-size: cover; background-position: center; background-color: var(--bg-panel-soft); min-height: 180px; }
.case-modal-client { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); margin-bottom: 4px; }
.case-modal-hero-text h2 { margin: 0 0 4px; font-size: 22px; font-weight: 400; }
.case-modal-subtitle { margin: 0 0 6px; font-size: 14px; color: var(--text-muted); }
.case-modal-meta { margin: 0; font-size: 12px; color: var(--text-muted); }
.case-modal-body h3 { margin: 0 0 6px; font-size: 15px; }
.case-modal-body p { margin: 0 0 12px; font-size: 14px; color: var(--text); }
.case-modal-body ul { margin: 0 0 8px 18px; padding: 0; font-size: 14px; }
.case-modal-footer {
  margin-top: 8px;
  padding: 10px 18px 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.primary-button, .secondary-button {
  border-radius: 999px;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.primary-button { background: var(--accent); color: #111111; font-weight: 600; }
.secondary-button { background: var(--border-soft); color: var(--text); }

/* Utils */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .chat-header { padding-inline: 16px; }
  .messages { padding-inline: 10px; }
  .input-form-chat { padding-inline: 10px; }
  .case-modal-panel { margin: 14px; max-height: calc(100vh - 28px); }
  .case-modal-hero { grid-template-columns: minmax(0, 1fr); }
}
