/**
 * web3s-hoidap — component styles (auth, dashboard, blog, dark mode, mobile nav).
 */

/* Dark toggle only belongs in the header — hide any stray copy inside content. */
.question-card .dark-toggle,
.q-footer .dark-toggle,
.answer-item .dark-toggle,
.article-content .dark-toggle,
.wpqa_share .dark-toggle { display: none !important; }

/* ---------- Dark toggle ---------- */
.dark-toggle {
    background: var(--fb-bg); border: none; width: 40px; height: 40px; border-radius: 50%;
    cursor: pointer; color: var(--fb-text-2); font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
}
.dark-toggle:hover { background: var(--fb-divider); }

/* ---------- Social login ---------- */
.social-login { margin-top: 14px; }
.social-sep { display: flex; align-items: center; gap: 12px; color: var(--fb-text-2); font-size: 13px; margin: 14px 0; }
.social-sep::before, .social-sep::after { content: ""; flex: 1; height: 1px; background: var(--fb-divider); }
.social-btn { width: 100%; margin-bottom: 10px; color: #fff !important; }
.social-google { background: #ea4335; }
.social-google:hover { background: #d33b2c; }
.social-facebook { background: #1877f2; }
.social-facebook:hover { background: #166fe5; }

/* ---------- Auth forms/pages ---------- */
.auth-page { max-width: 460px; }
.web3s-auth-wrap { display: flex; justify-content: center; padding-top: 20px; }
.web3s-auth-card { width: 100%; max-width: 440px; }
.web3s-form-title { font-size: 22px; margin: 0 0 16px; text-align: center; }
.web3s-form .web3s-label { display: block; font-size: 14px; color: var(--fb-text-2); margin-bottom: 12px; font-weight: 600; }
.web3s-form .web3s-label input { display: block; width: 100%; margin-top: 5px; padding: 11px 14px; border: 1px solid var(--fb-border); border-radius: 8px; font-size: 15px; font-weight: 400; color: var(--fb-text); }
.web3s-form input:focus { border-color: var(--fb-blue); outline: none; }
.web3s-form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; }
.web3s-check { color: var(--fb-text-2); font-weight: 500; }
.web3s-form-msg { display: none; padding: 10px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.web3s-form-msg.is-error { display: block; background: #fde8e8; color: #c81e1e; }
.web3s-form-msg.is-ok { display: block; background: #e6f4ea; color: #137333; }
.web3s-form-alt { text-align: center; margin-top: 14px; color: var(--fb-text-2); }
.web3s-otp-row { display: flex; gap: 10px; align-items: flex-end; }
.web3s-otp-field { flex: 1; }
.web3s-send-otp { background: var(--fb-bg); color: var(--fb-text); white-space: nowrap; height: 44px; }
.web3s-send-otp:hover { background: var(--fb-divider); }
.web3s-captcha { margin: 8px 0 14px; }

/* ---------- Account dashboard ---------- */
.account-page { max-width: 1000px; }
.account-dashboard { display: flex; gap: 20px; align-items: flex-start; margin-top: 20px; }
.account-side { flex: 0 0 260px; }
.account-user { text-align: center; padding-bottom: 14px; border-bottom: 1px solid var(--fb-divider); margin-bottom: 12px; }
.account-avatar { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 8px; }
.account-user h3 { margin: 4px 0; }
.account-email { color: var(--fb-text-2); font-size: 13px; }
.account-nav { display: flex; flex-direction: column; gap: 2px; }
.account-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 8px; color: var(--fb-text); font-weight: 500; }
.account-nav a:hover, .account-nav a.active { background: var(--fb-bg); color: var(--fb-blue); }
.account-main { flex: 1 1 auto; min-width: 0; }
.account-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.stat-card { text-align: center; }
.stat-num { display: block; font-size: 28px; font-weight: 800; color: var(--fb-blue); }
.account-post-list { list-style: none; margin: 0; padding: 0; }
.account-post-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--fb-divider); }
.account-post-status { font-size: 12px; color: var(--fb-text-2); background: var(--fb-bg); padding: 2px 8px; border-radius: 20px; }

/* Facebook-style comment: hide author fields for guests — collected in a popup. */
body.web3s-guest-comment .comment-form-author,
body.web3s-guest-comment .comment-form-email,
body.web3s-guest-comment .comment-form-url,
body.web3s-guest-comment .comment-form-cookies-consent { display: none !important; }
/* Keep the answer/comment textarea prominent and rounded. */
#respond .comment-form-comment textarea,
#commentform textarea#comment { border-radius: 12px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--fb-text-2); margin: 4px 0 12px; padding: 0 4px;
}
.breadcrumbs a { color: var(--fb-text-2); font-weight: 500; }
.breadcrumbs a:hover { color: var(--fb-blue); }
.bc-sep { color: var(--fb-border); }
.bc-current { color: var(--fb-text); font-weight: 600; }

/* ---------- Feed tabs (front page) ---------- */
.feed-tabs { display: flex; gap: 6px; padding: 8px; }
.feed-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
    border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--fb-text-2);
}
.feed-tab:hover { background: var(--fb-bg); color: var(--fb-text-2); }
.feed-tab.active { background: #e7f0fd; color: var(--fb-blue); }
.feed-type-badge { color: var(--fb-text-2); font-weight: 600; }
.feed-post-card .q-body { width: 100%; }
.feed-post-thumb { display: block; margin: 4px 0 10px; border-radius: 10px; overflow: hidden; }
.feed-post-thumb img { width: 100%; max-height: 320px; object-fit: cover; display: block; }

/* ---------- Answers head + tabs (question page) ---------- */
.answers-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.answers-head .comments-title { margin: 0; }
.answers-tabs { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.answers-tabs li a {
    display: inline-block; padding: 6px 14px; border-radius: 20px;
    background: var(--fb-bg); color: var(--fb-text-2); font-size: 13px; font-weight: 600;
}
.answers-tabs li.active-tab a, .answers-tabs li a:hover { background: #e7f0fd; color: var(--fb-blue); }
.answer-pending { color: #8a6d00; background: #fef7e0; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.q-action.is-active { color: var(--fb-blue); }

/* FB answer composer: avatar + rounded box */
.fb-answer-box { display: flex; gap: 10px; align-items: flex-start; }
.fb-answer-box .answer-avatar { flex: 0 0 36px; border-radius: 50%; }
.fb-answer-box .answer-textarea { flex: 1; }

/* ---------- Ask composer extras ---------- */
.ask-guest-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ask-guest-row .web3s-label input { margin-top: 4px; }
.ask-row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.ask-row-2col .ask-cat-field, .ask-row-2col .ask-tags-field { margin-bottom: 0; }
.ask-tags-field { width: 100%; padding: 12px 14px; border: 1px solid var(--fb-border); border-radius: 8px; font-size: 15px; outline: none; }
.ask-tags-field:focus { border-color: var(--fb-blue); }
.ask-extras { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ask-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
    background: var(--fb-bg); border-radius: 20px; font-size: 14px; font-weight: 600;
    color: var(--fb-text-2); cursor: pointer;
}
.ask-chip input { accent-color: var(--fb-blue); }
.ask-chip:has(input:checked) { background: #e7f0fd; color: var(--fb-blue); }
.ask-poll-fields { margin-bottom: 14px; padding: 12px; border: 1px dashed var(--fb-border); border-radius: 10px; }
.ask-poll-item { margin-bottom: 8px; }
.ask-poll-item input[type="text"] { width: 100%; padding: 10px 12px; border: 1px solid var(--fb-border); border-radius: 8px; }
.ask-add-poll { background: var(--fb-bg); color: var(--fb-text); font-size: 13px; padding: 7px 14px; }
.req { color: #e53935; }
@media (max-width: 560px) {
    .ask-guest-row, .ask-row-2col { grid-template-columns: 1fr; }
}

/* ---------- Guest info popup ---------- */
.guest-info-content { max-width: 420px; }
.guest-info-hint { color: var(--fb-text-2); font-size: 14px; margin-bottom: 14px; }
.guest-field { margin-bottom: 12px; }
.guest-field label { display: block; font-size: 13px; color: var(--fb-text-2); margin-bottom: 4px; font-weight: 600; }
.guest-field input { width: 100%; padding: 10px 12px; border: 1px solid var(--fb-border); border-radius: 8px; font-size: 15px; }
.guest-info-error { color: #c81e1e; font-size: 14px; min-height: 18px; margin-bottom: 8px; }
.fb-answer-box .answer-textarea { border-radius: 20px; }

/* ---------- Blog / news ---------- */
.blog-cat { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--fb-blue); margin-bottom: 6px; }
.blog-hero { padding: 0; overflow: hidden; }
.blog-hero-thumb img { width: 100%; height: 340px; object-fit: cover; display: block; }
.blog-hero-body { padding: 20px; }
.blog-hero-title { font-size: 26px; margin: 6px 0 10px; line-height: 1.3; }
.blog-hero-title a { color: var(--fb-text); }
.blog-hero-excerpt { color: var(--fb-text-2); margin-bottom: 12px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.blog-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.blog-card-thumb img { width: 100%; height: 160px; object-fit: cover; display: block; }
.blog-card-body { padding: 14px 16px; }
.blog-card-title { font-size: 16px; margin: 4px 0 8px; line-height: 1.35; }
.blog-card-title a { color: var(--fb-text); }
.blog-card-title a:hover { color: var(--fb-blue); }
.blog-card-excerpt { color: var(--fb-text-2); font-size: 14px; margin: 0 0 8px; }
.blog-card--row { flex-direction: row; align-items: stretch; }
.blog-card--row .blog-card-thumb { flex: 0 0 200px; }
.blog-card--row .blog-card-thumb img { height: 100%; }
.post-meta { display: flex; align-items: center; gap: 6px; color: var(--fb-text-2); font-size: 13px; }
.post-meta-avatar { width: 24px; height: 24px; border-radius: 50%; }
.post-meta-author { font-weight: 600; color: var(--fb-text); }

/* Reading time badge + progress bar */
.reading-badge {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 10px; padding: 4px 12px; border-radius: 20px;
    background: var(--fb-bg); color: var(--fb-text-2); font-size: 13px; font-weight: 600;
}
.reading-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    background: transparent; z-index: 700; pointer-events: none;
}
.reading-progress span { display: block; height: 100%; width: 0; background: var(--fb-blue); transition: width .1s linear; }

/* Reader-friendly article measure */
.single-article { padding: 28px 32px; }
.single-article .article-content { max-width: 720px; }
.article-title { font-size: 30px; line-height: 1.25; margin: 8px 0 12px; }
.article-featured { margin: 16px -32px; }
.article-featured img { width: 100%; display: block; }
.article-content { font-size: 17px; line-height: 1.75; color: #1c1e21; }
.article-content p { margin: 0 0 1.2em; }
.article-content img { border-radius: 10px; margin: 1em 0; }
.article-content h2 { font-size: 24px; margin: 1.4em 0 .5em; }
.article-content h3 { font-size: 20px; margin: 1.2em 0 .5em; }
.article-tags { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.article-tag { background: var(--fb-bg); color: var(--fb-text-2); padding: 4px 12px; border-radius: 20px; font-size: 13px; }
.article-related { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--fb-divider); }
.article-related h3 { font-size: 18px; margin-bottom: 14px; }

/* Ads */
.web3s-ad { margin: 16px 0; text-align: center; }
.web3s-ad-header { padding: 8px 0; }

/* ---------- Mobile bottom nav ---------- */
.mobile-bottom-nav { display: none; }
.mbn-sheet { display: none; }
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
        background: #fff; border-top: 1px solid var(--fb-divider); box-shadow: 0 -2px 10px rgba(0,0,0,.06);
        justify-content: space-around; align-items: center; height: 58px; padding-bottom: env(safe-area-inset-bottom);
    }
    .mbn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: 1; background: none; border: none; color: var(--fb-text-2); font-size: 11px; cursor: pointer; }
    .mbn-item i { font-size: 18px; }
    .mbn-item.active, .mbn-item:hover { color: var(--fb-blue); }
    .mbn-fab {
        flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--fb-blue); color: #fff;
        margin-top: -18px; box-shadow: 0 6px 16px rgba(24,119,242,.4); font-size: 22px;
    }
    .mbn-fab i { font-size: 22px; }
    body { padding-bottom: 58px; }
    .site-footer { margin-bottom: 58px; }
}
.mbn-sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1500; align-items: flex-end; justify-content: center; }
.mbn-sheet[aria-hidden="false"] { display: flex; }
.mbn-sheet-inner { background: #fff; width: 100%; max-width: 500px; border-radius: 16px 16px 0 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mbn-sheet-btn { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: none; background: var(--fb-bg); border-radius: 10px; font-size: 16px; font-weight: 600; color: var(--fb-text); cursor: pointer; }
.mbn-sheet-btn:hover { background: var(--fb-divider); }
.mbn-sheet-cancel { padding: 12px; border: none; background: none; color: var(--fb-text-2); font-weight: 600; cursor: pointer; }

/* ---------- Footer ---------- */
.site-footer { background: #fff; border-top: 1px solid var(--fb-divider); margin-top: 24px; }
.footer-inner { padding: 28px 16px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer-title { font-size: 20px; font-weight: 800; color: var(--fb-blue); }
.footer-desc { color: var(--fb-text-2); font-size: 14px; margin: 4px 0 0; }
.footer-nav-list { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-nav-list a { color: var(--fb-text-2); font-weight: 500; }
.footer-copy { color: var(--fb-text-2); font-size: 13px; width: 100%; text-align: center; border-top: 1px solid var(--fb-divider); padding-top: 14px; }

/* ---------- Responsive tweaks ---------- */
@media (max-width: 768px) {
    .account-dashboard { flex-direction: column; }
    .account-side { flex-basis: 100%; width: 100%; }
    .blog-hero-thumb img { height: 220px; }
    .blog-card--row { flex-direction: column; }
    .blog-card--row .blog-card-thumb { flex-basis: auto; }
    .single-article { padding: 20px; }
    .article-title { font-size: 24px; }
    .article-featured { margin: 16px -20px; }
}

/* ============================================================
   DARK MODE
   ============================================================ */
body.web3s-dark-mode {
    --fb-bg: #18191a;
    --fb-white: #242526;
    --fb-text: #e4e6eb;
    --fb-text-2: #b0b3b8;
    --fb-border: #3a3b3c;
    --fb-divider: #3a3b3c;
    background: #18191a;
    color: var(--fb-text);
}
body.web3s-dark-mode .card,
body.web3s-dark-mode .site-header,
body.web3s-dark-mode .user-dropdown,
body.web3s-dark-mode .mobile-nav-drawer,
body.web3s-dark-mode .live-results,
body.web3s-dark-mode .mobile-bottom-nav,
body.web3s-dark-mode .mbn-sheet-inner,
body.web3s-dark-mode .site-footer { background: #242526; color: var(--fb-text); }
body.web3s-dark-mode .q-title a,
body.web3s-dark-mode .q-author,
body.web3s-dark-mode .blog-card-title a,
body.web3s-dark-mode .blog-hero-title a,
body.web3s-dark-mode .article-title,
body.web3s-dark-mode .user-trigger { color: var(--fb-text); }
body.web3s-dark-mode .q-content,
body.web3s-dark-mode .answer-content,
body.web3s-dark-mode .article-content { color: #d0d3d8; }
body.web3s-dark-mode .search-field,
body.web3s-dark-mode .ask-fake-input,
body.web3s-dark-mode .web3s-form input,
body.web3s-dark-mode .guest-field input,
body.web3s-dark-mode .ask-title-field,
body.web3s-dark-mode .ask-cat-field,
body.web3s-dark-mode .answer-textarea { background: #3a3b3c; color: var(--fb-text); border-color: #4a4b4c; }
body.web3s-dark-mode .answer-item { border-color: #3a3b3c; background: #242526; box-shadow: none; }
body.web3s-dark-mode .answer-best { background: linear-gradient(180deg, #16311f 0%, #242526 70%); border-color: var(--fb-green); }
body.web3s-dark-mode .answer-vote { background: #3a3b3c; }
body.web3s-dark-mode .answer-actions a,
body.web3s-dark-mode .answer-actions .comment-reply-link,
body.web3s-dark-mode .report-answer,
body.web3s-dark-mode .edit-answer { background: #3a3b3c; color: var(--fb-text-2); }
body.web3s-dark-mode .mark-best-answer { background: #1c3a24; color: #6ee7a0; }
body.web3s-dark-mode .pagination .page-numbers { background: #3a3b3c; color: var(--fb-text); }
body.web3s-dark-mode .feed-tab.active,
body.web3s-dark-mode .answers-tabs li.active-tab a,
body.web3s-dark-mode .ask-chip:has(input:checked) { background: #263951; color: #6cb2ff; }
body.web3s-dark-mode .hdr-ico-btn { background: #3a3b3c; color: var(--fb-text-2); }
body.web3s-dark-mode .hdr-ico.open .hdr-ico-btn { background: #263951; color: #6cb2ff; }
body.web3s-dark-mode .points-chip { background: #3d3320; color: #ffd479 !important; }
body.web3s-dark-mode .bc-current { color: var(--fb-text); }
body.web3s-dark-mode .feed-tabs { background: #242526; }
