/* =============================================================================
   WPQA Custom Enhancements - v2.0
   Facebook-inspired, Responsive, Dark-mode aware
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. CSS VARIABLES & THEME TOKENS
   --------------------------------------------------------------------------- */
:root {
    --wpqa-bg:              #f0f2f5;
    --wpqa-surface:         #ffffff;
    --wpqa-surface-2:       #f7f8fa;
    --wpqa-border:          #dde1e7;
    --wpqa-text-primary:    #1c1e21;
    --wpqa-text-secondary:  #65676b;
    --wpqa-text-muted:      #8a8d91;
    --wpqa-primary:         #1877f2;
    --wpqa-primary-hover:   #1466d8;
    --wpqa-primary-light:   #e7f0fd;
    --wpqa-success:         #2d9259;
    --wpqa-danger:          #e03e2d;
    --wpqa-warning:         #f0a500;
    --wpqa-radius-sm:       6px;
    --wpqa-radius:          8px;
    --wpqa-radius-lg:       12px;
    --wpqa-radius-full:     9999px;
    --wpqa-shadow-sm:       0 1px 3px rgba(0,0,0,.08);
    --wpqa-shadow:          0 2px 8px rgba(0,0,0,.10);
    --wpqa-shadow-lg:       0 4px 20px rgba(0,0,0,.14);
    --wpqa-transition:      all 0.18s ease;
    --wpqa-avatar-size:     40px;
    --wpqa-avatar-size-lg:  52px;
}

/* DARK MODE */
[data-theme="dark"] {
    --wpqa-bg:              #18191a;
    --wpqa-surface:         #242526;
    --wpqa-surface-2:       #3a3b3c;
    --wpqa-border:          #393a3b;
    --wpqa-text-primary:    #e4e6eb;
    --wpqa-text-secondary:  #b0b3b8;
    --wpqa-text-muted:      #8a8d91;
    --wpqa-primary:         #2d88ff;
    --wpqa-primary-hover:   #1877f2;
    --wpqa-primary-light:   #1a2d47;
    --wpqa-shadow-sm:       0 1px 3px rgba(0,0,0,.3);
    --wpqa-shadow:          0 2px 8px rgba(0,0,0,.35);
    --wpqa-shadow-lg:       0 4px 20px rgba(0,0,0,.45);
}

/* ---------------------------------------------------------------------------
   2. GLOBAL RESET & BASE
   --------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--wpqa-bg) !important;
    color: var(--wpqa-text-primary) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] body,
[data-theme="dark"] .site-wrapper,
[data-theme="dark"] #main-wrapper {
    background-color: var(--wpqa-bg) !important;
}

/* Text color overrides for dark mode */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] .post-title,
[data-theme="dark"] .post-title a,
[data-theme="dark"] .post-author {
    color: var(--wpqa-text-primary) !important;
}

[data-theme="dark"] a {
    color: var(--wpqa-primary) !important;
}

[data-theme="dark"] .post-meta,
[data-theme="dark"] .post-meta *,
[data-theme="dark"] .wpqa-reading-time,
[data-theme="dark"] time {
    color: var(--wpqa-text-secondary) !important;
}

/* ---------------------------------------------------------------------------
   3. CARD / FEED ITEMS (Facebook-style)
   --------------------------------------------------------------------------- */
.article-question,
.article-post,
.wpqa-templates,
.post-type-question .hentry,
.discy-card {
    background-color: var(--wpqa-surface) !important;
    border-radius: var(--wpqa-radius) !important;
    border: 1px solid var(--wpqa-border) !important;
    box-shadow: var(--wpqa-shadow-sm) !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
    transition: var(--wpqa-transition);
    overflow: hidden;
}

.article-question:hover,
.article-post:hover {
    box-shadow: var(--wpqa-shadow) !important;
    border-color: #c8ccd0 !important;
}

[data-theme="dark"] .article-question,
[data-theme="dark"] .article-post,
[data-theme="dark"] .wpqa-templates {
    border-color: var(--wpqa-border) !important;
}

[data-theme="dark"] .article-question:hover,
[data-theme="dark"] .article-post:hover {
    border-color: #555 !important;
}

/* ---------------------------------------------------------------------------
   4. AVATAR SYSTEM — Circular with graceful fallback placeholder
   --------------------------------------------------------------------------- */
.avatar,
.avatar-img,
.question-image-vote img,
.wpqa_action_avatar img,
.post-avatar img,
.user-avatar img,
img.avatar {
    border-radius: var(--wpqa-radius-full) !important;
    object-fit: cover;
    width: var(--wpqa-avatar-size);
    height: var(--wpqa-avatar-size);
    flex-shrink: 0;
    border: 2px solid var(--wpqa-border) !important;
    background-color: var(--wpqa-surface-2);
    display: block;
}

/* Avatar placeholder when no image available */
.wpqa-avatar-placeholder,
.question-image-vote .wpqa-avatar-placeholder,
.no-avatar-img {
    width: var(--wpqa-avatar-size);
    height: var(--wpqa-avatar-size);
    border-radius: var(--wpqa-radius-full);
    background: linear-gradient(135deg, #c9d6e8 0%, #a8b9d0 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #4a5568;
    border: 2px solid var(--wpqa-border);
    flex-shrink: 0;
    letter-spacing: 0;
    user-select: none;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.wpqa-avatar-placeholder::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
}

.wpqa-avatar-placeholder svg {
    width: 22px;
    height: 22px;
    fill: rgba(255,255,255,0.85);
    position: relative;
    z-index: 1;
}

/* Large avatar variant */
.avatar-lg,
.profile-avatar img,
.author-avatar img {
    --wpqa-avatar-size: var(--wpqa-avatar-size-lg);
}

/* ---------------------------------------------------------------------------
   5. FEATURED IMAGE PLACEHOLDER (When no thumbnail set)
   --------------------------------------------------------------------------- */
.wpqa-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--wpqa-surface-2) 0%, var(--wpqa-border) 100%);
    border-radius: var(--wpqa-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--wpqa-text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.wpqa-thumb-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,.03) 10px,
        rgba(255,255,255,.03) 20px
    );
}

.wpqa-thumb-placeholder svg {
    width: 40px;
    height: 40px;
    fill: var(--wpqa-text-muted);
    opacity: 0.5;
}

[data-theme="dark"] .wpqa-thumb-placeholder {
    background: linear-gradient(135deg, #2d2e30 0%, #3a3b3c 100%);
}

/* ---------------------------------------------------------------------------
   6. META & AUTHOR HEADER
   --------------------------------------------------------------------------- */
.post-author {
    font-weight: 600 !important;
    color: var(--wpqa-text-primary) !important;
    font-size: 0.93rem !important;
    text-decoration: none !important;
    transition: color 0.15s;
}

.post-author:hover {
    color: var(--wpqa-primary) !important;
    text-decoration: none !important;
}

.post-meta,
.post-meta * {
    color: var(--wpqa-text-secondary) !important;
    font-size: 0.78rem !important;
}

.post-title,
.post-title a {
    color: var(--wpqa-text-primary) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    margin: 6px 0 10px !important;
    text-decoration: none !important;
    display: block;
}

.post-title a:hover {
    color: var(--wpqa-primary) !important;
    text-decoration: none !important;
}

/* ---------------------------------------------------------------------------
   7. FACEBOOK REACTION BAR
   --------------------------------------------------------------------------- */
.question-footer {
    border-top: 1px solid var(--wpqa-border) !important;
    padding-top: 4px !important;
    margin-top: 12px !important;
}

.footer-meta {
    display: flex !important;
    justify-content: stretch !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 2px;
}

.footer-meta > li {
    flex: 1 1 0;
    min-width: 0;
}

.footer-meta > li > a,
.footer-meta > li > span,
.votes-meta,
.view-stats-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    padding: 8px 4px !important;
    color: var(--wpqa-text-secondary) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    border-radius: var(--wpqa-radius-sm) !important;
    transition: var(--wpqa-transition) !important;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-meta > li > a:hover,
.votes-meta:hover {
    background-color: var(--wpqa-surface-2) !important;
    color: var(--wpqa-primary) !important;
}

/* Reaction vote up highlight */
.footer-meta .voted > a,
.footer-meta .vote-up.voted,
.wpqa-voted-up {
    color: var(--wpqa-primary) !important;
}

/* ---------------------------------------------------------------------------
   8. SIDEBAR
   --------------------------------------------------------------------------- */
.sidebar .widget,
.sidebar-inner .widget {
    background-color: var(--wpqa-surface) !important;
    border-radius: var(--wpqa-radius) !important;
    border: 1px solid var(--wpqa-border) !important;
    box-shadow: var(--wpqa-shadow-sm) !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
}

[data-theme="dark"] .sidebar .widget,
[data-theme="dark"] .sidebar-inner .widget {
    background-color: var(--wpqa-surface) !important;
    border-color: var(--wpqa-border) !important;
}

.widget-title,
.widget h3 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--wpqa-text-primary) !important;
    margin-bottom: 12px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid var(--wpqa-primary) !important;
    display: inline-block;
}

/* ---------------------------------------------------------------------------
   9. READING PROGRESS BAR
   --------------------------------------------------------------------------- */
#wpqa-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--wpqa-primary), #5ea3ff);
    z-index: 99999;
    transition: width 0.08s linear;
    border-radius: 0 3px 3px 0;
}

/* ---------------------------------------------------------------------------
   10. TABLE OF CONTENTS (TOC) — Only on supported pages
   --------------------------------------------------------------------------- */
.wpqa-toc-container {
    background-color: var(--wpqa-surface) !important;
    border: 1px solid var(--wpqa-border);
    border-left: 3px solid var(--wpqa-primary);
    border-radius: var(--wpqa-radius);
    padding: 16px 20px;
    margin: 20px 0 24px;
    box-shadow: var(--wpqa-shadow-sm);
}

[data-theme="dark"] .wpqa-toc-container {
    background-color: var(--wpqa-surface) !important;
    border-color: var(--wpqa-border);
    border-left-color: var(--wpqa-primary);
}

.wpqa-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.wpqa-toc-title {
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--wpqa-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpqa-toc-title::before {
    content: '☰';
    font-size: 0.9em;
    color: var(--wpqa-primary);
}

.wpqa-toc-toggle {
    background: none;
    border: none;
    color: var(--wpqa-text-secondary);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: var(--wpqa-transition);
}

.wpqa-toc-toggle:hover {
    background: var(--wpqa-surface-2);
    color: var(--wpqa-primary);
}

.wpqa-toc-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 600px;
}

.wpqa-toc-body.collapsed {
    max-height: 0;
}

.wpqa-toc-list {
    list-style: none;
    padding: 12px 0 0;
    margin: 0;
}

.wpqa-toc-list .wpqa-toc-list {
    padding: 4px 0 0 16px;
    border-left: 1px dashed var(--wpqa-border);
    margin-left: 6px;
    margin-top: 4px;
}

.wpqa-toc-item {
    margin: 3px 0;
}

.wpqa-toc-link {
    color: var(--wpqa-text-secondary);
    text-decoration: none;
    transition: var(--wpqa-transition);
    font-size: 0.88rem;
    line-height: 1.5;
    display: block;
    padding: 2px 4px;
    border-radius: 3px;
}

.wpqa-toc-link:hover {
    color: var(--wpqa-primary);
    background: var(--wpqa-primary-light);
    padding-left: 8px;
}

.wpqa-toc-link.active {
    color: var(--wpqa-primary) !important;
    font-weight: 600;
    background: var(--wpqa-primary-light);
    padding-left: 8px;
}

/* ---------------------------------------------------------------------------
   11. STICKY TOC BAR
   --------------------------------------------------------------------------- */
#wpqa-sticky-toc-bar {
    position: fixed;
    top: -60px;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: var(--wpqa-surface);
    border-bottom: 1px solid var(--wpqa-border);
    box-shadow: var(--wpqa-shadow);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    transition: top 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#wpqa-sticky-toc-bar.visible {
    top: 0;
}

.sticky-toc-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--wpqa-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.sticky-toc-dropdown {
    position: relative;
}

.sticky-toc-btn {
    background-color: var(--wpqa-primary);
    color: white !important;
    border: none;
    padding: 5px 12px;
    border-radius: var(--wpqa-radius-full);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--wpqa-transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sticky-toc-btn:hover {
    background-color: var(--wpqa-primary-hover);
    transform: translateY(-1px);
}

.sticky-toc-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background-color: var(--wpqa-surface);
    border: 1px solid var(--wpqa-border);
    border-radius: var(--wpqa-radius);
    box-shadow: var(--wpqa-shadow-lg);
    width: 280px;
    max-height: 340px;
    overflow-y: auto;
    z-index: 10000;
}

.sticky-toc-menu.open {
    display: block;
    animation: dropDown 0.18s ease;
}

@keyframes dropDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sticky-toc-menu ul {
    list-style: none;
    padding: 6px 0;
    margin: 0;
}

.sticky-toc-menu li a {
    display: block;
    padding: 7px 16px;
    color: var(--wpqa-text-secondary) !important;
    text-decoration: none;
    font-size: 0.86rem;
    transition: var(--wpqa-transition);
    border-left: 2px solid transparent;
}

.sticky-toc-menu li a:hover {
    background-color: var(--wpqa-primary-light);
    color: var(--wpqa-primary) !important;
    border-left-color: var(--wpqa-primary);
}

.sticky-toc-menu li.depth-2 > a {
    padding-left: 28px;
    font-size: 0.82rem;
}

.sticky-toc-menu li.depth-3 > a {
    padding-left: 40px;
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------------------
   12. AUTH FORMS (Login, Register)
   --------------------------------------------------------------------------- */
.wpqa-login-template,
.wpqa-signup-template,
.wpqa-question-template {
    max-width: 460px;
    margin: 40px auto;
    background-color: var(--wpqa-surface) !important;
    border: 1px solid var(--wpqa-border);
    border-radius: var(--wpqa-radius-lg);
    padding: 32px;
    box-shadow: var(--wpqa-shadow);
}

[data-theme="dark"] .wpqa-login-template,
[data-theme="dark"] .wpqa-signup-template {
    background-color: var(--wpqa-surface) !important;
    border-color: var(--wpqa-border) !important;
}

.wpqa-login-template form,
.wpqa-signup-template form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wpqa-login-template input[type="text"],
.wpqa-login-template input[type="email"],
.wpqa-login-template input[type="password"],
.wpqa-signup-template input[type="text"],
.wpqa-signup-template input[type="email"],
.wpqa-signup-template input[type="password"] {
    border-radius: var(--wpqa-radius-sm) !important;
    padding: 11px 14px !important;
    font-size: 0.93rem !important;
    border: 1px solid var(--wpqa-border) !important;
    background: var(--wpqa-surface-2) !important;
    color: var(--wpqa-text-primary) !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.wpqa-login-template input:focus,
.wpqa-signup-template input:focus {
    border-color: var(--wpqa-primary) !important;
    box-shadow: 0 0 0 3px rgba(24,119,242,0.15) !important;
    outline: none;
}

.wpqa-login-template button,
.wpqa-login-template input[type="submit"],
.wpqa-signup-template button,
.wpqa-signup-template input[type="submit"] {
    background-color: var(--wpqa-primary) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    padding: 12px !important;
    border-radius: var(--wpqa-radius-sm) !important;
    cursor: pointer;
    transition: var(--wpqa-transition);
    width: 100%;
    letter-spacing: 0.01em;
}

.wpqa-login-template button:hover,
.wpqa-login-template input[type="submit"]:hover,
.wpqa-signup-template button:hover,
.wpqa-signup-template input[type="submit"]:hover {
    background-color: var(--wpqa-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24,119,242,0.35) !important;
}

/* ---------------------------------------------------------------------------
   13. READING TIME BADGE
   --------------------------------------------------------------------------- */
.wpqa-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--wpqa-text-muted);
    font-size: 0.8rem;
    background: var(--wpqa-surface-2);
    border: 1px solid var(--wpqa-border);
    padding: 3px 10px;
    border-radius: var(--wpqa-radius-full);
    margin: 6px 0 10px;
}

.wpqa-reading-time svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   14. DARK MODE TOGGLE BUTTON
   --------------------------------------------------------------------------- */
.wpqa-dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--wpqa-surface);
    border: 1px solid var(--wpqa-border);
    color: var(--wpqa-text-primary) !important;
    padding: 8px 18px;
    border-radius: var(--wpqa-radius-full);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 8px;
    box-shadow: var(--wpqa-shadow-sm);
    transition: var(--wpqa-transition);
    margin: 16px auto;
    text-decoration: none;
}

.wpqa-dark-mode-toggle:hover {
    background-color: var(--wpqa-primary-light);
    border-color: var(--wpqa-primary);
    color: var(--wpqa-primary) !important;
    transform: translateY(-1px);
}

[data-theme="dark"] .wpqa-dark-mode-toggle {
    background-color: var(--wpqa-surface-2);
    border-color: var(--wpqa-border);
}

/* ---------------------------------------------------------------------------
   15. ADVERTISEMENT ZONES
   --------------------------------------------------------------------------- */
.wpqa-ad-zone {
    display: block;
    overflow: hidden;
    border-radius: var(--wpqa-radius);
    text-decoration: none;
    transition: var(--wpqa-transition);
    position: relative;
}

/* Image ad */
.wpqa-ad-image-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--wpqa-radius);
}

.wpqa-ad-image-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.wpqa-ad-image-wrap:hover img {
    transform: scale(1.02);
}

.wpqa-ad-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    pointer-events: none;
}

/* Text ad */
.wpqa-ad-text-wrap {
    background: linear-gradient(135deg, #1877f2 0%, #0d5cbf 100%);
    border-radius: var(--wpqa-radius);
    padding: 20px 24px;
    color: #fff;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
    transition: var(--wpqa-transition);
}

.wpqa-ad-text-wrap::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}

.wpqa-ad-text-wrap:hover {
    transform: translateY(-2px);
    box-shadow: var(--wpqa-shadow-lg) !important;
}

.wpqa-ad-sponsor-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.75;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
    color: rgba(255,255,255,0.85) !important;
}

.wpqa-ad-text-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff !important;
    margin: 0 0 4px;
    line-height: 1.35;
}

.wpqa-ad-text-desc {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85) !important;
    line-height: 1.5;
    margin: 0;
}

.wpqa-ad-text-cta {
    display: inline-block;
    margin-top: 12px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff !important;
    padding: 5px 14px;
    border-radius: var(--wpqa-radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.2s;
}

.wpqa-ad-text-cta:hover {
    background: rgba(255,255,255,0.28);
}

/* Video ad */
.wpqa-ad-video-wrap {
    border-radius: var(--wpqa-radius);
    overflow: hidden;
    position: relative;
    background: #000;
    line-height: 0;
}

.wpqa-ad-video-wrap video {
    width: 100%;
    display: block;
    border-radius: var(--wpqa-radius);
}

.wpqa-ad-video-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.5);
    padding: 2px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* Header & footer ad containers */
.wpqa-ad-header-zone {
    width: 100%;
    text-align: center;
    padding: 12px 0;
    background: var(--wpqa-surface);
    border-bottom: 1px solid var(--wpqa-border);
}

.wpqa-ad-footer-zone {
    width: 100%;
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--wpqa-border);
}

.wpqa-ad-content-zone {
    margin: 20px 0;
}

.wpqa-ad-sidebar-zone {
    margin-bottom: 16px;
}

/* ---------------------------------------------------------------------------
   16. FORMS & INPUTS (General)
   --------------------------------------------------------------------------- */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background-color: var(--wpqa-surface-2) !important;
    color: var(--wpqa-text-primary) !important;
    border-color: var(--wpqa-border) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--wpqa-text-muted) !important;
}

/* ---------------------------------------------------------------------------
   17. NAVIGATION & HEADER
   --------------------------------------------------------------------------- */
[data-theme="dark"] #header,
[data-theme="dark"] .header-wrapper,
[data-theme="dark"] .site-header {
    background-color: var(--wpqa-surface) !important;
    border-bottom-color: var(--wpqa-border) !important;
}

[data-theme="dark"] .header-menu a,
[data-theme="dark"] .nav-menu a,
[data-theme="dark"] .main-navigation a {
    color: var(--wpqa-text-primary) !important;
}

/* ---------------------------------------------------------------------------
   18. RESPONSIVE DESIGN
   --------------------------------------------------------------------------- */

/* Large desktop */
@media (min-width: 1200px) {
    .wpqa-toc-container {
        max-width: 720px;
    }
}

/* Tablet landscape */
@media (max-width: 1024px) {
    .article-question,
    .article-post {
        padding: 14px !important;
    }

    #wpqa-sticky-toc-bar {
        padding: 0 16px;
    }

    .sticky-toc-menu {
        width: 240px;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    :root {
        --wpqa-avatar-size: 36px;
        --wpqa-avatar-size-lg: 44px;
    }

    body {
        font-size: 14px;
    }

    .article-question,
    .article-post {
        border-radius: 0 !important;
        margin-bottom: 8px !important;
        border-left: none !important;
        border-right: none !important;
    }

    .wpqa-login-template,
    .wpqa-signup-template {
        margin: 0;
        border-radius: 0;
        border: none;
        padding: 24px 16px;
        box-shadow: none;
    }

    .wpqa-toc-container {
        margin: 16px 0;
        padding: 14px 16px;
    }

    .sticky-toc-title {
        max-width: 50%;
        font-size: 0.82rem;
    }

    .sticky-toc-menu {
        width: calc(100vw - 32px);
        right: -60px;
        max-width: 320px;
    }

    .footer-meta > li > a,
    .footer-meta > li > span {
        font-size: 0.78rem !important;
        padding: 7px 2px !important;
        gap: 4px;
    }

    .post-title,
    .post-title a {
        font-size: 1rem !important;
    }

    .wpqa-ad-text-wrap {
        padding: 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --wpqa-avatar-size: 32px;
    }

    #wpqa-sticky-toc-bar {
        padding: 0 12px;
        height: 46px;
    }

    .sticky-toc-btn {
        font-size: 0.74rem;
        padding: 4px 10px;
    }

    .sticky-toc-title {
        font-size: 0.78rem;
        max-width: 45%;
    }

    .sticky-toc-menu {
        right: -70px;
    }

    .footer-meta > li > a .footer-meta-text {
        display: none;
    }

    .footer-meta > li > a,
    .footer-meta > li > span {
        padding: 8px 0 !important;
    }

    .wpqa-ad-text-title {
        font-size: 0.92rem;
    }

    .wpqa-reading-time {
        font-size: 0.75rem;
    }
}

/* Print styles */
@media print {
    #wpqa-reading-progress,
    #wpqa-sticky-toc-bar,
    .wpqa-dark-mode-toggle,
    .wpqa-ad-zone,
    .wpqa-ad-header-zone,
    .wpqa-ad-footer-zone,
    .wpqa-ad-content-zone,
    .wpqa-ad-sidebar-zone {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------------
   19. UTILITY CLASSES
   --------------------------------------------------------------------------- */
.wpqa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.wpqa-text-primary   { color: var(--wpqa-text-primary) !important; }
.wpqa-text-secondary { color: var(--wpqa-text-secondary) !important; }
.wpqa-text-muted     { color: var(--wpqa-text-muted) !important; }
.wpqa-surface        { background-color: var(--wpqa-surface) !important; }
