/* css/feed.css - Homepage, Navigation, Sidebars & Feed Layout */

/* Sticky Top Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background-color: var(--win-grey);
  border-bottom: 2px solid var(--win-darker);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  height: 54px;
}

.app-header-inner {
  max-width: 1320px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--win-navy);
  flex-shrink: 0;
}

.header-brand-icon {
  width: 30px;
  height: 30px;
  background: var(--win-navy);
  color: var(--win-white);
  border-top: 2px solid #6D8CE8;
  border-left: 2px solid #6D8CE8;
  border-right: 2px solid var(--win-black);
  border-bottom: 2px solid var(--win-black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.header-brand-text {
  font-size: 17px;
  font-weight: bold;
  letter-spacing: 0.7px;
}

/* Header Search Bar & Live Results Dropdown */
.header-search-wrap {
  position: relative;
  flex: 1;
  max-width: 440px;
}

.header-search-box {
  display: flex;
  align-items: center;
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-darker);
  padding: 0 8px;
}

.header-search-box i {
  color: var(--win-dark);
  font-size: 13px;
}

.header-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-system);
  font-size: 13px;
  padding: 6px 8px;
  color: var(--win-black);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: none;
  z-index: 950;
  max-height: 340px;
  overflow-y: auto;
}

.search-dropdown.open {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--win-black);
  border-bottom: 1px solid var(--win-light);
  background: var(--win-white);
  gap: 10px;
}

.search-result-item:hover {
  background: var(--win-navy);
  color: var(--win-white);
}

.search-result-item:hover .text-muted {
  color: #D0D8FF;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 15px;
}

.nav-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--win-danger);
  color: var(--win-white);
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border: 1px solid var(--win-white);
  line-height: 1.2;
  display: none;
}

.nav-badge.visible {
  display: inline-block;
}

.header-profile-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px 3px 4px;
  text-decoration: none;
  color: var(--win-black);
}

/* Avatars */
.avatar-sm,
.avatar-md,
.avatar-lg {
  object-fit: cover;
  background-color: var(--win-teal);
  color: var(--win-white);
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--win-dark);
  border-left: 1px solid var(--win-dark);
  border-right: 1px solid var(--win-white);
  border-bottom: 1px solid var(--win-white);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.avatar-md {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 18px;
}

.avatar-sm img,
.avatar-md img,
.avatar-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Three-Column App Shell */
.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.sidebar-sticky {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Left Sidebar Navigation */
.nav-menu-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--win-black);
  font-size: 13px;
  font-weight: bold;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  width: 100%;
  font-family: var(--font-system);
  text-align: left;
}

.nav-menu-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-menu-link i {
  width: 18px;
  text-align: center;
  color: var(--win-navy);
  font-size: 14px;
}

.nav-menu-link:hover {
  background-color: var(--win-light);
  border-top: 1px solid var(--win-white);
  border-left: 1px solid var(--win-white);
  border-right: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-dark);
}

.nav-menu-link.active {
  background-color: var(--win-navy);
  color: var(--win-white);
}

.nav-menu-link.active i {
  color: var(--win-white);
}

.sidebar-pill {
  background: var(--win-danger);
  color: var(--win-white);
  font-size: 11px;
  padding: 1px 6px;
  font-weight: bold;
  display: none;
}

.sidebar-pill.visible {
  display: inline-block;
}

/* Mini User Card in Left Sidebar */
.sidebar-user-box {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--win-dark);
  background: var(--win-light);
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-weight: bold;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-handle {
  font-size: 12px;
  color: var(--win-darker);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center Feed Column */
.feed-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.composer-body {
  padding: 12px;
}

.composer-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.composer-textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  font-family: var(--font-system);
  font-size: 14px;
  padding: 8px 10px;
  background: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-darker);
  outline: none;
}

.composer-textarea:focus {
  background: #FFFFF5;
}

.composer-preview-wrap {
  margin-top: 10px;
  position: relative;
  display: none;
  background: var(--win-black);
  border: 2px inset var(--win-dark);
  max-height: 320px;
  overflow: hidden;
  text-align: center;
}

.composer-preview-wrap.has-image {
  display: block;
}

.composer-preview-wrap img {
  max-width: 100%;
  max-height: 316px;
  object-fit: contain;
}

.composer-remove-img {
  position: absolute;
  top: 8px;
  right: 8px;
}

.composer-toolbar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--win-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Feed Filter Tabs */
.feed-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 8px 0;
  background: var(--win-grey);
  border-bottom: 2px solid var(--win-white);
}

.feed-tab-btn {
  padding: 6px 14px;
  font-family: var(--font-system);
  font-size: 13px;
  font-weight: bold;
  background: var(--win-light);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: none;
  cursor: pointer;
  color: var(--win-darker);
}

.feed-tab-btn.active {
  background: var(--win-grey);
  color: var(--win-navy);
  position: relative;
  top: 2px;
  padding-bottom: 8px;
}

/* Right Sidebar Widgets */
.widget-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--win-light);
}

.user-row-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.user-row-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: var(--win-black);
  flex: 1;
}

.user-row-text {
  min-width: 0;
}

.user-row-name {
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row-name:hover {
  text-decoration: underline;
  color: var(--win-navy);
}

.user-row-sub {
  font-size: 11px;
  color: var(--win-darker);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.win-btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.online-dot {
  width: 9px;
  height: 9px;
  background-color: #00A800;
  border: 1px solid var(--win-black);
  display: inline-block;
  flex-shrink: 0;
}

.popular-post-mini {
  display: block;
  text-decoration: none;
  color: var(--win-black);
  background: var(--win-light);
  padding: 7px 9px;
  border: 1px solid var(--win-dark);
}

.popular-post-mini:hover {
  background: var(--win-white);
}

.popular-post-snippet {
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.popular-post-meta {
  font-size: 11px;
  color: var(--win-navy);
  font-weight: bold;
}

.empty-state-box {
  text-align: center;
  padding: 20px 12px;
  color: var(--win-darker);
  font-size: 13px;
}

.text-muted {
  color: var(--win-darker);
  font-size: 12px;
}

/* Mobile Bottom Taskbar Navigation (Hidden on Desktop) */
.mobile-bottom-nav {
  display: none;
}

/* ==========================================
   PHASE 3: POST CARDS, MEDIA & COMMENTS
   ========================================== */

.post-card {
  background-color: var(--win-white);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-darker);
}

.post-card-header {
  background-color: var(--win-light);
  border-bottom: 1px solid var(--win-dark);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.post-author-link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--win-black);
  min-width: 0;
}

.post-author-name {
  font-weight: bold;
  font-size: 13px;
  color: var(--win-navy);
}

.post-author-name:hover {
  text-decoration: underline;
}

.post-timestamp {
  font-size: 11px;
  color: var(--win-darker);
}

.post-owner-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.post-body-text {
  padding: 12px 12px 10px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--win-black);
}

.post-edit-box {
  padding: 10px 12px;
  background: var(--win-light);
  border-bottom: 1px solid var(--win-dark);
}

/* Post Image & Double-Click Heart Animation */
.post-media-container {
  position: relative;
  background-color: #111111;
  border-top: 1px solid var(--win-dark);
  border-bottom: 1px solid var(--win-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 520px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.post-media-container img {
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}

.dblclick-heart-overlay {
  position: absolute;
  font-size: 68px;
  color: #FF2E4C;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.18s ease, transform 0.25s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

.dblclick-heart-overlay.burst {
  opacity: 1;
  transform: scale(1.1);
}

/* Post Stats & Action Bar */
.post-stats-bar {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--win-darker);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--win-light);
  background: #FAFAFA;
}

.post-actions-bar {
  padding: 7px 10px;
  background-color: var(--win-grey);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.post-actions-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.post-action-btn.liked {
  color: var(--win-danger);
}

.post-action-btn.saved {
  color: var(--win-navy);
  background-color: var(--win-light);
}

/* Comments & Replies Section */
.post-comments-section {
  background-color: var(--win-light);
  border-top: 1px solid var(--win-dark);
  padding: 10px 12px;
  display: none;
}

.post-comments-section.open {
  display: block;
}

.comment-form {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-item {
  background: var(--win-white);
  border: 1px solid var(--win-dark);
  padding: 7px 9px;
}

.comment-reply-item {
  margin-left: 24px;
  margin-top: 6px;
  background: #F7F7F7;
  border-left: 3px solid var(--win-navy);
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
}

.comment-author {
  font-weight: bold;
  font-size: 12px;
  color: var(--win-navy);
  text-decoration: none;
}

.comment-author:hover {
  text-decoration: underline;
}

.comment-text {
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 5px;
}

.comment-meta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--win-darker);
}

.comment-mini-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  color: var(--win-navy);
  cursor: pointer;
}

.comment-mini-btn:hover {
  text-decoration: underline;
}

.comment-mini-btn.liked {
  color: var(--win-danger);
}

.reply-form-box {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

/* ConnectClick social extensions — Windows 95 friendly */
.cc-hashtag, .cc-mention { color: #0000aa; font-weight: bold; text-decoration: underline; }
.cc-inline-link { color: #000080; text-decoration: underline; overflow-wrap: anywhere; }
.cc-link-preview { display: flex; gap: 10px; margin: 10px 0; color: #111; text-decoration: none; background: #eee; border: 2px outset #fff; padding: 7px; min-width: 0; }
.cc-link-preview:hover { background: #e2e2e2; }
.cc-link-preview > img { width: 112px; max-height: 90px; object-fit: cover; border: 1px solid #777; }
.cc-link-preview-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.cc-link-preview-copy strong { color: #000080; }
.cc-link-preview-copy span { font-size: 12px; }
.cc-link-preview-copy small { color: #555; }
.cc-composer-link-preview { margin: 8px 0; }
.cc-composer-link-preview:empty { display: none; }
.cc-mention-suggestions { position: absolute; z-index: 1000; left: 0; top: 100%; min-width: 210px; max-width: 100%; background: #c0c0c0; border: 2px outset #fff; box-shadow: 2px 2px 0 #333; }
.cc-mention-suggestions[hidden] { display: none; }
.cc-mention-option { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; padding: 7px 9px; background: transparent; color: #111; cursor: pointer; }
.cc-mention-option:hover { color: #fff; background: #000080; }
.cc-mention-option small { font-size: 10px; }
.cc-repost-original { margin: 10px 0; padding: 10px; background: #eee; border: 2px inset #ddd; }
.cc-repost-original p { margin: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-repost-original img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; margin-top: 8px; }
@media (max-width: 600px) { .cc-link-preview { flex-direction: column; } .cc-link-preview > img { width: 100%; max-height: 150px; } }
