/* ============================================================
   kuchhyaade.com — app.css
   Design: Clean white, black text, red highlights
   ============================================================ */

:root {
    --bg:        #ffffff;
    --bg-card:   #f7f7f7;
    --bg-card2:  #efefef;
    --border:    #dddddd;
    --border-2:  #eeeeee;
    --text:      #111111;
    --text-muted:#333333;
    --text-dim:  #555555;
    --black:     #000000;
    --red:       #cc2222;
    --red-hover: #aa1111;
    --green:     #1a8a4a;
    --mono:      'Courier New', Courier, monospace;
    --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--black); text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
textarea, input { font-family: inherit; }

/* ── Top post badge ───────────────────────────────────────── */
.top-post { border-left: 3px solid var(--red); padding-left: 16px; }
.top-badge {
    font-size: 10px; font-weight: 700;
    color: var(--red); font-family: var(--mono);
    text-transform: uppercase; letter-spacing: 1px;
    background: rgba(204,34,34,0.08);
    padding: 2px 7px; border: 1px solid rgba(204,34,34,0.2);
    margin-right: 4px;
}

/* ── Feed divider ─────────────────────────────────────────── */
.feed-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 24px 0 16px;
    color: var(--text-dim); font-size: 11px;
    font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px;
}
.feed-divider::before, .feed-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Login banner ─────────────────────────────────────────── */
.login-banner {
    background: var(--bg-card);
    border-bottom: 2px solid var(--black);
    padding: 10px 24px;
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: var(--text-muted);
    flex-wrap: wrap;
}
.blink-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--red);
    animation: blink 1.2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.15; } }
.banner-text { flex: 1; font-weight: 500; }
.banner-btn {
    padding: 5px 14px; background: var(--red); color: white;
    font-size: 12px; font-weight: 700;
}
.banner-link { font-size: 12px; color: var(--text-dim); }
.banner-link:hover { color: var(--red); text-decoration: underline; }

/* ── Header ───────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg);
    border-bottom: 2px solid var(--black);
}
.header-inner {
    max-width: 900px; margin: 0 auto;
    padding: 14px 20px 0;
    display: flex; flex-direction: column; align-items: center;
}
.logo {
    font-size: 22px; font-weight: 700;
    color: var(--black); text-decoration: none;
    padding-bottom: 10px; font-style: normal;
}
.logo-dot { color: var(--red); }
.header-nav {
    display: flex; align-items: center; justify-content: center;
    width: 100%; border-top: 1px solid var(--border);
}
.nav-link {
    font-size: 13px; color: var(--text-muted);
    transition: var(--transition); text-decoration: none;
    background: none; border: none; cursor: pointer;
    font-family: var(--sans); white-space: nowrap;
    padding: 10px 16px; flex: 1; text-align: center;
    font-weight: 500;
}
.nav-link:hover { color: var(--black); text-decoration: none; background: var(--bg-card); }
.nav-link.active-page { color: var(--black); font-weight: 700; }
.nav-login { border: none; }
.nav-logout { color: var(--red) !important; font-weight: 700; }
.nav-logout:hover { background: rgba(204,34,34,0.05) !important; }

/* ── Home feed ────────────────────────────────────────────── */
.home-main { max-width: 680px; margin: 0 auto; padding: 40px 24px 80px; }
.feed-header {
    display: flex; align-items: baseline; gap: 12px;
    margin-bottom: 32px; padding-bottom: 16px;
    border-bottom: 2px solid var(--black);
}
.feed-title { font-size: 24px; font-weight: 700; color: var(--black); }
/* feed-count removed — no word count shown */
.feed-count { display: none; }

/* ── Post card ────────────────────────────────────────────── */
.post-card { padding: 24px 0; border-bottom: 1px solid var(--border); }
.post-card:last-child { border-bottom: none; }
.post-meta {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
}
.post-author {
    font-size: 13px; font-weight: 700;
    color: var(--red); text-decoration: none;
}
.post-author:hover { text-decoration: underline; }
.post-author.anon { color: var(--text-dim); font-weight: 400; }
.post-time { font-size: 11px; color: var(--text-dim); font-family: var(--mono); margin-left: auto; }

/* Post content — truncated in feed ─────────────────────────*/
.post-content {
    font-size: 15px; line-height: 1.7;
    color: var(--text); word-break: break-word;
}
.post-content-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.see-more-btn {
    display: inline-block; margin-top: 6px;
    font-size: 12px; font-weight: 700;
    color: var(--red); cursor: pointer;
    background: none; border: none;
    font-family: var(--sans); padding: 0;
    text-decoration: none;
}
.see-more-btn:hover { text-decoration: underline; }

.post-actions { margin-top: 12px; display: flex; align-items: center; gap: 8px; }
.like-btn {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--text-dim);
    background: none; border: none; cursor: pointer;
    transition: var(--transition); font-family: var(--sans);
    padding: 0;
}
.like-btn:hover { color: var(--red); }
.like-btn.liked { color: var(--red); font-weight: 700; }
.like-static { font-size: 13px; color: var(--text-dim); }
.empty-feed { text-align: center; padding: 60px 0; color: var(--text-muted); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 40px; }
.page-btn { font-size: 13px; color: var(--red); font-family: var(--mono); font-weight: 700; }
.page-info { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }

/* ── Login card ───────────────────────────────────────────── */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--bg); border: 2px solid var(--black); padding: 36px 28px; }
.login-brand h1 { font-size: 26px; font-weight: 700; margin-bottom: 4px; color: var(--black); }
.login-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }
.notif { background: #fff5f5; border: 1px solid rgba(204,34,34,0.3); padding: 12px 14px; margin-bottom: 16px; font-size: 13px; color: var(--red); line-height: 1.5; }
.notif a { color: var(--red); display: block; margin-top: 6px; font-size: 12px; font-weight: 700; }
.field-group { margin-bottom: 18px; position: relative; }
.field-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.label-hint { color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.field-input { width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 14px; outline: none; transition: var(--transition); }
.field-input.mono { font-family: var(--mono); letter-spacing: 1px; font-size: 13px; }
.field-input:focus { border-color: var(--black); }
.field-input::placeholder { color: var(--text-dim); }
.field-counter { position: absolute; right: 0; bottom: -18px; font-size: 10px; color: var(--text-dim); font-family: var(--mono); }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: -12px; margin-bottom: 14px; }
.btn-primary { width: 100%; padding: 12px; background: var(--red); color: white; font-size: 13px; font-weight: 700; border: none; transition: var(--transition); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.btn-primary:hover { background: var(--red-hover); }
.btn-loader { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-footer-note { margin-top: 16px; text-align: center; font-size: 12px; color: var(--text-dim); }
.login-footer-note a { color: var(--red); font-weight: 700; }

/* ── Dashboard layout ─────────────────────────────────────── */
.dash-page { min-height: 100vh; padding: 0 0 80px; background: var(--bg); }
.dash-main { max-width: 1000px; margin: 0 auto; padding: 32px 24px 80px; }
.dash-layout { display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: start; }
.sidebar-card { background: var(--bg); border: 1px solid var(--border); padding: 20px; margin-bottom: 14px; }
.user-info { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.user-name { font-size: 15px; font-weight: 700; color: var(--red); margin-bottom: 3px; }
.user-email { font-size: 12px; color: var(--text-dim); }
.bio-wrap { margin-bottom: 16px; }
.bio-display p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.edit-bio-btn { font-size: 11px; color: var(--text-dim); margin-top: 5px; display: block; text-decoration: underline; cursor: pointer; background: none; border: none; font-family: var(--sans); padding: 0; }
.edit-bio-btn:hover { color: var(--black); }
.bio-textarea { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 13px; resize: none; outline: none; min-height: 64px; transition: var(--transition); }
.bio-textarea:focus { border-color: var(--black); }
.bio-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.bio-counter { font-size: 10px; color: var(--text-dim); font-family: var(--mono); flex: 1; }
.btn-small { padding: 5px 10px; font-size: 12px; font-weight: 700; background: var(--red); color: white; border: none; cursor: pointer; transition: var(--transition); font-family: var(--sans); }
.btn-small:hover { background: var(--red-hover); }
.btn-cancel { background: var(--bg-card2); color: var(--text-muted); }
.btn-cancel:hover { background: var(--border); color: var(--black); }
.post-limit-info { margin-top: 14px; }
.limit-text { font-size: 11px; color: var(--text-dim); font-family: var(--mono); display: block; margin-bottom: 5px; }
.limit-bar { height: 3px; background: var(--border); overflow: hidden; }
.limit-fill { height: 100%; background: var(--red); transition: width 0.3s ease; }
.write-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--black); text-transform: uppercase; letter-spacing: 0.5px; }
.post-textarea { width: 100%; min-height: 140px; padding: 10px; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-size: 14px; line-height: 1.7; resize: vertical; outline: none; transition: var(--transition); }
.post-textarea:focus { border-color: var(--black); }
.post-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.char-counter { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.post-footer .btn-primary { width: auto; padding: 9px 20px; margin-top: 0; }
.limit-reached { font-size: 13px; color: var(--text-dim); }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--black); }
.post-count { font-size: 14px; font-weight: 400; color: var(--text-dim); font-family: var(--mono); }
.own-post .post-meta { position: relative; }
.delete-btn { margin-left: auto; font-size: 11px; color: var(--text-dim); padding: 3px 7px; border: 1px solid var(--border); background: none; cursor: pointer; transition: var(--transition); font-family: var(--sans); }
.delete-btn:hover { color: var(--red); border-color: var(--red); }
.empty-state { color: var(--text-dim); font-size: 14px; padding: 32px 0; }

/* ── Username modal ───────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-card { background: var(--bg); border: 2px solid var(--black); padding: 36px 28px; width: 100%; max-width: 400px; }
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 10px; color: var(--black); }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }
.modal-warn { background: rgba(204,34,34,0.06); border: 1px solid rgba(204,34,34,0.2); padding: 10px 12px; font-size: 13px; color: var(--red); margin-bottom: 18px; font-weight: 600; }
#username-notif { margin-bottom: 14px; }

/* ── Profile ──────────────────────────────────────────────── */
.profile-main { max-width: 680px; margin: 0 auto; padding: 40px 24px 80px; }
.profile-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 40px; padding-bottom: 28px; border-bottom: 2px solid var(--black); }
.profile-avatar { width: 56px; height: 56px; border: 2px solid var(--black); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; color: var(--black); flex-shrink: 0; background: var(--bg-card); }
.profile-username { font-size: 20px; font-weight: 700; color: var(--red); margin-bottom: 6px; }
.profile-bio { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.6; }
.profile-stats { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.not-found { text-align: center; padding: 80px 0; color: var(--text-muted); }

/* ── Search ───────────────────────────────────────────────── */
.search-main { max-width: 560px; margin: 0 auto; padding: 40px 24px 80px; }
.search-title { font-size: 28px; font-weight: 700; margin-bottom: 28px; color: var(--black); }
.search-form { margin-bottom: 32px; }
.search-input-wrap { display: flex; gap: 0; border: 2px solid var(--black); }
.search-input { flex: 1; padding: 12px 14px; background: var(--bg); border: none; color: var(--text); font-size: 14px; font-family: var(--mono); outline: none; }
.search-btn { padding: 12px 18px; background: var(--black); color: white; border: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.search-btn:hover { background: var(--red); }
.search-empty { color: var(--text-dim); font-size: 14px; }
.search-results { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.user-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg); text-decoration: none; transition: var(--transition); }
.user-card:hover { background: var(--bg-card); text-decoration: none; }
.user-avatar-sm { width: 36px; height: 36px; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--black); flex-shrink: 0; background: var(--bg-card); }
.user-card-info { flex: 1; }
.user-card-name { font-size: 14px; font-weight: 700; color: var(--red); display: block; }
.user-card-bio { font-size: 12px; color: var(--text-dim); display: block; margin-top: 2px; }
.user-card-arrow { color: var(--text-dim); font-size: 14px; }

/* ── Footer ───────────────────────────────────────────────── */
.site-footer { text-align: center; padding: 20px; font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--border); }
.site-footer a { color: var(--red); font-weight: 700; }

/* ── Misc ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
.muted { color: var(--text-dim); }

/* ── Mobile ───────────────────────────────────────────────── */
@media (max-width: 700px) {
    .dash-layout { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; }
    .login-banner { flex-wrap: wrap; gap: 8px; }
    .home-main, .profile-main, .search-main { padding-left: 16px; padding-right: 16px; }
    .dash-main { padding-left: 16px; padding-right: 16px; }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); }
::selection { background: rgba(204,34,34,0.15); }

/* ── Top timer ────────────────────────────────────────────── */
.top-timer {
    font-size: 10px; font-family: var(--mono);
    color: var(--red); font-weight: 700;
    margin-left: auto;
    background: rgba(204,34,34,0.07);
    padding: 2px 6px;
    border: 1px solid rgba(204,34,34,0.15);
}