/**
 * Dark theme overrides for blade partials, inline utility classes, and component CSS gaps.
 * Loaded after dark-theme-pages.css
 */

/* ── Site-wide Bootstrap utilities (outside #container too) ── */
html.dark-theme .bg-light:not(.btn):not(.badge) {
    background-color: var(--dt-surface-2, #1f2937) !important;
}

html.dark-theme .border-light {
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .border-light-subtle {
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .modal-header.bg-light,
html.dark-theme .modal-footer.bg-light {
    background-color: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .modal-header.bg-light .modal-title.text-dark {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .modal .form-select.bg-light,
html.dark-theme .modal .form-control.bg-light,
html.dark-theme .modal .form-select.border-light,
html.dark-theme .modal .form-control.border-light {
    background-color: var(--dt-surface, #262626) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .badge.bg-light.text-dark,
html.dark-theme .abad-home .badge.bg-light.text-dark {
    color: #cbd5e1 !important;
}

html.dark-theme .badge.bg-light.text-primary {
    color: #93c5fd !important;
}

html.dark-theme .badge.bg-light.text-muted {
    color: #94a3b8 !important;
}

/* ── Comments (comment.css gaps) ── */
html.dark-theme .reddit-comments-master-container {
    background-color: transparent !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .nested-reply-form-master-box,
html.dark-theme .nested-reply-form-master-box.bg-light {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .reddit-comments-master-container .cmt-btn--cancel {
    background-color: var(--dt-surface, #262626) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .reddit-comments-master-container .cmt-btn--cancel:hover:not(:disabled) {
    background-color: var(--dt-surface-3, #374151) !important;
    border-color: #4b5563 !important;
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .reddit-comments-master-container .vote-trigger-btn:hover {
    background-color: var(--dt-surface-3, #374151) !important;
}

html.dark-theme .reddit-comments-master-container .comment-avatar-node-circle {
    border-color: var(--dt-surface, #262626) !important;
}

html.dark-theme .tnews-comments-toolbar .input-group-text.bg-white {
    background-color: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .tnews-toc-header-bar {
    border-bottom-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .tnews-toc-main-title {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .tnews-toc-anchor-link {
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .custom-modal .modal-title {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .custom-modal .modal-subtitle {
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .custom-modal .list-group-item:hover {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .modal-infographic {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .modern-close-btn {
    background: var(--dt-surface, #262626) !important;
    color: var(--dt-text, #e2e8f0) !important;
}

/* ── Sidebar poll widget (remaining light chips) ── */
html.dark-theme .abad-sidebar-poll__letter {
    background: var(--dt-surface-3, #374151) !important;
    color: #c7d2fe !important;
}

html.dark-theme .abad-sidebar-poll__radio:checked + .abad-sidebar-poll__option-label .abad-sidebar-poll__letter {
    background: #6366f1 !important;
    color: #fff !important;
}

html.dark-theme .abad-sidebar-poll__option-text {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .abad-sidebar-poll__radio:checked + .abad-sidebar-poll__option-label .abad-sidebar-poll__option-text {
    color: #e0e7ff !important;
}

html.dark-theme .abad-sidebar-poll__hint,
html.dark-theme .abad-sidebar-poll__auth-note,
html.dark-theme .abad-sidebar-poll__ended {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .abad-sidebar-poll__result-text {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .abad-sidebar-poll__result-text .abad-sidebar-poll__letter {
    background: var(--dt-surface-3, #374151) !important;
}

html.dark-theme .abad-sidebar-poll__result-row.is-winner {
    background: rgba(34, 197, 94, 0.1) !important;
}

/* ── Trivia quiz (blog-trivia-quiz.css) ── */
html.dark-theme .abad-quiz__header {
    background: var(--dt-surface-2, #1f2937) !important;
    border-bottom-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .abad-quiz__brand-label,
html.dark-theme .abad-quiz__question-text {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .abad-quiz__stat,
html.dark-theme .abad-quiz__timer {
    background: var(--dt-surface, #262626) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .abad-quiz__option-letter {
    background: var(--dt-surface-3, #374151) !important;
    color: #c7d2fe !important;
}

html.dark-theme .abad-quiz__option:hover:not(.correct-answer-opt):not(.wrong-answer-opt) {
    background: var(--dt-accent-soft, rgba(99, 102, 241, 0.15)) !important;
}

html.dark-theme .abad-quiz__footer {
    background: var(--dt-surface-2, #1f2937) !important;
    border-top-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .abad-quiz__btn--ghost {
    background: var(--dt-surface, #262626) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .abad-quiz__btn--ghost:not(:disabled):hover {
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
    background: var(--dt-accent-soft, rgba(99, 102, 241, 0.15)) !important;
}

html.dark-theme .abad-quiz-result__card,
html.dark-theme .abad-quiz__result-card {
    background: var(--dt-surface, #262626) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3) !important;
}

html.dark-theme .abad-quiz-result__title,
html.dark-theme .abad-quiz-result__pct {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .abad-quiz-result__desc,
html.dark-theme .abad-quiz-result__stat-label {
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .abad-quiz-result__stat {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

/* ── Blog post lists (posts_list_styles.blade.php text) ── */
html.dark-theme .posts-category-hero .author-name,
html.dark-theme .posts-category-hero .author-desig {
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .posts-category-hero .author-text {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .post-card-body,
html.dark-theme .post-card-item .blog-content {
    color: var(--dt-text, #e2e8f0);
}

/* ── User profile (user_profile_page_styles.blade.php gaps) ── */
html.dark-theme .user-profile-author-banner {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(99, 102, 241, 0.35) !important;
}

html.dark-theme .user-profile-author-banner p {
    color: #a5b4fc !important;
}

html.dark-theme .user-profile-sidebar-card h3 {
    color: var(--dt-text, #e2e8f0) !important;
}

/* ── Authors directory (authors_page_styles.blade.php gaps) ── */
html.dark-theme .author-directory-stats {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme .author-directory-stats span {
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme .author-directory-stats strong {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .author-directory-stars {
    color: var(--dt-muted, #94a3b8);
}

/* ── Forum tailwind_head residual whites ── */
html.dark-theme #forum-tw .forum-dropdown-item:hover,
html.dark-theme #forum-tw .forum-dropdown-item:focus {
    background: var(--dt-surface-2, #1f2937) !important;
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme #forum-tw .forum-dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
}

html.dark-theme #forum-tw .forum-vote button:hover {
    background: var(--dt-surface-3, #374151) !important;
    color: #a5b4fc !important;
}

html.dark-theme #forum-tw .forum-civis-section-count {
    background: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-muted, #94a3b8) !important;
}

html.dark-theme #forum-tw .forum-civis-stats-list__row {
    border-bottom-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme #forum-tw .forum-civis-stats-list__row dd {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme #forum-tw .forum-civis-search-hit {
    border-bottom-color: var(--dt-border, #3f3f46) !important;
}

html.dark-theme #forum-tw .forum-civis-panel__title {
    color: var(--dt-text, #e2e8f0) !important;
    border-bottom-color: var(--dt-border, #3f3f46) !important;
}

/* ── Article meta QR block (meta.blade.php) ── */
html.dark-theme .blog-meta .bg-light.border-light {
    background-color: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
}

/* ── Poll voters modal inline title color ── */
html.dark-theme #votersModal .modal-title[style*="color"] {
    color: var(--dt-text, #e2e8f0) !important;
}

/* ── Members-only article gate (auth-required-gate.blade.php) ── */
html.dark-theme .blog-auth-required-gate {
    background: linear-gradient(180deg, rgba(255, 193, 7, 0.08) 0%, var(--dt-surface, #262626) 100%) !important;
    border-color: rgba(255, 193, 7, 0.25) !important;
}

html.dark-theme .blog-auth-required-gate h4.text-dark {
    color: var(--dt-text, #e2e8f0) !important;
}

/* ── Forum / comment report modals (report_modal, layout-modals) ── */
html.dark-theme #reportModal .custom-option,
html.dark-theme #commentReportSystemModal .custom-option {
    border-color: var(--dt-border, #3f3f46) !important;
    background: var(--dt-surface-2, #1f2937) !important;
}

html.dark-theme #reportModal .custom-option:hover {
    background: var(--dt-surface-3, #374151) !important;
    border-color: #4b5563 !important;
}

html.dark-theme #reportModal .modal-title.text-dark {
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .btn-light {
    background-color: var(--dt-surface-2, #1f2937) !important;
    border-color: var(--dt-border, #3f3f46) !important;
    color: var(--dt-text, #e2e8f0) !important;
}

html.dark-theme .btn-light:hover {
    background-color: var(--dt-surface-3, #374151) !important;
    border-color: #4b5563 !important;
    color: var(--dt-text, #e2e8f0) !important;
}
