/* ============
   FEED PAGE
   ============ */

.feed-page {
  min-height: 100vh;
  background: var(--bg);
}

.feed-header {
  background: var(--fg);
  color: var(--bg);
  padding: 60px 32px;
}

.feed-header-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.feed-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  color: var(--bg);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.feed-sub {
  font-size: 18px;
  color: rgba(248,240,232,0.6);
  line-height: 1.6;
}

/* Layout */
.feed-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 900px) {
  .feed-layout {
    grid-template-columns: 1fr;
    padding: 32px 20px;
  }
}

/* ============
   CREATE PANEL
   ============ */

.create-panel {
  position: sticky;
  top: 88px;
}

.create-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.create-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.create-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.create-identity {
  flex: 1;
}

.create-username {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  padding: 0;
  outline: none;
}

.create-username::placeholder {
  color: var(--fg-muted);
  font-weight: 400;
}

.create-hint {
  font-size: 11px;
  color: var(--fg-muted);
  display: block;
  margin-top: 2px;
}

.create-title-input,
.create-text-input,
.create-tags-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 12px 14px;
  resize: none;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  line-height: 1.6;
}

.create-title-input {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
}

.create-text-input {
  margin-bottom: 10px;
}

.create-tags-row {
  margin-bottom: 16px;
}

.create-tags-input {
  font-size: 13px;
}

.create-title-input:focus,
.create-text-input:focus,
.create-tags-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 98, 58, 0.1);
}

.create-title-input::placeholder,
.create-text-input::placeholder,
.create-tags-input::placeholder {
  color: var(--fg-muted);
}

.create-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.create-char-count {
  font-size: 12px;
  color: var(--fg-muted);
}

.btn-create {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.btn-create:hover:not(:disabled) {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.btn-create:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============
   MOMENTS PANEL
   ============ */

.moments-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feed-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-muted);
  font-size: 16px;
  font-style: italic;
}

/* ============
   MOMENT CARD
   ============ */

.moment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
}

.moment-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.moment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.moment-author-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.moment-avatar-sm {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}

.moment-author-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
}

.moment-culture {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.moment-time {
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
}

.moment-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}

.moment-text {
  font-size: 15px;
  color: var(--fg);
  line-height: 1.7;
  margin-bottom: 16px;
}

.moment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.moment-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: rgba(212, 98, 58, 0.08);
  border: 1px solid rgba(212, 98, 58, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

.moment-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reaction-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
}

.moment-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.action-btn:hover {
  background: var(--bg-alt);
  color: var(--fg);
}

.action-btn svg {
  flex-shrink: 0;
}

.comment-count {
  font-size: 12px;
  color: var(--fg-muted);
}

/* Reaction Picker */
.reaction-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.reaction-emoji {
  font-size: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.reaction-emoji:hover {
  background: var(--bg-alt);
  transform: scale(1.15);
  box-shadow: var(--shadow);
}

/* ============
   COMMENT MODAL
   ============ */

.comment-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.comment-modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.comment-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
}

.comment-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
  line-height: 1;
}

.comment-modal-close:hover {
  background: var(--bg-alt);
}

.comment-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.comment-moment-meta {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.comment-moment-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
}

.comment-moment-author {
  font-size: 12px;
  color: var(--fg-muted);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 4px;
}

.comment-text {
  font-size: 14px;
  color: var(--fg);
  line-height: 1.6;
  margin-bottom: 4px;
}

.comment-time {
  font-size: 11px;
  color: var(--fg-muted);
}

.comment-empty {
  font-size: 14px;
  color: var(--fg-muted);
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.comment-compose {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.2s ease;
}

.comment-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 98, 58, 0.1);
}

.comment-input::placeholder {
  color: var(--fg-muted);
}

.btn-comment-submit {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-comment-submit:hover {
  background: var(--accent-deep);
}

/* Nav link in header */
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 600px) {
  .feed-layout { padding: 24px 16px; }
  .moment-card { padding: 18px; }
  .create-panel { position: static; }
  .comment-modal-content { max-height: 90vh; }
  .moment-footer { flex-direction: column; align-items: flex-start; }
}