/* ==========================================================
   Opinion Platform — core stylesheet
   Minimal, editorial, mobile-first. No frameworks.
   ========================================================== */

:root {
    --ink: #1c1c1a;
    --ink-soft: #5f5e5a;
    --ink-muted: #8a8880;
    --paper: #ffffff;
    --paper-soft: #f5f4ef;
    --line: #e2e0d7;

    --support: #0e7a5c;
    --support-bg: #dff4ec;
    --support-border: #55c39c;

    --neutral: #5f5e5a;
    --neutral-bg: #f1efe8;
    --neutral-border: #b4b2a9;

    --oppose: #a13c1a;
    --oppose-bg: #faeae4;
    --oppose-border: #ef9270;

    --badge: #92600a;
    --badge-bg: #faecd6;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow-card: 0 1px 3px rgba(28, 28, 26, 0.05);
    --font-body: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Lora', Georgia, serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--paper-soft);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

a { color: var(--ink); text-decoration: none; }

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 3px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 600;
}
.topbar nav a {
    margin-left: 11px;
    font-size: 12px;
    color: var(--ink-soft);
}

/* ---------- Notifications ---------- */
.notif-wrap { position: relative; display: inline-block; margin-left: 11px; }
.notif-bell {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    position: relative;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}
.notif-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--oppose);
}
.notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 30px;
    width: 280px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 50;
}
.notif-dropdown.open { display: block; }
.notif-item {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
}
.notif-item:last-child { border-bottom: none; }
.notif-item p { margin: 0 0 3px; font-size: 13px; }
.notif-item span { font-size: 11px; color: var(--ink-muted); }
.notif-item.unread { background: var(--paper-soft); }
.notif-empty { padding: 16px; font-size: 13px; color: var(--ink-soft); margin: 0; }

@media (max-width: 600px) {
    .topbar { padding: 4px 0; }
    .topbar .container { flex-wrap: wrap; gap: 4px; }
    .topbar nav a { margin-left: 7px; font-size: 11px; }
    .notif-wrap { margin-left: 7px; }
}

/* ---------- Auth cards (register / login / otp) ---------- */
.auth-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
}
.auth-card h1 {
    font-size: 22px;
    margin-bottom: 6px;
}
.auth-sub {
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 22px;
}

.field {
    margin-bottom: 16px;
}
.field label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 5px;
}
.field-row {
    display: flex;
    gap: 10px;
}
.field-row .field { flex: 1; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--ink-muted);
}

.btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 11px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 15px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    color: var(--ink);
}

.btn-row {
    display: flex;
    gap: 10px;
}
.btn-row .btn { flex: 1; }

.form-msg {
    font-size: 13px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    display: none;
}
.form-msg.show { display: block; }
.form-msg.error {
    background: var(--oppose-bg);
    color: var(--oppose);
}
.form-msg.success {
    background: var(--support-bg);
    color: var(--support);
}

.auth-foot {
    text-align: center;
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 18px;
}
.auth-foot a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: underline;
}

/* ---------- OTP input ---------- */
.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 18px;
}
.otp-inputs input {
    width: 44px;
    height: 52px;
    text-align: center;
    font-size: 22px;
    padding: 0;
}

/* ---------- Avatar ---------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}
.c-purple { background: #eeedfe; color: #3c3489; }
.c-teal   { background: #e1f5ee; color: #085041; }
.c-coral  { background: #faece7; color: #712b13; }
.c-pink   { background: #fbeaf0; color: #72243e; }
.c-blue   { background: #e6f1fb; color: #0c447c; }
.c-green  { background: #eaf3de; color: #27500a; }
.c-amber  { background: #faeeda; color: #633806; }

/* ---------- Custom scrollbars (replaces the default ugly browser scrollbar) ---------- */
.tab-panel-inner, .chat-messages, .notif-dropdown, .thumb-gallery,
#categoryBar, .opinion-feed, .multi-image-list {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}
.tab-panel-inner::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.notif-dropdown::-webkit-scrollbar,
.thumb-gallery::-webkit-scrollbar,
#categoryBar::-webkit-scrollbar,
.opinion-feed::-webkit-scrollbar,
.multi-image-list::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.tab-panel-inner::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.notif-dropdown::-webkit-scrollbar-track,
.thumb-gallery::-webkit-scrollbar-track,
#categoryBar::-webkit-scrollbar-track,
.opinion-feed::-webkit-scrollbar-track,
.multi-image-list::-webkit-scrollbar-track {
    background: transparent;
}
.tab-panel-inner::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.notif-dropdown::-webkit-scrollbar-thumb,
.thumb-gallery::-webkit-scrollbar-thumb,
#categoryBar::-webkit-scrollbar-thumb,
.opinion-feed::-webkit-scrollbar-thumb,
.multi-image-list::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 10px;
}
.tab-panel-inner:hover::-webkit-scrollbar-thumb,
.chat-messages:hover::-webkit-scrollbar-thumb {
    background: var(--ink-muted);
}

/* ---------- Admin ---------- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-header h1 { font-size: 22px; margin: 0; }
.btn-sm {
    display: inline-block;
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.topic-row {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}
.topic-row .thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--paper-soft);
    object-fit: cover;
    flex-shrink: 0;
}
.topic-row .meta { flex: 1; min-width: 0; }
.topic-row .meta p { margin: 0; }
.topic-row .title { font-weight: 600; font-size: 15px; }
.topic-row .sub { color: var(--ink-soft); font-size: 13px; }
.topic-row .actions { display: flex; gap: 8px; flex-shrink: 0; }

.pill {
    display: inline-block;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 20px;
    background: var(--neutral-bg);
    color: var(--neutral);
}

.admin-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 640px;
    box-shadow: var(--shadow-card);
}

.multi-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
.multi-image-list .thumb-wrap {
    position: relative;
    width: 70px;
    height: 70px;
}
.multi-image-list img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}
.multi-image-list .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--oppose);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    line-height: 20px;
    text-align: center;
    padding: 0;
}

.helper-text {
    font-size: 12px;
    color: var(--ink-muted);
    margin: 4px 0 0;
}

@media (max-width: 480px) {
    .topic-row { flex-wrap: wrap; }
    .topic-row .actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
}
@media (max-width: 480px) {
    .auth-card { padding: 24px 18px; }
    .field-row { flex-direction: column; gap: 0; }
    .otp-inputs input { width: 38px; height: 46px; font-size: 18px; }
}
.btn btn-sm{
    margin-bottom:100%;
}