/* ============================================================
   IndianLaw360 Community — Global Stylesheet
   Dark indigo theme matching the main site
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a0a1a;
  --surface:     #12122a;
  --card:        #1a1a3e;
  --card-hover:  #222255;
  --accent:      #6366f1;
  --accent-l:    #818cf8;
  --accent-glow: rgba(99,102,241,.25);
  --green:       #22c55e;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --text:        #eef2ff;
  --muted:       #94a3b8;
  --border:      rgba(99,102,241,.18);
  --radius:      14px;
  --radius-sm:   8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent-l); text-decoration: none; }
a:hover { color: var(--text); }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.grad {
  background: linear-gradient(135deg, var(--accent-l), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ── Nav ───────────────────────────────────────────────────── */
.c-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(10,10,26,.9); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.c-nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem;
  height: 60px; padding: 0 1.5rem;
}
.c-nav-logo { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.c-nav-logo span { color: var(--accent-l); }
.c-nav-links { display: flex; gap: 1.5rem; }
.c-nav-links a { color: var(--muted); font-size: .88rem; font-weight: 500; transition: color .2s; }
.c-nav-links a:hover { color: var(--text); }
.c-nav-right { margin-left: auto; display: flex; align-items: center; gap: .75rem; }

/* Buttons */
.c-btn-sm {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s;
}
.c-btn-primary { background: var(--accent); color: #fff; }
.c-btn-primary:hover { background: #4f46e5; color: #fff; box-shadow: 0 4px 20px var(--accent-glow); }
.c-btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.c-btn-outline:hover { border-color: var(--accent); background: rgba(99,102,241,.07); color: var(--text); }
.c-btn-danger { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.c-btn-danger:hover { background: rgba(239,68,68,.2); }

/* Bell */
.c-bell-wrap { position: relative; }
.c-bell {
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; padding: .4rem;
  border-radius: var(--radius-sm); transition: color .2s;
  position: relative;
}
.c-bell:hover { color: var(--text); }
.c-bell-badge {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Notification dropdown */
.c-notif-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); z-index: 500;
  overflow: hidden;
}
.c-notif-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem 1rem; border-bottom: 1px solid var(--border);
  font-size: .85rem; font-weight: 700;
}
.c-notif-markall { background: none; border: none; color: var(--accent-l); font-size: .78rem; cursor: pointer; }
.c-notif-list { max-height: 340px; overflow-y: auto; }
.c-notif-item {
  display: flex; gap: .75rem; padding: .8rem 1rem; align-items: flex-start;
  border-bottom: 1px solid var(--border); color: var(--muted); font-size: .83rem;
  transition: background .15s;
}
.c-notif-item:hover { background: var(--card); color: var(--text); }
.c-notif-item.unread { background: rgba(99,102,241,.06); }
.c-notif-item.unread .c-notif-actor { color: var(--text); }
.c-notif-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.c-notif-actor { font-weight: 600; color: var(--accent-l); }
.c-notif-title { color: var(--text); font-size: .82rem; margin-top: .2rem; }
.c-notif-time { color: var(--muted); font-size: .75rem; }
.c-notif-empty, .c-notif-loading { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .85rem; }
.c-notif-footer {
  display: block; text-align: center; padding: .7rem;
  font-size: .82rem; color: var(--accent-l); border-top: 1px solid var(--border);
}

/* Avatar menu */
.c-avatar-wrap { position: relative; }
.c-avatar-btn {
  background: none; border: 2px solid var(--border); border-radius: 50%; cursor: pointer;
  padding: 0; overflow: hidden; width: 36px; height: 36px; display: block;
  transition: border-color .2s;
}
.c-avatar-btn:hover { border-color: var(--accent); }
.c-avatar-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 200px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.5); z-index: 500;
  overflow: hidden;
}
.c-dropdown-header { padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.c-dropdown-header strong { display: block; font-size: .9rem; }
.c-dropdown-header small { color: var(--muted); font-size: .78rem; }
.c-dropdown a, .c-dropdown-logout {
  display: block; padding: .65rem 1rem; font-size: .85rem; color: var(--muted);
  transition: all .15s; background: none; border: none; width: 100%; text-align: left; cursor: pointer;
}
.c-dropdown a:hover, .c-dropdown-logout:hover { background: var(--card); color: var(--text); }

/* ── Layout ─────────────────────────────────────────────────── */
.c-main { max-width: 1200px; margin: 0 auto; padding: 80px 1.5rem 3rem; }
.c-main-wide { max-width: 900px; margin: 0 auto; padding: 80px 1.5rem 3rem; }
.c-two-col { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }

/* ── Cards ──────────────────────────────────────────────────── */
.c-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: border-color .2s, box-shadow .2s;
}
.c-card:hover { border-color: rgba(99,102,241,.3); box-shadow: 0 8px 30px rgba(0,0,0,.25); }

/* ── Post card ───────────────────────────────────────────────── */
.c-post-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin-bottom: 1rem; transition: all .2s;
}
.c-post-card:hover { border-color: rgba(99,102,241,.35); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.c-post-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; flex-wrap: wrap; }
.c-post-meta img { border-radius: 50%; width: 26px; height: 26px; object-fit: cover; }
.c-post-meta .author { font-weight: 600; font-size: .85rem; color: var(--text); }
.c-post-meta .time { color: var(--muted); font-size: .8rem; }
.c-post-title { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; color: var(--text); }
.c-post-title a { color: inherit; }
.c-post-title a:hover { color: var(--accent-l); }
.c-post-excerpt { color: var(--muted); font-size: .88rem; line-height: 1.55; margin-bottom: .9rem; }
.c-post-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.c-tag {
  display: inline-block; padding: .2rem .6rem;
  background: rgba(99,102,241,.1); color: var(--accent-l);
  border-radius: 50px; font-size: .73rem; font-weight: 600; letter-spacing: .3px;
}
.c-stat { display: flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .82rem; }
.c-stat svg { width: 15px; height: 15px; }

/* ── Like button ─────────────────────────────────────────────── */
.like-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 1px solid var(--border);
  border-radius: 50px; padding: .3rem .75rem;
  font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--muted);
  transition: all .2s;
}
.like-btn:hover, .like-btn.liked { color: var(--red); border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.07); }
.like-btn svg { width: 15px; height: 15px; transition: fill .2s; }
.like-btn.liked svg { fill: var(--red); stroke: var(--red); }

/* ── Comment thread ──────────────────────────────────────────── */
.c-thread { margin-top: 2rem; }
.c-thread-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.c-comment {
  display: flex; gap: .75rem; padding: .9rem 0;
  border-bottom: 1px solid var(--border);
}
.c-comment-avatar { flex-shrink: 0; }
.c-comment-avatar img { border-radius: 50%; width: 32px; height: 32px; object-fit: cover; }
.c-comment-body { flex: 1; min-width: 0; }
.c-comment-meta { display: flex; gap: .6rem; align-items: center; margin-bottom: .35rem; }
.c-comment-author { font-weight: 700; font-size: .87rem; color: var(--text); }
.c-comment-time { color: var(--muted); font-size: .78rem; }
.c-comment-text { font-size: .9rem; color: var(--text); line-height: 1.6; margin-bottom: .5rem; word-break: break-word; }
.c-comment-text.deleted { color: var(--muted); font-style: italic; }
.c-comment-actions { display: flex; gap: .75rem; align-items: center; }
.c-comment-action-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: .78rem; font-weight: 600; padding: .15rem .4rem; border-radius: 4px;
  transition: color .15s, background .15s;
}
.c-comment-action-btn:hover { color: var(--accent-l); background: rgba(99,102,241,.08); }
.c-comment-replies { margin-left: 2rem; border-left: 2px solid var(--border); padding-left: 1rem; }

/* Reply / Comment form */
.c-comment-form { margin-top: 1.5rem; }
.c-reply-form { margin-top: .75rem; display: none; }
.c-reply-form.open { display: block; }

/* ── Forms ────────────────────────────────────────────────────── */
.c-form-group { margin-bottom: 1.25rem; }
.c-form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--muted); }
.c-input, .c-textarea, .c-select {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem 1rem; color: var(--text);
  font-family: inherit; font-size: .95rem; transition: border-color .2s;
}
.c-input:focus, .c-textarea:focus, .c-select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.c-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.c-textarea.tall { min-height: 350px; }

/* ── Article card ────────────────────────────────────────────── */
.c-article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all .25s;
}
.c-article-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,.35); border-color: rgba(99,102,241,.35); }
.c-article-cover { width: 100%; height: 180px; object-fit: cover; display: block; }
.c-article-cover-placeholder { width: 100%; height: 180px; background: linear-gradient(135deg, var(--surface), var(--card-hover)); }
.c-article-body { padding: 1.25rem; }
.c-article-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.3; }
.c-article-title a { color: var(--text); }
.c-article-title a:hover { color: var(--accent-l); }
.c-article-subtitle { color: var(--muted); font-size: .85rem; margin-bottom: .75rem; line-height: 1.5; }
.c-article-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ── Article / Post body (rich text display) ─────────────────── */
.c-prose { font-size: 1rem; line-height: 1.8; color: var(--text); }
.c-prose h2, .c-prose h3, .c-prose h4 { margin: 1.75rem 0 .75rem; font-weight: 700; color: var(--text); }
.c-prose h2 { font-size: 1.5rem; }
.c-prose h3 { font-size: 1.2rem; }
.c-prose p { margin-bottom: 1.1rem; }
.c-prose blockquote {
  border-left: 3px solid var(--accent); padding-left: 1rem; color: var(--muted);
  margin: 1.25rem 0; font-style: italic;
}
.c-prose code { background: var(--surface); padding: .1rem .4rem; border-radius: 4px; font-size: .88em; }
.c-prose pre { background: var(--surface); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1.1rem; }
.c-prose ul, .c-prose ol { padding-left: 1.5rem; margin-bottom: 1.1rem; }
.c-prose li { margin-bottom: .3rem; }
.c-prose a { color: var(--accent-l); text-decoration: underline; }
.c-prose img { border-radius: var(--radius-sm); margin: 1rem 0; }
.c-prose hr { margin: 2rem 0; }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .9rem; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-info { background: rgba(99,102,241,.1); border: 1px solid var(--border); color: var(--accent-l); }

/* ── Visitor CTA banner ───────────────────────────────────────── */
.c-visitor-cta {
  text-align: center; padding: 1.1rem 1.5rem; background: rgba(99,102,241,.08);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.5rem;
  font-size: .9rem; color: var(--muted);
}
.c-visitor-cta a { color: var(--accent-l); font-weight: 600; }

/* ── Auth page ────────────────────────────────────────────────── */
.auth-page body, body.auth-page { display: flex; flex-direction: column; min-height: 100vh; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 5rem 1.5rem 3rem; }
.auth-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 2.5rem; max-width: 420px; width: 100%; text-align: center;
}
.auth-logo { margin-bottom: 1.5rem; display: flex; justify-content: center; }
.auth-card h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: .6rem; }
.auth-sub { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; line-height: 1.6; }
.oauth-buttons { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1.5rem; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  padding: .85rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: .95rem;
  transition: all .2s; cursor: pointer; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
}
.oauth-btn:hover { border-color: var(--accent); background: rgba(99,102,241,.08); color: var(--text); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.auth-disclaimer { color: var(--muted); font-size: .78rem; line-height: 1.6; }
.auth-disclaimer a { color: var(--accent-l); }

/* ── Profile ──────────────────────────────────────────────────── */
.c-profile-hero {
  display: flex; gap: 1.5rem; align-items: center; padding: 2rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 2rem;
}
.c-profile-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); flex-shrink: 0; }
.c-profile-info h2 { font-size: 1.4rem; font-weight: 800; }
.c-profile-info .username { color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.c-profile-info .bio { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.c-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.c-tab {
  padding: .7rem 1.25rem; font-size: .88rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: color .2s, border-color .2s;
}
.c-tab:hover { color: var(--text); }
.c-tab.active { color: var(--accent-l); border-bottom-color: var(--accent); }

/* ── Pagination ───────────────────────────────────────────────── */
.c-pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.c-page-btn {
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer;
  transition: all .2s; text-decoration: none; display: inline-block;
}
.c-page-btn:hover, .c-page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Section headings ─────────────────────────────────────────── */
.c-section-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 1.5rem; }
.c-section-sub { color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.c-sidebar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem;
}
.c-sidebar-card h4 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; color: var(--accent-l); }
.c-sidebar-item { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.c-sidebar-item:last-child { border-bottom: none; }

/* ── Disclaimer ───────────────────────────────────────────────── */
.c-disclaimer {
  background: rgba(245,158,11,.06); border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-sm); padding: .75rem 1rem;
  font-size: .8rem; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6;
}

/* ── Editor toolbar ───────────────────────────────────────────── */
.c-editor-toolbar {
  display: flex; gap: .4rem; flex-wrap: wrap; padding: .6rem .75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.c-editor-toolbar button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  padding: .3rem .5rem; border-radius: 4px; font-size: .85rem; font-weight: 700;
  transition: all .15s;
}
.c-editor-toolbar button:hover { background: var(--card); color: var(--text); }
.c-editor-wrap .c-textarea { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

/* ── Status badge ─────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .65rem;
  border-radius: 50px; font-size: .72rem; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.badge-draft { background: rgba(245,158,11,.12); color: var(--amber); }
.badge-published { background: rgba(34,197,94,.12); color: var(--green); }
.badge-deleted { background: rgba(239,68,68,.12); color: var(--red); }

/* ── Footer ───────────────────────────────────────────────────────────────────── */
.c-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
}
.c-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}
.c-footer-logo {
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--accent-l), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}
.c-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .35rem 1.25rem;
}
.c-footer-links a {
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
  transition: color .2s;
}
.c-footer-links a:hover { color: var(--accent-l); }
.c-footer-copy {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
}
.c-footer-copy a { color: var(--muted); }
.c-footer-copy a:hover { color: var(--accent-l); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .c-nav-links { display: none; }
  .c-two-col { grid-template-columns: 1fr; }
  .c-main, .c-main-wide { padding: 72px 1rem 2rem; }
  .c-profile-hero { flex-direction: column; text-align: center; }
  .c-notif-dropdown { width: 300px; right: -60px; }
}
