/* css/feed.css */

/* ════════════════════════════════════════════════
   FEED TAB SHELL
   ════════════════════════════════════════════════ */
.feed-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* ── Header ── */
.feed-header { flex-shrink: 0; }

.fh-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(8,13,26,0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.fh-lang-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 14px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
}

.fh-lang-btn:hover { background: rgba(255,255,255,0.12); }

.fh-notif-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.18s;
}

.fh-notif-btn:hover { background: rgba(255,255,255,0.12); }

/* ── Tab bar ── */
.feed-tabbar { flex-shrink: 0; padding: 8px 16px; }

.ftb-inner {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 4px;
}

.ftb-btn {
  flex: 1;
  padding: 9px 8px;
  border: none; background: transparent;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.ftb-btn.active {
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  font-weight: 700;
}

/* ── Body ── */
.feed-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}

/* ── Loading / Empty ── */
.feed-loading {
  display: flex; justify-content: center; align-items: center;
  padding: 60px 0;
}

.feed-spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.feed-empty {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 52px 24px; gap: 10px;
}

.feed-empty-icon { font-size: 52px; }
.feed-empty h3   { font-family:'Sora',sans-serif; font-size:18px; font-weight:700; }
.feed-empty p    { color: var(--muted); font-size:14px; line-height:1.5; }

.feed-muted { color: var(--muted); font-size: 13px; padding: 16px 20px; }

.feed-action-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 11px 24px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}

/* ── FAB ── */
.feed-fab {
  position: absolute;
  bottom: 88px; right: 16px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 12px 22px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(123,92,255,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 5;
}

.feed-fab:hover  { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(123,92,255,0.5); }
.feed-fab:active { transform: translateY(0); }

/* ── Feed list ── */
.feed-list { padding: 8px 0; }

.saved-badge {
  display: inline-block;
  margin: 10px 16px 4px;
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 12px; font-weight: 700;
}

/* ════════════════════════════════════════════════
   POST CARD
   ════════════════════════════════════════════════ */
.post-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 8px 16px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.22s;
}

.post-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}

.pc-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}

.pc-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(59,130,246,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  color: #60a5fa;
  flex-shrink: 0;
}

.pc-avatar-ai { background: rgba(139,92,246,0.15); color: #a78bfa; }

.pc-author-info { flex: 1; }

.pc-author-row { display: flex; align-items: center; gap: 4px; }
.pc-author-name { font-weight: 700; font-size: 14px; }
.pc-verified    { flex-shrink: 0; }
.pc-meta        { font-size: 12px; color: var(--muted); }

.pc-type-badge {
  font-size: 13px;
  border-radius: 100px;
  padding: 4px 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.pc-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px; font-weight: 700;
  margin-bottom: 8px;
}

.pc-content {
  font-size: 14px; line-height: 1.6;
  color: rgba(240,244,255,0.85);
  margin-bottom: 12px;
}

.pc-image {
  width: 100%; border-radius: 12px;
  object-fit: cover; max-height: 200px;
  margin-bottom: 12px;
}

/* Word of day card */
.pc-word-card {
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(59,130,246,0.08));
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.pc-word-main   { font-size: 26px; font-weight: 800; color: #a78bfa; }
.pc-word-pron   { font-size: 13px; color: var(--muted); font-style: italic; margin: 4px 0 10px; }
.pc-word-meaning{ font-size: 14px; margin-bottom: 10px; }
.pc-word-example{ background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.pc-word-trans  { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* Actions */
.pc-actions {
  display: flex; gap: 4px; padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.pc-action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.pc-action-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.pc-action-btn.active { color: var(--blue); }

/* ════════════════════════════════════════════════
   POST DETAIL
   ════════════════════════════════════════════════ */
.pd-page {
  display: flex; flex-direction: column;
  height: 100%; background: var(--dark);
  overflow: hidden;
}

.pd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(8,13,26,0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.pd-back-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none;
  color: var(--blue);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s;
}

.pd-back-btn:hover { background: rgba(59,130,246,0.1); }

.pd-header-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px; font-weight: 700;
}

.pd-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}

.pd-post-content { padding: 20px 16px; }

.pd-author-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}

.pd-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(59,130,246,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #60a5fa;
  flex-shrink: 0;
}

.pd-avatar-ai { background: rgba(139,92,246,0.15); color: #a78bfa; }

.pd-author-name {
  display: flex; align-items: center; gap: 4px;
  font-weight: 700; font-size: 15px;
}

.pd-meta { font-size: 12px; color: var(--muted); }

.pd-title {
  font-family: 'Sora', sans-serif;
  font-size: 22px; font-weight: 800;
  margin-bottom: 12px; line-height: 1.3;
}

.pd-content { font-size: 15px; line-height: 1.65; color: rgba(240,244,255,0.9); }

.pd-image { width: 100%; border-radius: 14px; margin-top: 14px; }

.pd-divider { height: 8px; background: rgba(255,255,255,0.03); border-top: 1px solid var(--border); }

/* AI section */
.pd-ai-section { padding: 20px 16px; }

.pd-section-title {
  font-family: 'Sora', sans-serif;
  font-size: 17px; font-weight: 700;
  margin-bottom: 14px;
}

.pd-ai-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.pd-ai-btn {
  flex: 1; min-width: 140px;
  padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'DM Sans', sans-serif;
}

.pd-ai-btn:hover { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.35); }

.pd-ai-box {
  margin-top: 14px;
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 14px;
  padding: 14px 16px;
}

.pd-ai-box-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; font-size: 14px; color: #a78bfa;
  margin-bottom: 10px;
}

.pd-ai-close {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 2px 6px;
}

.pd-ai-text { font-size: 14px; line-height: 1.65; color: rgba(240,244,255,0.85); }

/* Comments */
.pd-comments-section { padding: 20px 16px; }

.pd-comment {
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  margin-bottom: 10px;
}

.pd-comment-ai { background: rgba(139,92,246,0.07); }
.pd-comment-correction { border-left: 3px solid #f97316; }

.pd-comment-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}

.pd-comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(59,130,246,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #60a5fa;
  flex-shrink: 0;
}

.pd-comment-name { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pd-correction-badge { font-size: 11px; color: #f97316; font-weight: 600; }
.pd-comment-text { font-size: 14px; line-height: 1.55; }

/* Comment input */
.pd-comment-input-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(8,13,26,0.9);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: sticky; bottom: 0;
}

.pd-comment-input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.18s;
}

.pd-comment-input:focus { border-color: rgba(255,255,255,0.25); }
.pd-comment-input::placeholder { color: var(--muted); }

.pd-comment-send {
  width: 40px; height: 40px;
  background: var(--blue);
  border: none; border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: opacity 0.18s;
  flex-shrink: 0;
}

.pd-comment-send:hover { opacity: 0.85; }
.pd-comment-send:disabled { opacity: 0.4; }

/* Practice modal */
.pd-practice-modal { max-width: 480px; }
.pd-practice-modal h3 { margin-bottom: 20px; font-family:'Sora',sans-serif; font-size:18px; font-weight:700; }

.pq-progress-bar { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.pq-progress-fill { height: 100%; background: linear-gradient(90deg,#7b5cff,#d056a0); border-radius: 3px; transition: width 0.3s; }
.pq-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pq-question { font-family:'Sora',sans-serif; font-size:17px; font-weight:700; margin-bottom:20px; line-height:1.4; }
.pq-sample { background: rgba(59,130,246,0.1); border-radius:10px; padding:10px 14px; font-size:13px; color:#60a5fa; margin-bottom:16px; }

.pq-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.pq-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: left;
  width: 100%;
}

.pq-option:hover:not(:disabled) { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.35); }
.pq-option:disabled { cursor: not-allowed; }
.pq-option.correct { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.5); }
.pq-option.wrong   { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.4); }

.pq-letter {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}

.pq-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px; line-height: 1.5;
  outline: none;
  resize: vertical;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.18s;
}

.pq-textarea:focus { border-color: rgba(255,255,255,0.25); }

.pq-footer { padding-top: 8px; }

.pq-score-card {
  display: inline-block;
  background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.25);
  border-radius: 12px; padding: 10px 20px;
  font-size: 15px; font-weight: 600; color: #60a5fa;
  margin: 12px 0;
}

.pq-xp { font-size: 20px; font-weight: 700; color: #eab308; margin-top: 8px; }

/* ════════════════════════════════════════════════
   CREATE POST
   ════════════════════════════════════════════════ */
.cp-page {
  display: flex; flex-direction: column;
  height: 100%; background: var(--dark);
}

.cp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(8,13,26,0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.cp-close-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s;
}

.cp-close-btn:hover { background: rgba(239,68,68,0.12); color: #fca5a5; }

.cp-header-title { font-family:'Sora',sans-serif; font-size:17px; font-weight:700; }

.cp-post-btn {
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 22px;
  font-family: 'Sora', sans-serif;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s;
}

.cp-post-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cp-body { flex: 1; overflow-y: auto; padding: 20px 16px; }

.cp-label {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  margin-bottom: 10px; margin-top: 20px;
}

.cp-label:first-child { margin-top: 0; }

.cp-types { display: flex; gap: 10px; margin-bottom: 4px; }

.cp-type-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
}

.cp-type-btn.active {
  background: color-mix(in srgb, var(--tc) 15%, transparent);
  border-color: color-mix(in srgb, var(--tc) 50%, transparent);
  color: var(--tc);
}

.cp-type-emoji { font-size: 22px; }
.cp-type-label { font-size: 12px; font-weight: 600; }

.cp-input, .cp-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 16px;
  color: var(--text);
  font-size: 14px; line-height: 1.55;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.18s;
}

.cp-input:focus, .cp-textarea:focus { border-color: rgba(255,255,255,0.28); }
.cp-input::placeholder, .cp-textarea::placeholder { color: var(--muted); }
.cp-textarea { resize: vertical; }

.cp-tips {
  margin-top: 24px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 14px;
  padding: 16px;
}

.cp-tips-header { font-weight: 700; color: #60a5fa; font-size: 13px; margin-bottom: 10px; }

.cp-tips-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}

.cp-tips-list li { font-size: 13px; color: #60a5fa; padding-left: 16px; position: relative; }
.cp-tips-list li::before { content: "✓"; position: absolute; left: 0; }

/* ════════════════════════════════════════════════
   USER CARD
   ════════════════════════════════════════════════ */
.user-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  margin: 6px 16px;
  padding: 14px 16px;
  transition: background 0.18s;
}

.user-card:hover { background: rgba(255,255,255,0.07); }

.uc-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(123,92,255,0.15), rgba(208,86,160,0.15));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #a78bfa;
  flex-shrink: 0;
}

.uc-info { flex: 1; min-width: 0; }

.uc-name-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.uc-name { font-weight: 700; font-size: 15px; }

.uc-badges { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }

.uc-level-badge { font-size: 11px; font-weight: 600; border-radius: 8px; padding: 2px 8px; }
.uc-streak      { font-size: 12px; color: var(--muted); }
.uc-bio         { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.uc-follow-btn {
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 8px 18px;
  font-family: 'Sora', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s;
}

.uc-follow-btn.following {
  background: none;
  border: 1px solid rgba(123,92,255,0.4);
  color: #a78bfa;
}

/* ════════════════════════════════════════════════
   FOLLOWING TAB
   ════════════════════════════════════════════════ */
.following-wrap { padding: 8px 0; }

.following-toggle {
  display: flex; gap: 10px;
  padding: 8px 16px 4px;
}

.ftgl-btn {
  padding: 9px 20px;
  background: rgba(255,255,255,0.05);
  border: none; border-radius: 100px;
  color: var(--muted);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  font-family: 'DM Sans', sans-serif;
}

.ftgl-btn.active {
  background: linear-gradient(135deg, #7b5cff, #d056a0);
  color: #fff;
}

.discover-search-wrap { padding: 8px 16px 4px; }

.discover-search {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 10px 18px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.18s;
}

.discover-search:focus { border-color: rgba(255,255,255,0.28); }
.discover-search::placeholder { color: var(--muted); }

/* ── Responsive ── */
@media (max-width: 400px) {
  .cp-types { gap: 6px; }
  .cp-type-btn { padding: 10px 4px; }
  .cp-type-label { font-size: 11px; }
  .post-card { margin: 6px 10px; }
  .user-card { margin: 6px 10px; }
}