/* friendsbook – Design im Stil von Google Currents (Material) */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --blue: #1a73e8;
  --blue-dark: #1765cc;
  --blue-soft: #e8f0fe;
  --bg: #f8f9fa;
  --card: #ffffff;
  --line: #dadce0;
  --text: #202124;
  --text2: #5f6368;
  --red: #d93025;
  --green: #188038;
  --hover: rgba(60, 64, 67, 0.08);
}
body {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
h1, h2, h3, .brand, .auth-title { font-family: "Google Sans", Roboto, sans-serif; }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
a { text-decoration: none; color: inherit; }
svg.icon { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }

/* ---------- Material-Buttons ---------- */
.btn-filled {
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25px;
  padding: 9px 24px;
  transition: box-shadow 0.15s, background 0.15s;
}
.btn-filled:hover { background: var(--blue-dark); box-shadow: 0 1px 3px rgba(60,64,67,0.4); }
.btn-filled:disabled { background: #aecbfa; cursor: default; }
.btn-text {
  background: none;
  color: var(--blue);
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.25px;
  padding: 9px 12px;
}
.btn-text:hover { background: var(--blue-soft); }
.btn-outlined {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
}
.btn-outlined:hover { background: var(--blue-soft); }
.btn-green { background: var(--green); color: #fff; border: none; border-radius: 4px; font-size: 14px; font-weight: 500; padding: 8px 16px; }
.btn-gray { background: #f1f3f4; color: var(--text2); border: none; border-radius: 4px; font-size: 14px; font-weight: 500; padding: 8px 16px; }
.btn-gray:hover { background: #e8eaed; }

/* ---------- Login ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fff;
}
.auth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 48px 40px 36px;
  width: 440px;
  text-align: center;
}
.auth-logo { width: 56px; height: 56px; }
.auth-title { font-size: 26px; font-weight: 500; margin: 14px 0 4px; color: var(--text); }
.auth-sub { color: var(--text2); font-size: 15px; margin-bottom: 26px; }
.auth-card input {
  width: 100%;
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
}
.auth-card input:focus { outline: none; border: 2px solid var(--blue); padding: 12px 14px; }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; text-align: left; }
.auth-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 32px; height: 32px; }
.brand span { color: var(--text2); font-size: 21px; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.me-menu-wrap { position: relative; }
.me-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  font-family: inherit;
  color: var(--text2);
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: none;
  background: none;
  cursor: pointer;
}
.me-chip:hover { background: var(--hover); }
.me-chip .caret { width: 18px; height: 18px; fill: var(--text2); }
.me-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(60,64,67,0.25);
  padding: 6px 0;
  z-index: 100;
}
.me-menu a, .me-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.me-menu a:hover, .me-menu button:hover { background: var(--hover); }
.me-menu svg { width: 20px; height: 20px; fill: var(--text2); flex-shrink: 0; }

/* ---------- Avatare ---------- */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-lg { width: 110px; height: 110px; font-size: 44px; border: 4px solid #fff; box-shadow: 0 1px 3px rgba(60,64,67,0.3); }

/* ---------- Layout mit linker Navigation ---------- */
.layout {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
}
.sidenav {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 76px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidenav a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 11px 18px;
  border-radius: 0 24px 24px 0;
  color: var(--text2);
  font-weight: 500;
  font-size: 14px;
}
.sidenav a:hover { background: var(--hover); }
.sidenav a.active { background: var(--blue-soft); color: var(--blue); }
.main { flex: 1; max-width: 640px; margin: 16px auto; padding: 0 16px 80px; }

/* ---------- Untere Navigation (Handy) ---------- */
.bottomnav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.bottomnav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  color: var(--text2);
  font-size: 11px;
  font-weight: 500;
}
.bottomnav a.active { color: var(--blue); }

/* ---------- Karten ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ---------- Composer ---------- */
.composer { padding: 16px; }
.composer-top { display: flex; gap: 12px; align-items: center; }
.composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 40px;
}
.composer textarea:focus { outline: none; border-bottom: 2px solid var(--blue); }
.composer-actions { display: flex; gap: 4px; margin-top: 14px; align-items: center; }
.composer-actions label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text2);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
}
.composer-actions label:hover { background: var(--hover); }
.composer-actions input[type=file] { display: none; }
.composer-publish { margin-left: auto; }
.composer-preview { margin-top: 12px; position: relative; }
.composer-preview video, .composer-preview img {
  width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
  background: #000;
}
.composer-preview .remove-media {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(32,33,36,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  font-size: 15px;
}
.upload-progress { margin-top: 10px; font-size: 13px; color: var(--text2); }
.upload-bar { height: 4px; background: var(--blue-soft); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.upload-bar div { height: 100%; background: var(--blue); width: 0; transition: width 0.2s; }

/* ---------- Posts ---------- */
.post { padding: 0; }
.post-head { display: flex; gap: 12px; padding: 16px 16px 0; align-items: center; }
.post-head .who { flex: 1; }
.post-head .who .name { font-weight: 500; font-size: 15px; }
.post-head .who .name:hover { text-decoration: underline; cursor: pointer; }
.post-head .who .time { font-size: 12px; color: var(--text2); }
.post-delete { background: none; border: none; color: var(--text2); padding: 8px; border-radius: 50%; display: flex; }
.post-delete:hover { background: var(--hover); }
.post-text { padding: 12px 16px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.post-media { margin-top: 4px; }
.post-media video, .post-media img { width: 100%; max-height: 600px; background: #000; display: block; object-fit: contain; }
.post-stats { display: flex; justify-content: space-between; padding: 10px 16px 4px; color: var(--text2); font-size: 13px; }
.post-actions { display: flex; border-top: 1px solid var(--line); margin: 8px 16px 0; padding: 4px 0 8px; gap: 4px; }
.post-actions button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
  padding: 8px 16px;
  border-radius: 16px;
}
.post-actions button:hover { background: var(--hover); }
.post-actions button.liked { color: var(--blue); background: var(--blue-soft); }
.plusone { font-weight: 700; font-size: 15px; letter-spacing: 0.5px; }

/* ---------- Kommentare ---------- */
.comments { padding: 8px 16px 16px; }
.comment { display: flex; gap: 10px; margin-top: 10px; }
.comment .bubble {
  background: var(--bg);
  border: 1px solid #f1f3f4;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  max-width: 100%;
}
.comment .bubble .name { font-weight: 500; font-size: 13px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form input {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 14px;
  font-family: inherit;
}
.comment-form input:focus { outline: none; border-color: var(--blue); }
.comment-form button {
  background: none;
  color: var(--blue);
  border: none;
  border-radius: 20px;
  padding: 0 14px;
  font-weight: 500;
}
.comment-form button:hover { background: var(--blue-soft); }

/* ---------- Profil ---------- */
.profile-header { text-align: center; padding: 0 16px 24px; }
.profile-header .cover {
  height: 120px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(120deg, #4285F4, #34A853, #FBBC05, #EA4335);
  opacity: 0.85;
}
.profile-header .avatar-lg { margin-top: -55px; }
.profile-header h2 { margin-top: 12px; font-size: 24px; font-weight: 500; }
.profile-header .username { color: var(--text2); font-size: 14px; }
.profile-header .bio { margin-top: 10px; font-size: 14px; color: var(--text); }
.profile-header .meta { color: var(--text2); font-size: 13px; margin-top: 8px; }
.profile-actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.profile-edit { padding: 16px; display: grid; gap: 12px; border-top: 1px solid var(--line); }
.profile-edit input, .profile-edit textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.profile-edit input:focus, .profile-edit textarea:focus { outline: none; border-color: var(--blue); }
.profile-edit .btn-filled { justify-self: end; }

/* ---------- Personen / Freunde ---------- */
.section-title { font-size: 16px; font-weight: 500; padding: 16px 16px 8px; font-family: "Google Sans", Roboto, sans-serif; }
.search-box { padding: 8px 16px 16px; }
.search-box input {
  width: 100%;
  padding: 11px 18px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
}
.search-box input:focus { outline: none; background: #fff; border-color: var(--blue); }
.person-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid #f1f3f4;
}
.person-row .who { flex: 1; cursor: pointer; }
.person-row .who .name { font-weight: 500; }
.person-row .who .sub { font-size: 12px; color: var(--text2); }
.empty { padding: 28px 16px; text-align: center; color: var(--text2); }

/* ---------- Shorts (wie YouTube) ---------- */
.shorts-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.shorts-head label { display: flex; align-items: center; gap: 6px; }
.shorts-title { font-size: 22px; font-weight: 500; font-family: "Google Sans", Roboto, sans-serif; }
.shorts-scroll {
  height: calc(100dvh - 170px);
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  border-radius: 12px;
  scrollbar-width: none;
}
.shorts-scroll::-webkit-scrollbar { display: none; }
.short {
  position: relative;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.short video { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.short-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px;
  pointer-events: none;
}
.short-info, .short-actions { pointer-events: auto; }
.short-info { color: #fff; max-width: 70%; }
.short-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
.short-caption { margin-top: 8px; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }
.short-actions { display: flex; flex-direction: column; gap: 10px; }
.short-actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
}
.short-actions button:hover { background: #fff; }
.short-actions button.liked { color: var(--blue); background: var(--blue-soft); }
.short-comments {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 55%;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px 12px 0 0;
  z-index: 5;
}

/* ---------- Drag und Drop (Shorts) ---------- */
.shorts-droparea { position: relative; border-radius: 12px; }
.shorts-droparea .drop-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  align-items: center;
  justify-content: center;
  background: rgba(232, 240, 254, 0.92);
  border: 3px dashed var(--blue);
  border-radius: 12px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 500;
  font-family: "Google Sans", Roboto, sans-serif;
  pointer-events: none;
}
.shorts-droparea.dragging .drop-hint { display: flex; }

/* ---------- Einladungen ---------- */
.invite-code {
  font-family: "Consolas", "Roboto Mono", monospace;
  letter-spacing: 2px;
  font-size: 16px;
}
.invite-hint {
  padding: 0 16px 10px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.4;
}

/* ---------- Marktplatz ---------- */
.market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.listing { margin-bottom: 0; overflow: hidden; }
.listing img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg);
  display: block;
  cursor: pointer;
}
.listing-body { padding: 12px 14px 14px; }
.listing-price {
  font-size: 19px;
  font-weight: 700;
  font-family: "Google Sans", Roboto, sans-serif;
}
.listing-desc { margin-top: 6px; font-size: 14px; color: var(--text); white-space: pre-wrap; word-wrap: break-word; }
.listing-seller {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  cursor: pointer;
}
.listing-seller .name { font-weight: 500; font-size: 13px; }
.listing-seller .sub { font-size: 12px; color: var(--text2); }
.listing-actions { margin-top: 12px; }
.listing-actions button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- Chats (wie Google Chat) ---------- */
.chats-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 16px 10px;
}
.chats-head button { display: flex; align-items: center; gap: 6px; }
.chat-row { cursor: pointer; }
.chat-row:hover { background: var(--bg); }
.chat-last { max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-unread-text { font-weight: 700; color: var(--text); }
.chat-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-badge {
  background: var(--blue);
  color: #fff;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 0 6px;
}
.chat-card { display: flex; flex-direction: column; height: calc(100dvh - 130px); }
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.chat-title { font-weight: 500; font-size: 16px; cursor: pointer; }
.chat-title:hover { text-decoration: underline; }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 75%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-msg.mine .chat-bubble {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.chat-time { font-size: 11px; color: var(--text2); margin-top: 3px; padding: 0 4px; }
.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
}
.chat-form input:focus { outline: none; border-color: var(--blue); }
.chat-form button { border-radius: 20px; padding: 8px 20px; }

@media (max-width: 900px) {
  .sidenav { display: none; }
  .bottomnav { display: flex; }
  .bottomnav a { font-size: 10px; }
  .me-chip span:last-child { display: none; }
  .auth-card { border: none; padding: 24px 8px; }
  .shorts-scroll { height: calc(100dvh - 230px); }
  .chat-card { height: calc(100dvh - 200px); }
  .market-grid { grid-template-columns: 1fr; }
}
