/* timeline — your wall on the open web.
   Visual cues from classic Facebook (~2012): blue navbar, light-grey
   feed background, white post cards, blue author links. Modernised
   with proper system font stack and restrained spacing — the goal is
   "Facebook you'd actually want to use" rather than literal replica. */

:root {
  /* Facebook palette */
  --fb-blue: #3B5998;
  --fb-blue-deep: #2A4888;
  --fb-blue-bright: #4267B2;
  --fb-bg: #e9eaed;
  --fb-card: #ffffff;
  --fb-rule: #dddfe2;
  --fb-rule-strong: #ccd0d5;
  --fb-text: #1d2129;
  --fb-text-soft: #4b4f56;
  --fb-text-muted: #90949c;
  --fb-link: #365899;
  --fb-link-hover: #1d4ad9;
  --fb-like: #d8392b;
  --fb-ok: #42b72a;

  --shadow-card: 0 1px 1px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 1px 4px rgba(0, 0, 0, 0.10);

  --type-ui: "Helvetica Neue", -apple-system, BlinkMacSystemFont,
             "SF Pro Text", Arial, sans-serif;
  --type-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--fb-bg);
  color: var(--fb-text);
  font-family: var(--type-ui);
  font-size: 14px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100%;
}

button, input, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--fb-link); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--fb-link-hover); }

/* — appbar (Facebook-blue navbar) — */

.appbar {
  background: var(--fb-blue);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.appbar-inner {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.appbar-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  font-family: var(--type-ui);
}
.appbar-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.appbar-status {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 200ms ease;
  flex-shrink: 0;
}
.appbar-status.connecting { background: rgba(255, 255, 255, 0.4); animation: pulse 1.4s ease-in-out infinite; }
.appbar-status.live { background: var(--fb-ok); }
.appbar-status.error { background: var(--fb-like); }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.appbar-id {
  font-size: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  padding: 4px 10px;
  border-radius: 999px;
  font-feature-settings: "tnum";
}

/* — page layout — */

.page {
  max-width: 580px;
  margin: 16px auto 60px;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* — composer (the "what's on your mind?" box) — */

.composer {
  background: var(--fb-card);
  border: 1px solid var(--fb-rule);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.composer-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
}
.composer-avatar,
.post-avatar,
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--fb-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}
.composer-avatar img,
.post-avatar img,
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.composer-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--fb-text);
  max-height: 220px;
  font-family: inherit;
}
.composer-input::placeholder { color: var(--fb-text-muted); }
.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--fb-rule);
  background: #f6f7f9;
}
.composer-where {
  font-family: var(--type-mono);
  font-size: 11px;
  color: var(--fb-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}
.post-btn {
  background: var(--fb-blue);
  color: #fff;
  border: 1px solid var(--fb-blue-deep);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 120ms ease, transform 80ms ease;
}
.post-btn:hover:not(:disabled) { background: var(--fb-blue-deep); }
.post-btn:active:not(:disabled) { transform: translateY(1px); }
.post-btn:disabled {
  background: #ccd0d5;
  border-color: #ccd0d5;
  color: #fff;
  cursor: not-allowed;
}

/* — feed — */

.feed { position: relative; }
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* — post — */

.post {
  background: var(--fb-card);
  border: 1px solid var(--fb-rule);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: post-enter 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes post-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.post-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 8px;
}
.post-meta {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--fb-link);
  letter-spacing: -0.005em;
}
.post-author:hover { text-decoration: underline; }
.post-time {
  display: block;
  font-size: 12px;
  color: var(--fb-text-muted);
  margin-top: 1px;
  font-feature-settings: "tnum";
}
.post-time a {
  color: inherit;
  text-decoration: none;
}
.post-time a:hover { text-decoration: underline; }

.post-body {
  padding: 0 12px 12px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fb-text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.post-body a {
  color: var(--fb-link);
  text-decoration: none;
}
.post-body a:hover { text-decoration: underline; }
.post-body code {
  font-family: var(--type-mono);
  background: #f0f2f5;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12.5px;
}

.post-footer {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  border-top: 1px solid var(--fb-rule);
  background: #f6f7f9;
}
.post-action {
  background: transparent;
  border: 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fb-text-soft);
  transition: background 80ms ease, color 80ms ease;
}
.post-action:hover { background: rgba(0, 0, 0, 0.06); color: var(--fb-link); }
.post-action.liked { color: var(--fb-like); }

/* — empty state — */

.feed-empty {
  background: var(--fb-card);
  border: 1px solid var(--fb-rule);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  padding: 28px 20px;
  text-align: center;
}
.feed-empty strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--fb-text);
  margin-bottom: 4px;
}
.feed-empty p {
  margin: 0;
  font-size: 13px;
  color: var(--fb-text-muted);
}

/* — toast — */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #323232;
  color: #fff;
  border-radius: 4px;
  padding: 10px 14px 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  animation: toast-rise 220ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toast-rise {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.toast-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.toast-close:hover { color: #fff; }

/* — responsive — */

@media (max-width: 500px) {
  .page { padding: 0 0; }
  .composer, .post, .feed-empty {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
