/* ============================================================
   TRENDTER — App Styles (Phase 2 additions)
   assets/css/app.css  —  loaded on authenticated pages only
   ============================================================ */

/* ══════════════════════════════════════════════════════════ */
/*  POST COMPOSER                                            */
/* ══════════════════════════════════════════════════════════ */

.composer {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 0;
}

.composer-inner {
  display: flex;
  gap: 14px;
}

.composer-body {
  flex: 1;
  min-width: 0;
}

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  resize: none;
  min-height: 80px;
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}
.composer-textarea::placeholder { color: var(--text3); }

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.composer-tools {
  display: flex;
  gap: 2px;
}

.composer-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.composer-tool-btn:hover { background: var(--accent-bg); }

.composer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.char-counter {
  font-size: 14px;
  color: var(--text3);
  font-weight: 600;
  position: relative;
}
.char-counter.warning { color: var(--warning); }
.char-counter.danger  { color: var(--danger); }

/* Circular progress for char counter */
.char-ring {
  width: 28px;
  height: 28px;
  transform: rotate(-90deg);
}
.char-ring-bg   { fill: none; stroke: var(--border); stroke-width: 2.5; }
.char-ring-fill { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dashoffset 0.2s, stroke 0.2s; }

/* Emoji picker trigger */
.emoji-btn { font-size: 20px; }

/* ══════════════════════════════════════════════════════════ */
/*  POST CARDS (enhanced)                                    */
/* ══════════════════════════════════════════════════════════ */

.post-card {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  transition: background 0.12s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.post-card:hover { background: rgba(255,255,255,0.02); text-decoration: none; }

.post-card-inner { display: flex; gap: 14px; }

.post-card-body { flex: 1; min-width: 0; }

.post-card-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.post-author-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  transition: color 0.15s;
}
.post-author-name:hover { color: var(--accent); text-decoration: underline; }

.post-author-handle { color: var(--text3); font-size: 14px; }
.post-dot  { color: var(--text3); font-size: 14px; }
.post-time { color: var(--text3); font-size: 14px; }

.post-verified { color: var(--accent); font-size: 13px; }

.post-content {
  font-size: 15px;
  line-height: 1.7;
  word-break: break-word;
  white-space: pre-wrap;
  color: var(--text);
}
.post-content .hashtag {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.post-content .hashtag:hover { text-decoration: underline; }
.post-content .mention {
  color: #60a5fa;
  font-weight: 600;
  cursor: pointer;
}
.post-content .mention:hover { text-decoration: underline; }
.post-content .link-in-text {
  color: var(--accent);
  text-decoration: underline;
  word-break: break-all;
}

/* Link preview card */
.link-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
  cursor: pointer;
}
.link-preview:hover { border-color: var(--border2); }
.link-preview-body  { padding: 14px; }
.link-preview-domain { font-size: 12px; color: var(--text3); margin-bottom: 4px; }
.link-preview-title  { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.link-preview-desc   { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* Quote post */
.quote-post {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.quote-post:hover { border-color: var(--border2); }
.quote-post-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.quote-post-name   { font-weight: 700; font-size: 14px; }
.quote-post-handle { color: var(--text3); font-size: 13px; }
.quote-post-text   { font-size: 14px; color: var(--text2); line-height: 1.6; }

/* Repost indicator */
.repost-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 4px;
  padding: 0 20px;
  padding-top: 12px;
}
.repost-indicator a { color: var(--text3); font-weight: 600; }
.repost-indicator a:hover { color: var(--accent); text-decoration: underline; }

/* Post actions */
.post-actions {
  display: flex;
  gap: 0;
  margin-top: 12px;
  margin-left: -10px;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 50px;
  font-size: 14px;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  transition: color 0.15s, background 0.15s;
  min-width: 60px;
}
.post-action .action-count { font-size: 13px; font-weight: 500; min-width: 20px; }

.post-action:hover.like-btn     { color: #f87171; background: rgba(248,113,113,0.1); }
.post-action:hover.comment-btn  { color: #60a5fa; background: rgba(96,165,250,0.1); }
.post-action:hover.repost-btn   { color: #4ade80; background: rgba(74,222,128,0.1); }
.post-action:hover.share-btn    { color: var(--accent); background: var(--accent-bg); }

.post-action.liked    { color: #f87171; }
.post-action.reposted { color: #4ade80; }

.post-action.liked .action-icon::before    { content: '❤️'; }
.post-action:not(.liked) .like-icon::before { content: '🤍'; }

/* Three-dot menu */
.post-menu-btn {
  margin-left: auto;
  padding: 7px 10px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.15s;
  opacity: 0;
}
.post-card:hover .post-menu-btn { opacity: 1; }
.post-menu-btn:hover { color: var(--accent); background: var(--accent-bg); }

/* ══════════════════════════════════════════════════════════ */
/*  FEED                                                     */
/* ══════════════════════════════════════════════════════════ */

.feed-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.feed-tab {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-head);
  position: relative;
  transition: color 0.15s;
}
.feed-tab.active { color: var(--text); }
.feed-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.feed-tab:hover { color: var(--text); background: rgba(255,255,255,0.02); }

.feed-loading {
  display: flex;
  justify-content: center;
  padding: 32px;
}
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.feed-end {
  text-align: center;
  padding: 32px 20px;
  color: var(--text3);
  font-size: 14px;
}

.feed-empty {
  text-align: center;
  padding: 64px 24px;
}
.feed-empty-icon { font-size: 52px; margin-bottom: 16px; }
.feed-empty-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.feed-empty-desc  { font-size: 15px; color: var(--text2); line-height: 1.6; }

/* New posts banner */
.new-posts-banner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  background: var(--accent-bg);
  border-bottom: 1px solid rgba(242,226,0,0.2);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.new-posts-banner:hover { background: rgba(242,226,0,0.15); }
.new-posts-banner.visible { display: flex; }

/* ══════════════════════════════════════════════════════════ */
/*  PROFILE PAGE                                             */
/* ══════════════════════════════════════════════════════════ */

.profile-cover {
  height: 200px;
  background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
  position: relative;
  overflow: hidden;
}
.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-cover-default {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 50%, rgba(242,226,0,0.1) 100%);
}

.profile-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -48px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  object-fit: cover;
  background: var(--bg4);
  flex-shrink: 0;
}

.profile-actions { display: flex; gap: 10px; padding-top: 8px; flex-wrap: wrap; }

.profile-names { margin-bottom: 12px; }
.profile-display-name {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-username { color: var(--text3); font-size: 15px; margin-top: 2px; }

.profile-bio {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: var(--text3);
  margin-bottom: 14px;
}
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-meta a { color: var(--accent); }
.profile-meta a:hover { text-decoration: underline; }

.profile-stats {
  display: flex;
  gap: 24px;
  font-size: 15px;
}
.profile-stat {
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: baseline;
}
.profile-stat:hover .ps-label { color: var(--text); }
.ps-num   { font-weight: 800; color: var(--text); }
.ps-label { color: var(--text3); }

/* Follow button states */
.btn-follow      { background: var(--text); color: var(--bg); }
.btn-follow:hover { background: #ddd; }
.btn-following   { background: transparent; color: var(--text); border: 1.5px solid var(--border2); }
.btn-following:hover { border-color: var(--danger); color: var(--danger); }
.btn-following:hover::after { content: 'Unfollow'; position: absolute; }

/* Profile tabs */
.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.profile-tab {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-head);
  position: relative;
  transition: color 0.15s;
  max-width: 120px;
}
.profile-tab.active { color: var(--text); }
.profile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ══════════════════════════════════════════════════════════ */
/*  SINGLE POST PAGE                                         */
/* ══════════════════════════════════════════════════════════ */

.single-post {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.single-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.single-post-user { flex: 1; }
.single-post-name {
  font-weight: 800;
  font-size: 17px;
}
.single-post-handle { color: var(--text3); font-size: 14px; }

.single-post-content {
  font-size: 22px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.single-post-time {
  font-size: 14px;
  color: var(--text3);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.single-post-counts {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.spc-item strong { font-weight: 800; }
.spc-item span   { color: var(--text3); }

.single-post-actions {
  display: flex;
  justify-content: space-around;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

/* Comments section */
.comments-section { }
.comments-header {
  padding: 16px 20px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 17px;
  border-bottom: 1px solid var(--border);
}
.comment-composer {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
}
.comment-input {
  flex: 1;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 10px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.comment-input:focus { border-color: var(--accent); }
.comment-input::placeholder { color: var(--text3); }

/* ══════════════════════════════════════════════════════════ */
/*  RIGHT SIDEBAR WIDGETS                                    */
/* ══════════════════════════════════════════════════════════ */

.widget-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
}
.widget-item:last-child { border-bottom: none; }
.widget-item:hover { background: var(--bg3); }

/* Trending widget */
.trend-rank  { font-size: 12px; color: var(--text3); margin-bottom: 2px; }
.trend-tag   { font-weight: 700; font-size: 15px; }
.trend-count { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* Who to follow widget */
.wtf-user { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.wtf-user:last-child { border-bottom: none; }
.wtf-info  { flex: 1; min-width: 0; }
.wtf-name  { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtf-handle{ font-size: 13px; color: var(--text3); }

/* Search widget */
.search-bar-wrap {
  padding: 12px 16px;
}
.search-bar {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 10px 18px 10px 40px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.search-bar:focus  { border-color: var(--accent); background: var(--bg4); }
.search-bar-outer  { position: relative; }
.search-bar-icon   {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 16px;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════ */
/*  NOTIFICATIONS DOT                                        */
/* ══════════════════════════════════════════════════════════ */

.notif-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
}

/* ══════════════════════════════════════════════════════════ */
/*  RESPONSIVE ADDITIONS                                      */
/* ══════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .right-sidebar { display: none; }
  .app-layout    { grid-template-columns: var(--sidebar-w) 1fr; }
}

@media (max-width: 768px) {
  .composer-textarea { font-size: 16px; }
  .single-post-content { font-size: 18px; }
  .profile-cover { height: 140px; }
  .profile-avatar { width: 76px; height: 76px; border-width: 3px; margin-top: -38px; }
  .profile-display-name { font-size: 19px; }
}

@media (max-width: 480px) {
  .post-card  { padding: 14px 16px; }
  .single-post { padding: 16px; }
  .profile-header { padding: 0 16px 16px; }
  .profile-stats { gap: 16px; font-size: 14px; }
  .profile-actions { gap: 8px; }
}
