/* ============================================================
   Karriere-Navi – Style
   Apple Minimal · Mobile First · Gold Accent
   ============================================================ */

/* ── Tokens (Light) ──────────────────────────────────────────── */
:root {
  --bg:         #f8f8f8;
  --surface:    #ffffff;
  --surface-2:  #f0f0f0;
  --text:       #111111;
  --text-2:     #555555;
  --text-3:     #888888;
  --accent:     #c8a96a;
  --accent-bg:  rgba(200, 169, 106, 0.10);
  --border:     rgba(0,0,0,0.08);
  --shadow-sm:  0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.08);
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  20px;
  --font:       -apple-system, BlinkMacSystemFont, "SF Pro Display",
                "Helvetica Neue", Arial, sans-serif;
  --transition: 0.18s ease;
}

/* System Dark Mode (fallback before user toggles) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0f0f10;
    --surface:   #1c1c1e;
    --surface-2: #2c2c2e;
    --text:      #f0f0f0;
    --text-2:    #ababab;
    --text-3:    #666666;
    --accent:    #d4b97a;
    --accent-bg: rgba(212, 185, 122, 0.12);
    --border:    rgba(255,255,255,0.08);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  }
}

/* Manual Dark Mode (toggled via JS body.dark) */
body.dark {
  --bg:        #0f0f10;
  --surface:   #1c1c1e;
  --surface-2: #2c2c2e;
  --text:      #f0f0f0;
  --text-2:    #ababab;
  --text-3:    #666666;
  --accent:    #d4b97a;
  --accent-bg: rgba(212, 185, 122, 0.12);
  --border:    rgba(255,255,255,0.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { height: 100%; font-size: 16px; }

body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ── App Shell ───────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── Header ──────────────────────────────────────────────────── */
#header {
  padding: 16px 20px 12px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  flex-shrink: 0;
}

.btn-back:active  { background: var(--border); }
.btn-back:disabled { opacity: 0.3; cursor: default; }

.app-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.btn-icon:active { background: var(--border); }

.progress-bar {
  height: 3px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
  text-align: right;
  font-weight: 500;
}

/* ── Main ────────────────────────────────────────────────────── */
#main {
  flex: 1;
  padding: 24px 20px 180px;
  overflow-y: auto;
  transition: opacity 0.12s ease;
}

/* ── State Card (Render-Wrapper) ─────────────────────────────── */
.state-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.state-card h1 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.frage {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* ── Choice Buttons ──────────────────────────────────────────── */
.button-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.choice-btn {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), transform 0.1s ease,
              box-shadow var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.choice-btn::after {
  content: '›';
  font-size: 20px;
  color: var(--text-3);
  flex-shrink: 0;
}

.choice-btn:active {
  transform: scale(0.985);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ── Primary Next Button ─────────────────────────────────────── */
.btn-next {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(200, 169, 106, 0.30);
  transition: opacity var(--transition), transform 0.1s ease;
  letter-spacing: -0.01em;
  margin-top: 8px;
}

.btn-next:active {
  opacity: 0.85;
  transform: scale(0.985);
}

/* ── Helper Questions ────────────────────────────────────────── */
.helper-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.helper-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-2);
  font-style: italic;
  box-shadow: var(--shadow-sm);
}

/* ── Mini Cards ──────────────────────────────────────────────── */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  line-height: 1.5;
}

/* ── End Box ─────────────────────────────────────────────────── */
.end-box {
  background: var(--accent-bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  margin: 8px 0 20px;
}

.btn-restart {
  width: 100%;
  min-height: 52px;
  background: var(--surface-2);
  color: var(--text-2);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-restart:active { background: var(--border); }

/* ── Footer (fixed) ──────────────────────────────────────────── */
#footer {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 456px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 10px;
  z-index: 20;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.btn-footer {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}

.btn-footer:active { border-color: var(--accent); color: var(--accent); }

.btn-footer-accent {
  color: var(--accent);
  border-color: var(--accent-bg);
  background: var(--accent-bg);
}

/* ── Panels (bottom sheet) ───────────────────────────────────── */
.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.panel-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 20px env(safe-area-inset-bottom, 20px);
  z-index: 60;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.15);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 85dvh;
  overflow-y: auto;
}

.panel.active {
  transform: translateX(-50%) translateY(0);
}

.panel-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 auto 20px;
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* Tipp Panel */
.tipp-main {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 12px;
}

.tipp-alt-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.tipp-alt {
  font-size: 14px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.5;
}

/* Einwand Panel */
.einwand-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.einwand-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.einwand-title {
  width: 100%;
  background: var(--surface-2);
  border: none;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.einwand-answer {
  display: none;
  padding: 12px 16px 14px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.einwand-item.open .einwand-answer {
  display: block;
}

.einwand-answer-text {
  margin: 0;
}

.einwand-meta {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

.einwand-meta-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  margin-right: 4px;
}

/* ── Home View ───────────────────────────────────────────────── */
.home-menu {
  padding: 12px 0 28px;
  display: flex;
  flex-direction: column;
}

.home-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.home-headline {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 10px;
}

.home-sub {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0 0 28px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-button {
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.home-button::after {
  content: '›';
  font-size: 20px;
  color: var(--text-3);
  flex-shrink: 0;
}

.home-button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.home-button--primary::after {
  color: rgba(255, 255, 255, 0.7);
}

.home-button:active {
  transform: scale(0.985);
}

.home-version {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  margin: 24px 0 0;
  letter-spacing: 0.03em;
}

/* ── Module Cards (Home) ─────────────────────────────────────── */
.module-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease;
}

.module-card:not(.module-card--soon):active {
  transform: scale(0.985);
}

.module-card--soon {
  opacity: 0.55;
  cursor: default;
}

.module-card-main {
  flex: 1;
  min-width: 0;
}

.module-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.module-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.module-card-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.4;
  margin: 0;
}

.module-card-arrow {
  font-size: 22px;
  color: var(--text-3);
  flex-shrink: 0;
  line-height: 1;
}

.module-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.module-badge--active {
  background: var(--accent-bg);
  color: var(--accent);
}

.module-badge--soon {
  background: var(--surface-2);
  color: var(--text-3);
}

/* ── Toast ───────────────────────────────────────────────────── */
.app-toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

.app-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.signature {
  font-size: 11px;
  font-style: italic;
  color: var(--text-3);
  opacity: 0.55;
  text-align: center;
  letter-spacing: 0.04em;
  margin-top: 5px;
}

/* ── Notizen Panel ───────────────────────────────────────────── */
.notizen-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 6px;
}

.notizen-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  resize: none;
  outline: none;
  margin-bottom: 10px;
}

.notizen-input:focus { border-color: var(--accent); }

.notizen-textarea {
  min-height: 90px;
  line-height: 1.5;
}

.btn-reset {
  width: 100%;
  min-height: 46px;
  background: none;
  border: 1.5px solid rgba(200,0,0,0.25);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: #c0392b;
  cursor: pointer;
  margin-top: 4px;
  transition: background var(--transition);
}

.btn-reset:active { background: rgba(200,0,0,0.06); }

.btn-export {
  width: 100%;
  min-height: 46px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
  margin-top: 8px;
  transition: background var(--transition);
}

.btn-export:active { background: var(--surface-2); }

.btn-home-nav {
  width: 100%;
  min-height: 40px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
  margin-top: 4px;
}

.btn-home-nav:active { color: var(--accent); }

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Responsive: Tablet & Desktop ───────────────────────────── */
@media (min-width: 520px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .frage { font-size: 24px; }

  #footer {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (min-width: 768px) {
  body { background: var(--surface-2); }

  #app {
    margin-top: 24px;
    margin-bottom: 24px;
    min-height: calc(100dvh - 48px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }

  #footer {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
}

/* ── Notizen: Status Select ──────────────────────────────────── */
.notizen-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Neues Gespräch Button ───────────────────────────────────── */
.btn-new-conv {
  width: 100%;
  min-height: 46px;
  background: var(--accent-bg);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
  transition: background var(--transition);
}

.btn-new-conv:active { background: rgba(200, 169, 106, 0.20); }

/* ── Gesprächsliste ──────────────────────────────────────────── */
.conv-list-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.conv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}

.conv-empty {
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
  padding: 16px 0;
}

.conv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.conv-item--active {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.conv-item-main {
  flex: 1;
  padding: 11px 14px;
  cursor: pointer;
  min-width: 0;
}

.conv-item-main:active { opacity: 0.7; }

.conv-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.conv-item--active .conv-item-name {
  color: var(--accent);
}

.conv-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conv-date {
  font-size: 11px;
  color: var(--text-3);
}

/* Status Badges */
.conv-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
}

.conv-status--offen         { background: rgba(100,160,255,0.15); color: #4a90d9; }
.conv-status--folgetermin   { background: rgba(200,169,106,0.20); color: var(--accent); }
.conv-status--interessant   { background: rgba(80,200,120,0.15);  color: #3aaa64; }
.conv-status--nicht_passend { background: rgba(150,150,150,0.15); color: var(--text-3); }

/* Delete Button */
.conv-delete {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin-right: 6px;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.conv-delete:active {
  background: rgba(200,0,0,0.08);
  color: #c0392b;
}

.conv-copy {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.conv-copy:active {
  background: var(--accent-bg);
  color: var(--accent);
}

.panel-privacy-note {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
  margin: 16px 0 4px;
}
