/* ═══════════════════════════════════════════════════════
   Siyaasi — app.css  v1.1
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg-0:       #070810;
  --bg-1:       #0e0f1c;
  --bg-2:       #13142a;
  --bg-3:       #1a1b35;
  --border:     #232438;
  --text-0:     #f0f0ff;
  --text-1:     #c8c8e0;
  --text-2:     #9090b0;
  --text-3:     #5a5a7a;
  --accent:     #6c63ff;
  --accent-2:   #a78bfa;
  --accent-rgb: 108,99,255;
  --like-color: #f43f5e;
  --repost-color:#00ba7c;
  --gold:       #f5c842;
  --radius:     12px;
  --radius-sm:  8px;
  --sidebar-w:  260px;
  --max-w:      600px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--text-0);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: var(--max-w);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  padding: 20px 12px;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; gap: 4px; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 800;
  color: var(--text-0); text-decoration: none;
  padding: 8px 12px 16px;
}
.logo-s, .logo-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: var(--radius);
  font-size: .95rem; font-weight: 500;
  color: var(--text-1); text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
}
.sidebar-nav-item:hover { background: var(--bg-2); color: var(--text-0); }
.sidebar-nav-item.active { color: var(--accent); font-weight: 700; }
.sidebar-nav-item i { width: 22px; text-align: center; font-size: 1.05rem; }

.sidebar-compose-btn {
  margin: 12px 0;
  background: var(--accent);
  color: #fff; border: none;
  padding: 12px 20px; border-radius: 50px;
  font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  transition: opacity .15s, transform .1s;
}
.sidebar-compose-btn:hover { opacity: .9; transform: scale(1.02); }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: var(--radius);
  transition: background .15s; margin-top: auto;
}
.sidebar-user:hover { background: var(--bg-2); }
.sidebar-user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-weight: 600; font-size: .9rem; color: var(--text-0);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
}
.sidebar-user-handle { color: var(--text-3); font-size: .8rem; }

/* ── Top Bar (mobile) ───────────────────────────────────── */
.top-bar {
  display: none;
  align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(7,8,16,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.top-bar-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; }
.top-bar-actions { display: flex; gap: 4px; }
.top-bar-btn {
  background: none; border: none;
  color: var(--text-1); font-size: 1.1rem;
  padding: 8px 10px; border-radius: 50%; position: relative;
}
.top-bar-btn:hover { background: var(--bg-2); }

/* ── Bottom Nav (mobile) ─────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(7,8,16,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  justify-content: space-around;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; padding: 6px 16px; border-radius: var(--radius);
  color: var(--text-3); text-decoration: none;
  font-size: .65rem; font-weight: 500;
  position: relative; transition: color .15s;
}
.nav-item i { font-size: 1.2rem; }
.nav-item.active { color: var(--accent); }
.nav-badge {
  position: absolute; top: 4px; right: 8px;
  background: var(--like-color); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── FAB ─────────────────────────────────────────────────── */
.fab {
  display: none;
  position: fixed; bottom: calc(66px + max(8px, env(safe-area-inset-bottom))); right: 16px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 1.2rem; box-shadow: 0 4px 20px rgba(108,99,255,.45);
  align-items: center; justify-content: center;
  z-index: 190; transition: transform .15s, box-shadow .15s;
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(108,99,255,.6); }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  position: sticky; top: 0; z-index: 90;
  background: rgba(7,8,16,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.btn-back {
  background: none; border: none;
  color: var(--text-1); font-size: 1.1rem;
  padding: 6px 8px; border-radius: 50%;
  display: flex; align-items: center;
}
.btn-back:hover { background: var(--bg-2); color: var(--text-0); }
.page-title { font-weight: 800; font-size: 1.1rem; }
.page-subtitle { color: var(--text-3); font-size: .8rem; }

/* ── Tabs ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 80;
  background: var(--bg-0);
}
.tab-item {
  flex: 1; padding: 14px;
  background: none; border: none;
  color: var(--text-2); font-weight: 600; font-size: .9rem;
  text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s;
  border-bottom: 2px solid transparent;
}
.tab-item:hover { color: var(--text-0); }
.tab-item.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Post Card ───────────────────────────────────────────── */
.post-card {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
  position: relative;
}
.post-card:hover { background: rgba(255,255,255,.02); }

.post-avatar-col { flex-shrink: 0; }
.post-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--border);
}

.post-body { flex: 1; min-width: 0; }
.post-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px; margin-bottom: 4px;
}
.post-display-name { font-weight: 700; font-size: .9rem; color: var(--text-0); }
.post-username { color: var(--text-3); font-size: .85rem; }
.post-dot { color: var(--text-3); }
.post-time { color: var(--text-3); font-size: .82rem; white-space: nowrap; }
.post-content {
  font-size: .9rem; line-height: 1.6;
  color: var(--text-1); word-break: break-word;
  white-space: pre-wrap; margin-bottom: 8px;
}
.post-menu-btn {
  background: none; border: none;
  color: var(--text-3); opacity: 0;
  padding: 4px 8px; border-radius: 50%;
  transition: opacity .15s, background .15s;
  margin-left: auto; flex-shrink: 0;
}
.post-card:hover .post-menu-btn { opacity: 1; }
.post-menu-btn:hover { background: rgba(108,99,255,.15); color: var(--accent); }

/* ── Post Actions ─────────────────────────────────────────── */
.post-actions {
  display: flex; align-items: center; gap: 4px;
  margin-top: 8px;
}
.action-btn {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none;
  color: var(--text-3); font-size: .82rem;
  padding: 6px 8px; border-radius: 50px;
  transition: color .15s, background .15s;
}
.action-btn:hover { background: rgba(108,99,255,.12); }
.action-btn.reply:hover { color: var(--accent); }
.action-btn.repost:hover { color: var(--repost-color); background: rgba(0,186,124,.1); }
.action-btn.repost.reposted { color: var(--repost-color); }
.action-btn.like:hover { color: var(--like-color); background: rgba(244,63,94,.1); }
.action-btn.like.liked { color: var(--like-color); }
.action-btn.bookmark.bookmarked { color: var(--accent); }
.action-count { font-size: .8rem; }

/* ── Post Media ───────────────────────────────────────────── */
.post-media { margin-top: 10px; }
.post-media-grid {
  display: grid; gap: 2px;
  border-radius: var(--radius); overflow: hidden;
}
.post-media-grid.count-1 { grid-template-columns: 1fr; }
.post-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-4 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 .media-item:first-child { grid-row: span 2; }

.media-item { overflow: hidden; position: relative; aspect-ratio: 1; }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item video { width: 100%; height: 100%; object-fit: cover; }
.post-video { width: 100%; border-radius: var(--radius); }

/* ── Composer ─────────────────────────────────────────────── */
.composer {
  display: flex; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.composer-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.composer-body { flex: 1; }
.composer-textarea {
  width: 100%; background: none; border: none;
  color: var(--text-0); font-size: .95rem; line-height: 1.5;
  resize: none; outline: none; min-height: 60px;
  font-family: inherit;
}
.composer-textarea::placeholder { color: var(--text-3); }
.composer-footer {
  display: flex; align-items: center; gap: 8px;
  padding-top: 8px;
}
.composer-tools { display: flex; gap: 4px; flex: 1; }
.composer-tool {
  background: none; border: none;
  color: var(--accent); font-size: 1.05rem;
  padding: 6px 8px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center;
  transition: background .15s;
}
.composer-tool:hover { background: rgba(108,99,255,.12); }
.char-counter { color: var(--text-3); font-size: .82rem; }
.char-counter.warning { color: var(--gold); }
.char-counter.danger { color: var(--like-color); }
.composer-media-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-post, .btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 8px 20px;
  border-radius: 50px; font-weight: 700; font-size: .875rem;
  cursor: pointer; transition: opacity .15s, transform .1s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-post:hover, .btn-primary:hover { opacity: .88; }
.btn-post:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }

.btn-follow {
  padding: 7px 18px; border-radius: 50px;
  font-weight: 700; font-size: .875rem;
  cursor: pointer; transition: all .15s;
  border: 1.5px solid transparent; white-space: nowrap;
}
.btn-follow-filled { background: var(--text-0); color: var(--bg-0); border-color: var(--text-0); }
.btn-follow-outline { background: none; color: var(--text-0); border-color: var(--border); }
.btn-follow-outline:hover { border-color: var(--text-1); }
.btn-follow-following { background: none; color: var(--text-1); border-color: var(--border); }
.btn-follow-following:hover { border-color: var(--like-color); color: var(--like-color); }
.w-100 { width: 100%; justify-content: center; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh; display: flex;
  align-items: center; justify-content: center;
  padding: 20px; background: var(--bg-0);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px;
}
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 900;
  margin-bottom: 4px;
}
.auth-logo-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}
.auth-tagline { color: var(--text-3); font-size: .85rem; margin-bottom: 24px; }
.auth-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 20px; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-0);
  font-weight: 600; text-decoration: none;
  transition: background .15s;
}
.btn-google:hover { background: var(--bg-3); }

.divider {
  text-align: center; color: var(--text-3);
  font-size: .8rem; margin: 14px 0;
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute; top: 50%;
  width: calc(50% - 24px); height: 1px;
  background: var(--border);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

.form-group { margin-bottom: 14px; }
.form-label { display: block; color: var(--text-2); font-size: .85rem; margin-bottom: 6px; font-weight: 500; }
.form-input {
  width: 100%; padding: 11px 14px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); color: var(--text-0);
  font-size: .95rem; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.form-input:focus { border-color: var(--accent); }
.form-error { color: var(--like-color); font-size: .8rem; margin-top: 4px; }
.auth-switch { text-align: center; color: var(--text-3); font-size: .875rem; margin-top: 16px; }
.auth-switch a { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ── Profile ──────────────────────────────────────────────── */
.profile-cover {
  width: 100%; height: 160px; object-fit: cover; display: block;
}
.profile-cover-placeholder {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-3));
}
.profile-info-bar { padding: 0 16px 14px; }
.profile-actions-row {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 0;
}
.profile-avatar-wrap {
  margin-top: -44px; margin-bottom: 12px;
}
.profile-avatar {
  width: 82px; height: 82px; border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-0);
}
.profile-display-name {
  font-size: 1.15rem; font-weight: 800; color: var(--text-0);
  display: flex; align-items: center; gap: 6px;
}
.profile-username { color: var(--text-3); font-size: .9rem; margin-bottom: 10px; }
.profile-bio { color: var(--text-1); font-size: .9rem; margin-bottom: 10px; line-height: 1.5; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.profile-meta-item { color: var(--text-3); font-size: .85rem; display: flex; align-items: center; gap: 5px; }
.profile-meta-item a { color: var(--accent); text-decoration: none; }
.profile-stats { display: flex; gap: 20px; }
.profile-stat { font-size: .875rem; cursor: pointer; }
.profile-stat strong { color: var(--text-0); font-weight: 700; }
.profile-stat span { color: var(--text-3); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.empty-state-desc { font-size: .9rem; }

/* ── Section Label ────────────────────────────────────────── */
.section-label {
  padding: 10px 16px;
  color: var(--text-3); font-size: .82rem; font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase; letter-spacing: .05em;
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.settings-section h3 {
  font-size: .95rem; font-weight: 700;
  color: var(--text-0); margin-bottom: 14px;
  display: flex; align-items: center;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 60px;
  animation: fadeIn .15s ease;
}
.modal {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 560px;
  max-height: calc(100dvh - 80px); overflow-y: auto;
  animation: slideUp .2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg-1); z-index: 1;
}
.modal-title { font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-2); font-size: 1.1rem;
  padding: 6px; border-radius: 50%; line-height: 1;
}
.modal-close:hover { background: var(--bg-2); color: var(--text-0); }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; align-items: center;
}
.toast {
  background: var(--bg-3); color: var(--text-0);
  border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 50px;
  font-size: .875rem; font-weight: 500;
  animation: slideUp .2s ease;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.toast.error { border-color: var(--like-color); color: var(--like-color); }
.toast.success { border-color: var(--repost-color); color: var(--repost-color); }

/* ── Badge (notification count) ──────────────────────────── */
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--like-color); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 10px;
  padding: 0 5px; line-height: 1; margin-left: auto;
}

/* ── Verification Badges ──────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  vertical-align: middle; margin-left: 2px; flex-shrink: 0;
}
.badge svg { display: block; }
.badge-gov { background: #1a6dd4; color: #fff; }
.badge-verified { background: #1d9bf0; color: #fff; }
.badge-business { background: #00ba7c; color: #fff; }
.badge-siyaasi { background: linear-gradient(135deg,#f5c842,#e09c10); color: #fff; }
.badge-best {
  background: linear-gradient(135deg,#ff6b35,#f72585);
  color: #fff; border-radius: 10px;
  width: auto; padding: 1px 6px;
  font-size: .65rem; font-weight: 700;
  letter-spacing: .03em; gap: 3px;
}
.badge-best svg { width: 10px; height: 10px; }

/* ── Links in posts ───────────────────────────────────────── */
.link-hashtag { color: var(--accent); text-decoration: none; }
.link-hashtag:hover { text-decoration: underline; }
.link-mention { color: var(--accent-2); text-decoration: none; }
.link-mention:hover { text-decoration: underline; }
.link-url { color: var(--accent); text-decoration: none; word-break: break-word; }
.link-url:hover { text-decoration: underline; }

/* ── Lightbox ─────────────────────────────────────────────── */
#lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
#lightbox-overlay img { max-width: 95vw; max-height: 95dvh; border-radius: 8px; }
#lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.1); border: none;
  color: #fff; font-size: 1.4rem;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.fade-in { animation: fadeIn .2s ease; }

/* ── Misc ─────────────────────────────────────────────────── */
.repost-label { color: var(--text-3); font-size: .8rem; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.quoted-post {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-top: 8px;
  transition: background .12s;
}
.quoted-post:hover { background: var(--bg-2); }
input[type="date"].form-input { color-scheme: dark; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .top-bar { display: flex; }
  .bottom-nav { display: flex; }
  .fab { display: flex; }
  .main-content { max-width: 100%; border: none; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
}
