/* ===== CharchaChowk Theme ===== */
:root {
  --navy: #141c28;
  --navy2: #1f2a3a;
  --yellow: #fbb820;
  --yellow-d: #e5a50f;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #141c28;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #e0245e;
  --green: #16a34a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Poppins', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.55; }
body.no-scroll { overflow: hidden; }
a { color: #b47d00; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; border-radius: 999px; border: 1px solid transparent; font: 600 14px 'Poppins', sans-serif; cursor: pointer; text-decoration: none !important; transition: .15s; background: var(--navy); color: #fff; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: var(--yellow-d); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #fff; border-color: var(--yellow); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; }
.follow-btn.following { background: transparent; color: var(--text); border-color: var(--line); }
.link-btn { background: none; border: 0; color: var(--red); cursor: pointer; padding: 0 4px; font-family: inherit; }

/* Topbar */
.topbar { background: var(--navy); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.topbar-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand img { height: 30px; display: block; background: #fff; padding: 5px 10px; border-radius: 8px; }
.top-search { flex: 1; max-width: 460px; }
.top-search input { width: 100%; padding: 9px 16px; border-radius: 999px; border: 0; background: var(--navy2); color: #fff; font: inherit; }
.top-search input::placeholder { color: #9aa4b2; }
.top-search input:focus { outline: 2px solid var(--yellow); }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-nav .btn-ghost { color: #fff; border-color: #3a4658; }

.dropdown { position: relative; }
.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 48px; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 210px; overflow: hidden; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 10px 16px; color: var(--text); }
.dropdown-menu a:hover { background: var(--bg); text-decoration: none; }
.dd-head { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dd-head span { display: block; color: var(--muted); font-size: 13px; }

/* Layout */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 24px; padding-top: 20px; padding-bottom: 40px; }
.sidenav { position: sticky; top: 82px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.sidenav a { padding: 11px 14px; border-radius: 999px; color: var(--text); font-weight: 500; font-size: 16px; }
.sidenav a:hover { background: #fff; text-decoration: none; }
.sidenav a.active { background: var(--navy); color: #fff; }
.sidenav .side-post { margin-top: 12px; color: var(--navy); }
.rightbar { position: sticky; top: 82px; align-self: start; }
.main { min-width: 0; }
.main-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.main-head h1 { font-size: 22px; margin: 0; }
.main-head .back { font-size: 22px; color: var(--text); }
.main-head .small { margin-left: auto; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; border: 1px solid var(--line); }
.card h4 { margin: 0 0 12px; font-size: 16px; }
.empty { text-align: center; color: var(--muted); padding: 40px 18px; }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: #e8f8ee; color: #136c34; border: 1px solid #b6e7c8; }
.alert-error { background: #fdecef; color: #9b1239; border: 1px solid #f6c3d0; }
.alert-info { background: #fff7e0; color: #7a5600; border: 1px solid #fde3a0; }

/* Avatar */
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--line); }
.avatar.sm { width: 36px; height: 36px; }
.avatar.xl { width: 110px; height: 110px; border: 4px solid #fff; }

/* Hero */
.hero { text-align: center; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; border: 0; padding: 32px 20px; }
.hero-logo { max-width: 280px; background: #fff; padding: 10px 18px; border-radius: 12px; }
.hero p { color: #d3d9e2; margin: 14px 0 18px; }

/* Composer */
.composer { display: flex; gap: 12px; }
.composer-body { flex: 1; }
.composer textarea, .composer-row textarea { width: 100%; border: 0; resize: vertical; font: inherit; font-size: 17px; padding: 8px 0; outline: none; background: transparent; }
.composer-row { display: flex; gap: 12px; }
.composer-foot { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.composer-foot .char-count { margin-left: auto; }
.file-btn { cursor: pointer; font-size: 14px; color: #b47d00; font-weight: 500; }

/* Post */
.feed { display: flex; flex-direction: column; gap: 12px; }
.post { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; transition: opacity .25s; }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-head .name, .comment .name { font-weight: 600; color: var(--text); }
.post-head .muted { font-size: 13px; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; margin-left: auto; }
.badge-tweet { background: #eef2ff; color: #3b4fd1; }
.badge-blog { background: #fff4d6; color: #a06c00; }
.badge-poll { background: #e7f8ef; color: #127a3e; }
.del-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.del-btn:hover { background: #fdecef; color: var(--red); }
.post-title { margin: 6px 0; font-size: 19px; line-height: 1.35; }
.post-title a { color: var(--text); }
.post-text { margin-top: 4px; word-wrap: break-word; overflow-wrap: anywhere; }
.blog-text { font-size: 16px; line-height: 1.8; }
.poll-q { font-weight: 600; font-size: 16px; }
.post-img { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 12px; margin-top: 10px; border: 1px solid var(--line); }
.post-actions { display: flex; gap: 22px; margin-top: 12px; }
.act { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 8px; }
.act:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.like-btn.liked { color: var(--red); }
.like-btn.liked .ic { transform: scale(1.15); }

/* Poll */
.poll { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.poll-opt { width: 100%; text-align: left; padding: 11px 16px; border: 2px solid var(--yellow); background: #fff; border-radius: 10px; font: 500 15px 'Poppins', sans-serif; cursor: pointer; color: var(--text); }
.poll-opt:hover { background: #fff8e6; }
.poll-result { position: relative; padding: 10px 16px; border-radius: 10px; background: var(--bg); overflow: hidden; display: flex; justify-content: space-between; }
.poll-result .bar { position: absolute; left: 0; top: 0; bottom: 0; background: #ffe7a8; z-index: 0; transition: width .6s; }
.poll-result.mine .bar { background: var(--yellow); }
.poll-result .opt, .poll-result .pct { position: relative; z-index: 1; font-weight: 500; }
.poll-meta { font-size: 13px; color: var(--muted); }

/* Comments */
.comment-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.comment-form textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; resize: vertical; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
form.inline { display: inline; }

/* Forms */
.form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; color: #374151; }
.form input[type=text], .form input[type=email], .form input[type=tel], .form input[type=number], .form input[type=password], .form input[type=file], .form select, .form textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 10px; font: 400 15px 'Poppins', sans-serif; background: #fff; color: var(--text);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(251,184,32,.25); }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form .check input { margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 12px; }
.prefix-wrap, .pass-wrap { display: flex; align-items: stretch; margin-top: 6px; }
.prefix-wrap span { padding: 11px 12px; background: var(--bg); border: 1px solid #d1d5db; border-right: 0; border-radius: 10px 0 0 10px; color: var(--muted); font-weight: 500; }
.prefix-wrap input { margin-top: 0 !important; border-radius: 0 10px 10px 0 !important; }
.pass-wrap input { margin-top: 0 !important; border-radius: 10px 0 0 10px !important; }
.pass-wrap .eye { border: 1px solid #d1d5db; border-left: 0; background: var(--bg); border-radius: 0 10px 10px 0; cursor: pointer; padding: 0 12px; }
.opt-row { display: flex; gap: 8px; margin-bottom: 10px; }
.opt-row input { flex: 1; margin-top: 0 !important; }
.rm-opt, .rm-img { border: 0; background: var(--bg); border-radius: 8px; cursor: pointer; padding: 0 12px; }
.img-preview { position: relative; margin: 10px 0; }
.img-preview img { max-height: 260px; border-radius: 12px; }
.img-preview .rm-img { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.6); color: #fff; padding: 4px 9px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { flex: 1; text-align: center; padding: 12px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { color: var(--text); border-color: var(--yellow); }
.sub-tabs { background: #fff; border-radius: var(--radius) var(--radius) 0 0; margin-bottom: 12px; border: 1px solid var(--line); }

/* Profile */
.profile-card { padding: 0 20px 18px; overflow: hidden; }
.cover { height: 130px; margin: 0 -20px; background: linear-gradient(120deg, var(--navy), var(--navy2) 60%, var(--yellow)); }
.profile-top { display: flex; justify-content: space-between; align-items: flex-end; margin-top: -55px; }
.profile-card h2 { margin: 8px 0 0; font-size: 22px; }
.bio { margin: 10px 0 6px; }
.meta { margin: 6px 0; }
.stats { display: flex; gap: 20px; margin-top: 8px; font-size: 14px; }

/* Rightbar */
.trend { display: flex; justify-content: space-between; padding: 8px 0; color: var(--text); border-bottom: 1px solid var(--line); }
.trend:last-child { border: 0; }
.trend span { color: var(--muted); font-size: 12px; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.who a { flex: 1; min-width: 0; color: var(--text); }
.who a b, .who a span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who a span { color: var(--muted); font-size: 13px; }
.foot-links { padding: 0 6px; }

.search-big { display: flex; gap: 10px; }
.search-big input { flex: 1; padding: 11px 16px; border: 1px solid #d1d5db; border-radius: 999px; font: inherit; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.static-page { line-height: 1.8; }

/* ===== Welcome Popup ===== */
.popup-overlay { position: fixed; inset: 0; background: rgba(10,14,22,.72); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .3s; }
.popup-box { position: relative; width: 100%; max-width: 620px; background: radial-gradient(circle at 70% 20%, #2b3a4c, #141c28 70%); border-radius: 18px; padding: 40px 28px 28px; text-align: center; color: #fff; box-shadow: 0 25px 60px rgba(0,0,0,.5); animation: popIn .35s cubic-bezier(.2,1.3,.5,1); }
.popup-icon { width: 54px; height: 54px; }
.popup-brand { font-size: 22px; font-weight: 600; margin-top: 8px; }
.popup-box h2 { font-size: 32px; margin: 14px 0 8px; font-weight: 700; line-height: 1.2; }
.popup-box p { font-size: 17px; color: #e5e7eb; margin: 0 0 24px; }
.popup-btn { display: block; background: var(--yellow); color: var(--navy); font-weight: 600; font-size: 18px; padding: 15px; border-radius: 12px; text-decoration: none !important; transition: .15s; }
.popup-btn:hover { background: var(--yellow-d); transform: translateY(-1px); }
.popup-close { position: absolute; top: 12px; right: 14px; background: rgba(255,255,255,.1); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px; }
.popup-close:hover { background: rgba(255,255,255,.2); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.85) translateY(20px); } }

/* Toast */
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 20px; border-radius: 999px; z-index: 1100; font-size: 14px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }

/* ===== Auth page ===== */
.auth-page { background: var(--navy); min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-side { color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 30% 30%, #2b3a4c, #141c28 70%); }
.auth-side h1 { font-size: 46px; line-height: 1.15; margin: 20px 0 10px; }
.auth-side p { font-size: 18px; color: var(--yellow); margin: 0 0 30px; }
.auth-side ul { list-style: none; padding: 0; margin: 0; color: #cfd6df; }
.auth-side li { padding: 8px 0; font-size: 16px; }
.auth-box { background: #fff; padding: 40px 48px; overflow-y: auto; }
.auth-logo { height: 46px; display: block; margin: 0 auto 24px; }

/* Bottom nav (mobile) */
.bottomnav { display: none; }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 70px minmax(0, 1fr) 280px; }
  .sidenav a span { display: none; }
  .sidenav a { text-align: center; font-size: 20px; padding: 10px; }
  .sidenav .side-post { font-size: 14px; padding: 10px 4px; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 14px; padding-bottom: 80px; }
  .sidenav, .rightbar { display: none; }
  .top-search { display: none; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 50; justify-content: space-around; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
  .bottomnav a { font-size: 22px; padding: 4px 14px; text-decoration: none; }
  .bottomnav .plus { background: var(--yellow); color: var(--navy); border-radius: 50%; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 26px; margin-top: -18px; box-shadow: 0 4px 12px rgba(251,184,32,.5); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 30px 24px; text-align: center; align-items: center; }
  .auth-side h1 { font-size: 30px; }
  .auth-side ul { display: none; }
  .auth-box { padding: 28px 20px; }
}
@media (max-width: 520px) {
  .topbar-in { gap: 10px; }
  .brand img { height: 24px; }
  .top-nav .btn { padding: 7px 12px; font-size: 13px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 label:last-child { grid-column: 1 / -1; }
  .post { padding: 14px 12px; }
  .avatar { width: 40px; height: 40px; }
  .popup-box { padding: 36px 20px 22px; }
  .popup-box h2 { font-size: 25px; }
  .popup-btn { font-size: 16px; padding: 13px; }
}

/* ===== Language switch & Hindi font ===== */
body.lang-hi { font-family: 'Noto Sans Devanagari', 'Poppins', system-ui, sans-serif; }
.lang-hi .btn, .lang-hi .poll-opt, .lang-hi .form input, .lang-hi .form select, .lang-hi .form textarea { font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif; }
.lang-switch { display: inline-flex; border: 1px solid #3a4658; border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: 6px 11px; font-size: 13px; font-weight: 600; color: #cfd6df; text-decoration: none !important; }
.lang-switch a.on { background: var(--yellow); color: var(--navy); }
.lang-switch.light { border-color: var(--line); }
.lang-switch.light a { color: var(--muted); }
.lang-switch.light a.on { color: var(--navy); }
.popup-lang { margin-top: 16px; font-size: 14px; color: #8a95a5; }
.popup-lang a { color: #cfd6df; padding: 0 6px; }
.popup-lang a.on { color: var(--yellow); font-weight: 600; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.auth-top .auth-logo { margin: 0; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
@media (max-width: 520px) {
  .hide-xs { display: none !important; }
  .lang-switch a { padding: 5px 8px; font-size: 12px; }
  .auth-top { justify-content: center; }
}
