:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #5b21b6;
  --danger: #ef4444;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, system-ui, Arial;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* Dark mode */
body.dark {
  --bg: #0b1020;
  --card: #0f1724;
  --text: #e6eef8;
  --muted: #9aa7c7;
  --accent: #7c3aed;
  --danger: #f87171;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  /* background: linear-gradient(90deg, rgba(91, 33, 182, 0.1)); */
    background: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700;
  font-size: 1.2rem;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-right button {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

/* Layout */
.container {
  max-width: 800px;
  margin: 18px auto;
  padding: 0 12px 80px;
}

/* Cards */
.card {
  /* display: flex; */
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.06);
  margin-bottom: 14px;
}

/* Auth screen */
.center-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
.auth-card {
  width: 320px;
  padding: 18px;
}
.auth-card input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.auth-actions {
  display: flex;
  gap: 8px;
}
.auth-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
.auth-actions #auth-submit {
  background: var(--accent);
  color: white;
}

/* Controls */
.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.controls input,
.controls select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Create post */
.create-post textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  resize: vertical;
}
.create-post input {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.create-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.emoji-picker button {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  margin-right: 6px;
}

/* Feed cards */
.feed .post {
  margin-bottom: 10px;
  overflow: hidden;
}
.post .post-head {
  display: flex;
  justify-content: space-between;
  /* align-items: center; */
  padding-bottom: 8px;
}
.post .meta {
  font-size: 13px;
  color: var(--muted);
}
.post .post-body {
  padding: 6px 0;
}
.post img {
  max-width: 100%;
  border-radius: 8px;
  margin-top: 8px;
}
.post .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}
.like-btn.liked {
  color: var(--danger);
  font-weight: 700;
}
.small {
  font-size: 13px;
  color: var(--muted);
}

/* Feed layout for mobile */
@media (min-width: 900px) {
  .container {
    max-width: 900px;
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-card {
  background: var(--card);
  padding: 14px;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
}
.modal-card textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Utility */
.hidden {
  display: none;
}
.small-muted {
  font-size: 13px;
  color: var(--muted);
}
footer {
  padding: 18px;
  text-align: center;
  color: var(--muted);
}

.feed {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.card.post {
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  transition: transform 0.2s;
}

.card.post:hover {
  transform: translateY(-5px);
}

.post-body img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 10px;
}
.card.post {
  position: relative;
  padding-bottom: 60px; /* space for fixed buttons */
}

/* Make action bar fixed at bottom INSIDE the card */
.card.post .actions {
  position: absolute;
  bottom: 10px;
  left: 15px;
  right: 15px;

  display: flex;
  gap: 10px;
  justify-content: flex-start;

  background: var(--card);
  padding: 8px 0;
}
