/* ============================================
   BOR COMMUNITY CANADA — FEED PAGE
   Designed by Achiek Kuol
   ============================================ */

/* --- CONTAINER --- */
.feed-container {
  padding-top: 36px;
  padding-bottom: 60px;
}

/* --- LAYOUT --- */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

/* --- COMPOSER --- */
.feed-composer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.composer-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.composer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--light-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--mid-gray);
  flex-shrink: 0;
}

.composer-input-wrap { flex: 1; }

.composer-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--off-white);
  cursor: pointer;
  transition: var(--transition);
}

.composer-input:hover {
  border-color: var(--primary);
  background: var(--white);
}

.composer-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-light);
  padding: 10px 14px;
  background: #fffbeb;
  border-radius: var(--radius-sm);
  border: 1px solid #fde68a;
}

.composer-note i { color: #d97706; flex-shrink: 0; }

/* --- FEED POSTS --- */
.feed-post {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.feed-post:hover {
  box-shadow: var(--shadow);
}

/* PINNED POST */
.feed-post.pinned {
  border-color: var(--accent);
  border-width: 2px;
}

.pinned-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  font-size: 0.78rem;
  font-weight: 700;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
}

.pinned-label i { color: #d97706; }

/* POST HEADER */
.feed-post-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 0;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-avatar {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)) !important;
  border: 2px solid var(--accent);
}

.post-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.post-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.post-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
}

.post-location, .post-time {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-location i, .post-time i {
  font-size: 0.7rem;
  color: var(--primary);
}

/* POST BODY */
.feed-post-body {
  padding: 16px 20px;
}

.feed-post-body p {
  font-size: 0.92rem;
  color: var(--dark-gray);
  line-height: 1.7;
  margin-bottom: 10px;
}

.feed-post-body p:last-child { margin-bottom: 0; }

.post-link {
  color: var(--primary);
  font-weight: 600;
  transition: var(--transition);
}

.post-link:hover { color: var(--primary-light); }

/* POST IMAGE PLACEHOLDER */
.post-image-placeholder {
  margin-top: 14px;
  background: linear-gradient(135deg, var(--light-gray), var(--border));
  border-radius: var(--radius-sm);
  height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--mid-gray);
  font-size: 0.85rem;
}

.post-image-placeholder i { font-size: 2.5rem; }

/* POST STATS */
.feed-post-stats {
  display: flex;
  gap: 20px;
  padding: 0 20px;
  font-size: 0.82rem;
  color: var(--text-light);
}

.feed-post-stats span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.feed-post-stats i { color: var(--mid-gray); }

/* POST ACTIONS */
.feed-post-actions {
  display: flex;
  border-top: 1px solid var(--light-gray);
  margin: 14px 20px 0;
  padding-top: 4px;
}

.post-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  background: none;
  border: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  border-radius: var(--radius-sm);
}

.post-action-btn:hover {
  background: var(--off-white);
  color: var(--primary);
}

.post-action-btn.liked {
  color: #dc2626;
}

.post-action-btn.liked i { color: #dc2626; }

.post-action-btn i { font-size: 0.9rem; }

/* --- COMMENTS --- */
.post-comments {
  padding: 0 20px 16px;
  border-top: 1px solid var(--light-gray);
  margin-top: 0;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--light-gray);
}

.comment-item:last-of-type { border-bottom: none; }

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-content { flex: 1; }

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.comment-city {
  font-size: 0.72rem;
  color: var(--text-light);
}

.comment-time {
  font-size: 0.72rem;
  color: var(--mid-gray);
}

.comment-content p {
  font-size: 0.85rem;
  color: var(--dark-gray);
  line-height: 1.55;
  margin-bottom: 6px;
}

.comment-actions {
  display: flex;
  gap: 14px;
}

.comment-like, .comment-reply {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font);
  transition: var(--transition);
}

.comment-like:hover { color: #dc2626; }
.comment-reply:hover { color: var(--primary); }

.view-more-comments {
  display: block;
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  font-family: var(--font);
  transition: var(--transition);
  text-align: center;
  border-radius: var(--radius-sm);
}

.view-more-comments:hover {
  background: var(--off-white);
}

/* --- LOAD MORE --- */
.feed-load-more {
  text-align: center;
  padding: 20px 0;
}

/* --- SIDEBAR --- */
.feed-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

/* JOIN CARD */
.sidebar-join-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--white);
}

.sidebar-join-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--accent);
  margin: 0 auto 14px;
}

.sidebar-join-card h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.sidebar-join-card p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.78);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* SIDEBAR WIDGET */
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--light-gray);
}

.sidebar-widget h4 i { color: var(--primary); }

/* WIDGET EVENT */
.widget-event {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--light-gray);
}

.widget-event:last-of-type { border-bottom: none; }

.we-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 48px;
  flex-shrink: 0;
}

.we-month {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-light);
}

.we-day {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.we-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.we-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.we-detail {
  font-size: 0.75rem;
  color: var(--text-light);
}

.widget-link {
  display: block;
  text-align: center;
  padding-top: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.widget-link:hover { color: var(--primary-light); }

/* WIDGET FUNDRAISER */
.widget-fundraiser {
  padding: 4px 0;
}

.wf-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  margin-bottom: 10px;
}

.wf-progress { margin-bottom: 4px; }

.wf-progress-bar {
  height: 8px;
  background: var(--light-gray);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 6px;
}

.wf-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 50px;
  transition: width 1s ease;
}

.wf-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* WIDGET STATS */
.widget-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ws-item {
  text-align: center;
  padding: 10px 4px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
}

.ws-number {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.ws-label {
  display: block;
  font-size: 0.68rem;
  color: var(--text-light);
  font-weight: 500;
}

/* GUIDELINES */
.sidebar-widget.guidelines {
  background: var(--off-white);
}

.guideline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guideline-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--dark-gray);
  line-height: 1.5;
}

.guideline-list i {
  color: var(--primary);
  margin-top: 3px;
  flex-shrink: 0;
  font-size: 0.72rem;
}

/* --- FEED RESPONSIVE --- */
@media (max-width: 1024px) {
  .feed-layout {
    grid-template-columns: 1fr 280px;
  }
}

@media (max-width: 768px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    position: static;
    order: -1;
  }

  .sidebar-join-card { display: block; }

  .sidebar-widget {
    display: none;
  }

  .sidebar-widget.guidelines {
    display: block;
    order: 10;
  }
}

@media (max-width: 480px) {
  .feed-post-header { padding: 16px 16px 0; }
  .feed-post-body { padding: 12px 16px; }
  .feed-post-stats { padding: 0 16px; }
  .feed-post-actions { margin: 10px 16px 0; }
  .post-comments { padding: 0 16px 14px; }
  .post-image-placeholder { height: 180px; }
}

/* --- ENHANCED COMPOSER --- */
.composer-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--light-gray);
}

.composer-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dark-gray);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.composer-action-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.composer-action-btn i { font-size: 0.85rem; }

/* --- COMPOSE MODAL --- */
.compose-modal { max-width: 520px; }

.compose-modal .modal-body { padding: 24px; }

.compose-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--light-gray);
}

.compose-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.compose-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.compose-avatar.small-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.75rem;
}

.compose-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compose-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.compose-city {
  font-size: 0.75rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.compose-city i { color: var(--primary); font-size: 0.68rem; }

.compose-textarea {
  width: 100%;
  border: none;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.7;
  margin-bottom: 16px;
}

.compose-textarea::placeholder { color: var(--mid-gray); }

.compose-attachments {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--light-gray);
}

.compose-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dark-gray);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.compose-attach-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.compose-privacy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.compose-privacy i { color: var(--primary); }

/* --- COMMENT MODAL --- */
.comment-modal { max-width: 480px; }

.comment-modal .modal-body { padding: 24px; }

.comment-modal h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 18px;
}

.comment-compose {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comment-input-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: var(--font);
  color: var(--text);
  resize: none;
  transition: var(--transition);
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}

/* --- NEW POST (added dynamically) --- */
.feed-post.new-post {
  border-color: var(--primary);
  animation: newPostSlide 0.5s ease;
}

@keyframes newPostSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.new-post-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff3cd;
  color: #856404;
  margin-bottom: 8px;
}

/* --- NEW COMMENT (added dynamically) --- */
.comment-item.new-comment {
  animation: newPostSlide 0.3s ease;
  background: #f0fdf4;
  margin: 0 -12px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
}

/* --- MODAL SHARED --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  border: none;
  color: var(--dark-gray);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: var(--transition);
}

.modal-close:hover { background: rgba(0,0,0,0.15); }