/* ============================================
   QUORA-STYLE SOCIAL APP — EDITORIAL DARK THEME
   Design: Deep navy + warm amber accent
   Font: Playfair Display (display) + DM Sans (body)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:          #0d0f14;
  --surface:     #141720;
  --surface-2:   #1c2030;
  --border:      #252a38;
  --accent:      #e8a020;
  --accent-dim:  #c88818;
  --accent-glow: rgba(232,160,32,0.15);
  --red:         #e05050;
  --red-dim:     rgba(224,80,80,0.12);
  --green:       #3ec97a;
  --text:        #e8eaf0;
  --text-2:      #8890a8;
  --text-3:      #555e78;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
  --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 60% 40% at 70% -10%, rgba(232,160,32,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 30% at 0% 80%, rgba(100,120,200,0.05) 0%, transparent 50%);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-dim); }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,15,20,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(16px, 4vw, 48px);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.02em;
}

.navbar-brand .brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232,160,32,0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(224,80,80,0.2);
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn-danger:hover {
  background: rgba(224,80,80,0.22);
  transform: translateY(-1px);
}

.btn-edit {
  background: rgba(100,120,220,0.12);
  color: #8090e0;
  border: 1px solid rgba(100,120,220,0.2);
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn-edit:hover {
  background: rgba(100,120,220,0.22);
  transform: translateY(-1px);
}

/* ── Page Layout ── */
.page-container {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 24px);
}

/* ── Page Header ── */
.page-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.page-header h1 span {
  color: var(--accent);
}

.post-count {
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* ── Post Card ── */
.posts-feed { display: flex; flex-direction: column; gap: 16px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition);
}

.post-card:hover {
  border-color: rgba(232,160,32,0.3);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-card:hover::before { opacity: 1; }

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

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #c04080);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

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

.post-username {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  display: block;
}

.post-handle {
  font-size: 0.78rem;
  color: var(--text-3);
}

.post-content {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 20px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: rgba(232,160,32,0.08);
  color: var(--accent);
  border: 1px solid rgba(232,160,32,0.18);
  transition: all var(--transition);
}
.btn-link:hover {
  background: rgba(232,160,32,0.18);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Delete form inline */
.post-actions form { margin: 0; }

/* ── Show Page ── */
.post-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
  margin-top: 8px;
}

.post-id-badge {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-3);
  font-family: 'DM Sans', monospace;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  margin-bottom: 24px;
  letter-spacing: 0.04em;
}

.post-detail-card .post-content-full {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  margin: 24px 0 32px;
  padding: 24px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-2);
  margin-bottom: 24px;
  transition: color var(--transition);
}
.back-link:hover { color: var(--accent); }

/* ── Form Pages ── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
}

.form-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.form-subtitle {
  color: var(--text-3);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

.form-group { margin-bottom: 24px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: all var(--transition);
  outline: none;
  resize: none;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: #161924;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-3);
}

.form-textarea { min-height: 140px; }

.edit-info {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.edit-info .avatar { width: 32px; height: 32px; font-size: 0.85rem; }

.edit-info-text { font-size: 0.85rem; color: var(--text-2); }
.edit-info-text strong { color: var(--text); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-3);
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state p { font-size: 1rem; margin-bottom: 24px; }

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .post-card { padding: 18px 20px; }
  .post-detail-card { padding: 22px; }
  .form-card { padding: 22px; }
  .post-actions { gap: 8px; }
  .navbar-brand { font-size: 1.2rem; }
}

/* ── Animations ── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card, .post-detail-card, .form-card {
  animation: fadeSlideIn 0.35s ease both;
}

.posts-feed .post-card:nth-child(1) { animation-delay: 0.05s; }
.posts-feed .post-card:nth-child(2) { animation-delay: 0.10s; }
.posts-feed .post-card:nth-child(3) { animation-delay: 0.15s; }
.posts-feed .post-card:nth-child(4) { animation-delay: 0.20s; }
.posts-feed .post-card:nth-child(5) { animation-delay: 0.25s; }
