/* familie.moser.ai — LifeOS-Stil (Glassmorphism, ruhig, mobile-first) */
:root {
  --bg: #0e1117;
  --bg-2: #1a1d24;
  --surface: rgba(30, 34, 44, 0.7);
  --surface-2: rgba(40, 44, 56, 0.5);
  --border: rgba(255, 255, 255, 0.08);
  --border-2: rgba(255, 255, 255, 0.14);
  --text: #e8eaed;
  --text-mute: #9aa0a6;
  --text-soft: #6c7380;
  --accent: #c8a2c8;
  --accent-2: #e8c4d8;
  --gold: #d4a55a;
  --rose: #e89bac;
  --green: #8db496;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --t: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lexend', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(200, 162, 200, 0.08), transparent 60%),
    radial-gradient(1000px 500px at 100% 100%, rgba(212, 165, 90, 0.05), transparent 60%),
    var(--bg);
}

.hidden { display: none !important; }

/* Login */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.login-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  text-align: center;
  width: 100%; max-width: 320px;
}
.login-icon {
  font-size: 22px; font-weight: 600; color: var(--accent);
  margin-bottom: 24px; letter-spacing: 0.04em;
}
.login-card input {
  width: 100%; padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text); font-size: 18px; text-align: center;
  letter-spacing: 0.4em; font-family: inherit;
  margin-bottom: 12px;
}
.login-card input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.login-card button {
  width: 100%; padding: 14px;
  background: var(--accent);
  color: #1a0d1a; border: 0;
  border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: transform var(--t), background var(--t);
}
.login-card button:hover { background: var(--accent-2); }
.login-card button:active { transform: scale(0.98); }
.error { color: var(--rose); margin-top: 12px; font-size: 14px; min-height: 1em; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: env(safe-area-inset-top, 12px) 20px 12px 20px;
  background: rgba(14, 17, 23, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text); font-size: 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); }
.icon-btn:active { transform: scale(0.94); }

/* Main */
main {
  padding: 16px 16px 100px 16px;
  max-width: 720px; margin: 0 auto;
}

/* Tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex;
  background: rgba(14, 17, 23, 0.92);
  backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  padding: 8px 0 calc(env(safe-area-inset-bottom, 8px) + 8px) 0;
  z-index: 10;
}
.tab {
  flex: 1; background: transparent; border: 0;
  color: var(--text-mute); font-family: inherit;
  font-size: 13px; padding: 8px 4px;
  cursor: pointer; transition: color var(--t);
}
.tab.active { color: var(--accent); font-weight: 600; }

/* Cards */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), border-color var(--t);
}
.card:hover { border-color: var(--border-2); }
.card-clickable { cursor: pointer; }
.card-clickable:active { transform: scale(0.99); }

.section-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 18px 4px 10px 4px;
  font-weight: 500;
}
.section-title:first-child { margin-top: 6px; }

/* Bubble (initial) */
.bubble {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: #1a0d1a;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  flex-shrink: 0;
}
.bubble-lg { width: 80px; height: 80px; font-size: 32px; }
.bubble-sm { width: 36px; height: 36px; font-size: 16px; }

/* Person row */
.person-row {
  display: flex; align-items: center; gap: 14px;
}
.person-row .info { flex: 1; min-width: 0; }
.person-row .name { font-size: 16px; font-weight: 500; }
.person-row .meta { font-size: 13px; color: var(--text-mute); }
.person-row .badge {
  font-size: 11px; padding: 3px 8px;
  border-radius: 99px; background: var(--surface-2);
  color: var(--text-mute);
}
.badge-warn { background: rgba(212, 165, 90, 0.15); color: var(--gold); }
.badge-bd   { background: rgba(232, 155, 172, 0.15); color: var(--rose); }
.badge-soon { background: rgba(141, 180, 150, 0.15); color: var(--green); }

/* Birthday card */
.bd-card {
  background: linear-gradient(135deg, rgba(232, 155, 172, 0.12), rgba(212, 165, 90, 0.08));
  border-color: rgba(232, 155, 172, 0.25);
}
.bd-card .name { font-size: 17px; }
.bd-card .gesture {
  margin-top: 10px; font-size: 14px;
  font-style: italic; color: var(--text-mute);
  border-left: 2px solid var(--rose); padding-left: 10px;
}

/* Filter */
.filter-bar {
  display: flex; gap: 8px;
  margin: 4px 4px 14px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.filter-pill {
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 13px; font-family: inherit;
  white-space: nowrap; cursor: pointer;
  transition: all var(--t);
}
.filter-pill.active {
  background: var(--accent);
  color: #1a0d1a;
  border-color: var(--accent);
  font-weight: 500;
}

/* Detail */
.detail-header {
  text-align: center; padding: 20px 0 10px 0;
}
.detail-header .name {
  font-size: 24px; font-weight: 600; margin-top: 14px;
}
.detail-header .rel {
  color: var(--text-mute); font-size: 14px; margin-top: 4px;
}
.detail-bubble { margin: 0 auto; }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 16px 0;
}
.detail-grid .stat {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 12px;
  text-align: center;
}
.detail-grid .stat-label {
  font-size: 11px; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.detail-grid .stat-value {
  font-size: 18px; font-weight: 500; margin-top: 4px;
}
.detail-actions {
  display: flex; gap: 8px;
  margin: 16px 0;
}
.btn {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: 14px;
  cursor: pointer; transition: all var(--t);
  flex: 1;
}
.btn-primary {
  background: var(--accent); color: #1a0d1a; border-color: var(--accent);
  font-weight: 500;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-danger { color: var(--rose); }
.btn-danger:hover { border-color: var(--rose); }
.btn:active { transform: scale(0.97); }

/* Encounter */
.encounter-row {
  border-left: 2px solid var(--accent);
  padding: 10px 0 10px 14px;
  margin-bottom: 12px;
}
.encounter-row .date {
  font-size: 12px; color: var(--text-soft); letter-spacing: 0.04em;
}
.encounter-row .topic { font-size: 15px; margin-top: 4px; }
.encounter-row .loc { font-size: 13px; color: var(--text-mute); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 90vh;
  background: var(--bg-2);
  border-top: 1px solid var(--border-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  display: flex; flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 18px; font-weight: 600; }
#modal-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Form */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: var(--text-mute);
  letter-spacing: 0.02em;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--text); font-family: inherit; font-size: 15px;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.range-row {
  display: flex; align-items: center; gap: 12px;
}
.range-row input[type="range"] { flex: 1; }
.range-row .range-val {
  font-size: 18px; color: var(--accent); font-weight: 600;
  min-width: 30px; text-align: center;
}

/* Toast */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  padding: 12px 20px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Birthday grid (12 month) */
.bd-month-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.bd-month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.bd-month-name {
  font-size: 12px; color: var(--text-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.bd-month-entry { font-size: 13px; padding: 3px 0; }
.bd-month-entry .day {
  display: inline-block; width: 26px;
  color: var(--accent); font-weight: 500;
}

/* Empty state */
.empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-soft);
}
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.4; }

@media (min-width: 600px) {
  .bd-month-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === Familie & Freunde Erweiterung 27.04.2026 === */

/* Type-Pills */
.type-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  vertical-align: middle;
  border: 1px solid var(--border-2);
  color: var(--text-mute);
  background: rgba(255, 255, 255, 0.04);
}
.type-familie { color: var(--rose); border-color: rgba(232, 155, 172, 0.35); }
.type-freund  { color: var(--accent); border-color: rgba(200, 162, 200, 0.35); }
.type-kollege { color: var(--gold);   border-color: rgba(212, 165, 90, 0.35); }
.type-sonst   { color: var(--text-soft); }

/* Chat / Gespraech */
#chat-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px;
}
.chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 88%;
}
.chat-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(200, 162, 200, 0.18), rgba(200, 162, 200, 0.08));
  border-color: rgba(200, 162, 200, 0.35);
}
.chat-assistant {
  align-self: flex-start;
  background: var(--surface-2);
}
.chat-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.chat-text { color: var(--text); white-space: pre-wrap; word-break: break-word; }

.chat-input-card {
  position: sticky;
  bottom: calc(72px + env(safe-area-inset-bottom, 0));
  margin-top: 16px;
}
.chat-input-card textarea {
  min-height: 64px;
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  resize: vertical;
  margin-bottom: 10px;
}
.chat-input-card textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
