/* ============================================================
   STREET TASKERS — feed.css
   Sprint 2: Social feed, post cards, like/comment interactions
   Depends on: styles.css (must be loaded first)
   ============================================================ */

/* ── Feed page layout ────────────────────────────────────────── */
.feed-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
  background: var(--bg-subtle);
}

.feed-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  align-items: start;
}

/* ── Feed main column ────────────────────────────────────────── */
.feed-main { min-width: 0; }

/* ── New post box ────────────────────────────────────────────── */
.new-post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.new-post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.new-post-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  cursor: pointer;
  outline: none;
  transition: border-color var(--t) var(--ease);
}
.new-post-input:hover { border-color: var(--border-strong); }
.new-post-actions { display: flex; gap: 6px; }
.new-post-action-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all var(--t) var(--ease);
}
.new-post-action-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-light);
}

/* ── Feed post card ──────────────────────────────────────────── */
.feed-post {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow var(--t) var(--ease);
}
.feed-post:hover { box-shadow: var(--shadow-md); }

/* Post header */
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.feed-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.av-1{background:#0F172A} .av-2{background:#1E3A5F} .av-3{background:#1A3320}
.av-4{background:#2D1B00} .av-5{background:#1A0A2E} .av-6{background:#0A1F2E}
.av-current { background: var(--blue); }

.feed-author-info  { flex: 1; }
.feed-author-name  { font-weight: 700; font-size: 0.92rem; }
.feed-author-meta  {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.73rem; color: var(--text-muted); margin-top: 2px;
}
.feed-post-time    { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* Media */
.feed-media {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  /* Future Sprint 3: <img> or <video> from Supabase Storage replaces this */
}
.feed-media-icon { z-index: 1; }
.feed-media-overlay {
  position: absolute;
  bottom: 12px; left: 14px;
  z-index: 2;
}
.feed-media-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.3);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Actions bar */
.feed-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 8px;
}
.feed-actions-left, .feed-actions-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.feed-action-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: color var(--t) var(--ease), background var(--t) var(--ease);
}
.feed-action-btn:hover { background: var(--gray-100); color: var(--text-primary); }
.feed-action-liked { color: var(--red) !important; }
.feed-action-saved { color: var(--charcoal) !important; }

/* Like animation */
@keyframes likePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.like-pop { animation: likePop 0.28s var(--ease) both; }

/* Like count */
.feed-like-count {
  padding: 0 18px 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

/* Caption */
.feed-caption {
  padding: 2px 18px 6px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.feed-caption-author {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: 6px;
}
.feed-more-btn {
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  margin-left: 3px;
}
.feed-more-btn:hover { color: var(--text-primary); }

/* Tags */
.feed-tags {
  padding: 4px 18px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.feed-tag {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--blue);
  cursor: pointer;
}
.feed-tag:hover { text-decoration: underline; }

/* Comments preview */
.feed-comments-preview {
  padding: 2px 18px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comment-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.comment-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gray-600);
  color: var(--white);
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.comment-body { font-size: 0.82rem; line-height: 1.45; }
.comment-author { font-weight: 700; color: var(--text-primary); margin-right: 5px; }
.comment-text { color: var(--text-secondary); }

.comment-new {
  animation: slideIn 0.24s var(--ease) both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* View all comments */
.feed-view-comments {
  padding: 4px 18px 4px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
}
.feed-view-comments:hover { color: var(--text-primary); }

/* Comment input box */
.feed-comment-box {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--border);
}
.feed-comment-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feed-comment-input-wrap { flex: 1; position: relative; }
.feed-comment-input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.84rem;
  background: var(--bg-subtle);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t) var(--ease);
}
.feed-comment-input:focus { border-color: var(--blue); background: var(--white); }
.feed-comment-send {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  background: none; border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--blue);
  opacity: 0.6;
  transition: opacity var(--t) var(--ease);
}
.feed-comment-send:hover { opacity: 1; }

/* Book CTA */
.feed-book-cta {
  padding: 10px 18px 16px;
  display: flex;
  justify-content: flex-end;
}

/* ── Load more ───────────────────────────────────────────────── */
.feed-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 24px;
}

/* ── Feed sidebar ────────────────────────────────────────────── */
.feed-sidebar { display: flex; flex-direction: column; gap: 16px; }

.feed-sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.feed-sidebar-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Trending services */
.trending-service-list { display: flex; flex-direction: column; gap: 10px; }
.trending-service-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--t) var(--ease);
}
.trending-service-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.trending-service-icon {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.trending-service-name { font-weight: 600; font-size: 0.85rem; margin-bottom: 1px; }
.trending-service-count { font-size: 0.72rem; color: var(--text-muted); }

/* Suggested taskers */
.suggested-tasker-list { display: flex; flex-direction: column; gap: 10px; }
.suggested-tasker {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sug-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--charcoal);
  color: var(--white);
  font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sug-info { flex: 1; }
.sug-name { font-weight: 600; font-size: 0.84rem; margin-bottom: 1px; }
.sug-service { font-size: 0.72rem; color: var(--text-muted); }
.sug-follow-btn {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .feed-layout { grid-template-columns: 1fr; padding: 24px 16px 60px; gap: 20px; }
  .feed-sidebar { order: -1; }
  .new-post-actions { display: none; }
  .feed-media { aspect-ratio: 1/1; }
}

@media (max-width: 480px) {
  .feed-post-header { padding: 14px 14px 10px; }
  .feed-actions, .feed-like-count, .feed-caption,
  .feed-tags, .feed-comments-preview, .feed-book-cta { padding-left: 14px; padding-right: 14px; }
  .feed-comment-box { padding: 10px 14px 14px; }
}
