:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #1d9bf0;
  --accent-soft: rgba(29, 155, 240, 0.12);
  --text: #e5e7eb;
  --muted: #6b7280;
  --border: #1f2937;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #111827, #020617);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== HEADER ===== */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  text-transform: uppercase;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.top-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ===== LAYOUT ===== */

.layout {
  max-width: 1150px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 280px;
  gap: 1rem;
  padding: 1rem;
}

.column {
  min-height: 80vh;
}

.card {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 1rem;
}

.card-title {
  margin-top: 0;
  font-size: 1rem;
}

/* ===== LEFT NAV ===== */

.nav-card {
  position: sticky;
  top: 4.25rem;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
}

.nav-link span.icon {
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

.nav-link:hover {
  background: rgba(31, 41, 55, 0.9);
}

/* ===== BUTTONS & INPUTS ===== */

button {
  font: inherit;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #f9fafb;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background 0.12s ease;
}

.btn:hover {
  background: #1a8cd8;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.45);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

/* Smaller ghost button for quote cancel */

.quote-cancel-btn {
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
}

/* Fields */

textarea,
input[type="file"] {
  font: inherit;
}

.field {
  margin-bottom: 0.65rem;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.field-label strong {
  color: var(--text);
}

.hint-label {
  font-size: 0.7rem;
  color: var(--muted);
}

.textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.file-input {
  width: 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Composer footer */

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.composer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.badge {
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}

/* Character count */

.char-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.char-count.too-long {
  color: var(--danger);
}

/* Errors */

.error-text {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Media preview (multi-images / video) */

.media-preview {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.media-preview img,
.media-preview video {
  border-radius: 14px;
  border: 1px solid var(--border);
}

.media-preview img {
  max-width: calc(50% - 0.35rem);
}

.media-preview video {
  max-width: 100%;
}

/* ===== QUOTE PREVIEW ===== */

.hidden {
  display: none;
}

.quote-wrapper {
  margin-top: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(15, 23, 42, 0.8);
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.quote-preview {
  font-size: 0.8rem;
  color: var(--muted);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.6rem;
  background: #020617;
}

.quote-preview-text {
  white-space: pre-wrap;
  margin-bottom: 0.3rem;
}

.quote-preview-media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.quote-preview-media img,
.quote-preview-media video {
  border-radius: 10px;
  border: 1px solid var(--border);
}

.quote-preview-media img {
  max-width: calc(50% - 0.35rem);
}

.quote-preview-media video {
  max-width: 100%;
}

/* ===== FEED ===== */

.feed-card {
  padding: 0;
  overflow: hidden;
}

.feed-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

#feed {
  display: flex;
  flex-direction: column;
}

.feed-empty {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.post {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.post:last-child {
  border-bottom: none;
}

.post-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.post-author {
  font-weight: 600;
  color: #e5e7eb;
}

.post-time {
  font-size: 0.75rem;
}

.post-text {
  font-size: 0.93rem;
  line-height: 1.4;
  white-space: pre-wrap;
  margin-bottom: 0.45rem;
}

/* Anonymous user colors */
.post-author {
  font-weight: 600;
}

.post-author.username-color-0 { color: #ff6b6b; }
.post-author.username-color-1 { color: #f9a826; }
.post-author.username-color-2 { color: #2ecc71; }
.post-author.username-color-3 { color: #3498db; }
.post-author.username-color-4 { color: #9b59b6; }
.post-author.username-color-5 { color: #e67e22; }


/* Post media gallery */

.post-media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.post-media img,
.post-media video {
  border-radius: 14px;
  border: 1px solid var(--border);
}

.post-media img {
  max-width: calc(50% - 0.35rem);
}

.post-media video {
  max-width: 100%;
}

/* ===== CLICKABLE LINKS & HASHTAGS ===== */

.post-text a,
.quote-preview-text a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.post-text a:hover,
.quote-preview-text a:hover {
  text-decoration: underline;
}

.hashtag {
  font-weight: 500;
}

/* ===== POST ACTIONS (LIKE / RESHARE / QUOTE) ===== */

.post-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.like-btn,
.reshare-btn,
.quote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.06s ease;
}

.like-btn:hover,
.reshare-btn:hover,
.quote-btn:hover {
  background: rgba(31, 41, 55, 0.85);
  transform: translateY(-0.5px);
}

.like-btn .like-icon,
.reshare-btn .reshare-icon,
.quote-btn .quote-icon {
  font-size: 0.9rem;
}

.like-btn.liked {
  color: #fb923c;
  background: rgba(248, 113, 113, 0.08);
}

.reshare-btn.reshared {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

/* ===== HASHTAG FILTER BAR ===== */

.feed-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.96);
}

.feed-filter-label strong {
  color: var(--accent);
}

.feed-filter-clear {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.feed-filter-clear:hover {
  background: rgba(31, 41, 55, 0.9);
}

/* ===== RIGHT COLUMN ===== */

.about-text {
  font-size: 0.85rem;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.pill {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.tools-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .column-right {
    display: none;
  }
}

@media (max-width: 720px) {
  header {
    padding-inline: 1rem;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 0.75rem;
  }

  .column-left {
    display: none;
  }

  .card {
    border-radius: 0;
  }

  .feed-card {
    border-radius: 0;
  }
}
