/* ==========================================================================
   SYT mob - Forum Design System
   Matches landing.css: Dark Navy Theme (#01051b), Primary Accent (#288eff), Inter Font
   Zero Emojis - Powered by Lucide SVG Icons
   RNF21: Responsividade Mobile-Friendly
   RNF22: Acessibilidade WCAG 2.1 AA
   RNF23: Temas Claro e Escuro (Light / Dark Mode)
   ========================================================================== */

/* Theme Variables (RNF23) */
:root,
[data-theme="dark"] {
    --primary: #288eff;
    --primary-hover: #1e70cc;
    --accent: #288eff;
    --accent-hover: #1e70cc;
    --background: #01051b;
    --surface: #06102a;
    --surface-hover: #0c1c46;
    --surface-card: #06102a;
    --surface-subtle: rgba(255, 255, 255, 0.03);
    --text-main: #f6f9fc;
    --text-muted: #92a0b1;
    --text-body: #cbd5e1;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --input-bg: rgba(1, 5, 27, 0.7);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-placeholder: rgba(255, 255, 255, 0.35);
    --navbar-bg: rgba(1, 5, 27, 0.85);
    --hero-glow: radial-gradient(ellipse at top, rgba(40, 142, 255, 0.15), transparent 70%), var(--background);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
    --modal-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --code-bg: #01051b;
    --code-border: rgba(255, 255, 255, 0.1);
    --dropdown-bg: #06102a;
    --close-filter: invert(1) grayscale(100%) brightness(200%);
    --close-opacity: 0.7;
}

[data-theme="light"] {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --surface-card: #ffffff;
    --surface-subtle: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-body: #334155;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-placeholder: #94a3b8;
    --navbar-bg: rgba(255, 255, 255, 0.94);
    --hero-glow: radial-gradient(ellipse at top, rgba(2, 132, 199, 0.12), transparent 70%), #f8fafc;
    --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
    --modal-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --code-bg: #0f172a;
    --code-border: #334155;
    --dropdown-bg: #ffffff;
    --close-filter: none;
    --close-opacity: 0.65;
}

/* ==========================================================================
   RNF22 - Acessibilidade WCAG 2.1 AA (Focus, Skip-Link, Reduced Motion)
   ========================================================================== */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--primary);
    color: #ffffff !important;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: top 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 16px;
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
}

:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary) !important;
    outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   RNF21 - Mobile Navigation Drawer
   ========================================================================== */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}

.mobile-nav-drawer.open {
    visibility: visible;
    opacity: 1;
}

.mobile-drawer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 5, 27, 0.7);
    backdrop-filter: blur(4px);
}

.mobile-drawer-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 340px;
    height: 100%;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.mobile-nav-drawer.open .mobile-drawer-content {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.mobile-drawer-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    padding: 20px 24px;
    overflow-y: auto;
}

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-drawer-link:hover {
    color: var(--text-main);
    background: var(--surface-hover);
}

.mobile-drawer-link.active {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

.mobile-drawer-divider {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 12px 0;
}

.mobile-drawer-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Forum Hero & Header */
.forum-hero {
    padding-top: 130px;
    padding-bottom: 40px;
    background: var(--hero-glow);
    border-bottom: 1px solid var(--border);
    position: relative;
}

.forum-switcher {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px;
    gap: 8px;
    margin-bottom: 24px;
}

.forum-switcher-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.forum-switcher-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.forum-switcher-item.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(40, 142, 255, 0.35);
}

/* Badges */
.forum-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.forum-badge i {
    width: 14px;
    height: 14px;
}

.forum-badge-primary {
    background: rgba(40, 142, 255, 0.15);
    border-color: rgba(40, 142, 255, 0.4);
    color: #5cb3ff;
}

.forum-badge-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.forum-badge-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.forum-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.forum-badge-info {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #38bdf8;
}

/* Permission Matrix Banner (RF01) */
.forum-permission-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.forum-permission-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.forum-permission-text strong {
    color: var(--text-main);
}

/* Main Container & Layout */
.forum-main {
    padding: 40px 0 80px;
}

.forum-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}

@media (min-width: 992px) {
    .forum-grid {
        grid-template-columns: 280px 1fr;
    }
}

/* Cards */
.forum-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.forum-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.forum-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.forum-card-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.forum-card-body {
    padding: 24px;
}

/* Sidebar Categories List */
.forum-cat-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}

.forum-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid transparent;
}

.forum-cat-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.forum-cat-item.active {
    background: rgba(40, 142, 255, 0.12);
    border-color: rgba(40, 142, 255, 0.35);
    color: #5cb3ff;
    font-weight: 600;
}

.forum-cat-count {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.forum-cat-item.active .forum-cat-count {
    background: var(--primary);
    color: #ffffff;
}

/* Topic Item */
.forum-topic-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.forum-topic-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.forum-topic-card:hover {
    border-color: rgba(40, 142, 255, 0.4);
    background: #0b1739;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.forum-topic-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.forum-topic-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    line-height: 1.4;
    transition: var(--transition);
}

.forum-topic-title:hover {
    color: var(--primary);
}

.forum-topic-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-topic-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.825rem;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.forum-topic-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.forum-topic-meta-item i {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

/* Action Buttons */
.btn-sm-forum {
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-full);
}

.btn-danger-custom {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.btn-danger-custom:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-warning-custom {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.btn-warning-custom:hover {
    background: #d97706;
    color: #ffffff;
}

/* Modals Theme System */
.modal-content {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    color: var(--text-main) !important;
    box-shadow: var(--modal-shadow) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border) !important;
    padding: 20px 24px !important;
}

.modal-footer {
    border-top: 1px solid var(--border) !important;
    padding: 16px 24px !important;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-close {
    filter: var(--close-filter);
    opacity: var(--close-opacity);
}

.btn-close:hover {
    opacity: 1;
}

/* Form Controls Theme System */
.form-control, .form-select {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
    transition: var(--transition) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(40, 142, 255, 0.25) !important;
    outline: none !important;
}

.form-control::placeholder {
    color: var(--input-placeholder) !important;
}

.form-label {
    color: var(--text-main);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Tables in Dark Mode */
.table-dark-custom {
    width: 100%;
    color: var(--text-main);
    border-collapse: collapse;
}

.table-dark-custom th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
}

.table-dark-custom td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.table-dark-custom tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Alerts */
.forum-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.forum-alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.forum-alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.forum-alert-info {
    background: rgba(40, 142, 255, 0.12);
    border-color: rgba(40, 142, 255, 0.3);
    color: #5cb3ff;
}

.forum-alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

/* Dropdown Dark Mode Override */
.dropdown-menu-dark-custom {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6) !important;
    padding: 8px !important;
    min-width: 180px;
}

.dropdown-menu-dark-custom .dropdown-item {
    color: var(--text-main) !important;
    font-size: 0.875rem;
    padding: 8px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.dropdown-menu-dark-custom .dropdown-item:hover {
    background: rgba(40, 142, 255, 0.12) !important;
    color: #5cb3ff !important;
}

.dropdown-menu-dark-custom .dropdown-item.text-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
}

/* Topic Detail Page */
.topic-detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    margin-bottom: 32px;
}

.topic-detail-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
    margin: 16px 0;
}

.topic-body-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-body);
    margin: 28px 0;
    white-space: pre-line;
    word-break: break-word;
}

.topic-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.reply-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.reply-item:hover {
    border-color: rgba(40, 142, 255, 0.4);
}

.reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.reply-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reply-author-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.reply-content {
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-line;
    word-break: break-word;
}

/* ==========================================================================
   RF05 - Editor de Texto Rico (Markdown & BBCode Toolbar + Preview)
   ========================================================================== */
.forum-editor-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forum-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 10px;
    flex-wrap: wrap;
}

.forum-toolbar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition);
}

.forum-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.15);
}

.forum-toolbar-btn.active {
    background: var(--primary);
    color: #ffffff;
}

.forum-toolbar-btn i {
    width: 15px;
    height: 15px;
}

.forum-editor-preview {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-height: 140px;
    color: var(--text-body);
    font-size: 0.95rem;
    line-height: 1.6;
    display: none;
}

/* Rendered Content Typography (RF05) */
.forum-rendered-content h2, .forum-content-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 16px 0 10px;
}

.forum-rendered-content h3, .forum-content-h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 14px 0 8px;
}

.forum-rendered-content h4, .forum-content-h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #5cb3ff;
    margin: 12px 0 6px;
}

.forum-blockquote {
    border-left: 3px solid var(--primary);
    background: rgba(40, 142, 255, 0.06);
    padding: 12px 18px;
    margin: 14px 0;
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}

.forum-code-block {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 16px 0;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.875rem;
    color: #5cb3ff;
}

.forum-inline-code {
    background: rgba(255, 255, 255, 0.08);
    color: #5cb3ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

.forum-content-link {
    color: #5cb3ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.forum-content-link:hover {
    color: #ffffff;
}

.forum-content-img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 16px 0;
    border: 1px solid var(--border);
}

.forum-content-list {
    padding-left: 24px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   RF06 - Anexos e Uploads de Arquivos
   ========================================================================== */
.forum-attachments-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.forum-attachments-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.forum-attachments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.forum-attachment-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.forum-attachment-card:hover {
    background: rgba(40, 142, 255, 0.1);
    border-color: rgba(40, 142, 255, 0.4);
    color: #5cb3ff;
}

.forum-attachment-icon {
    width: 32px;
    height: 32px;
    background: rgba(40, 142, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.forum-attachment-icon i {
    width: 16px;
    height: 16px;
}

.forum-attachment-meta {
    overflow: hidden;
    line-height: 1.3;
}

.forum-attachment-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forum-attachment-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.forum-attachment-image-preview {
    margin-top: 14px;
    max-width: 480px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow: hidden;
    background: #01051b;
}

.forum-attachment-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   RF02 - Subcategorias na Barra Lateral
   ========================================================================== */
.forum-subcat-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 4px;
}

.forum-subcat-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 20px;
    margin-top: 4px;
    margin-bottom: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.forum-subcat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.825rem;
    transition: var(--transition);
}

.forum-subcat-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}

.forum-subcat-item.active {
    color: #5cb3ff;
    background: rgba(40, 142, 255, 0.1);
    font-weight: 600;
}

/* ==========================================================================
   RF08 / RF09 / RF10 - Moderação, Denúncias e Punições
   ========================================================= */
.badge-pinned {
    background: rgba(40, 142, 255, 0.2);
    color: #5cb3ff;
    border: 1px solid rgba(40, 142, 255, 0.4);
}

.badge-locked {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.forum-report-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.forum-report-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(40, 142, 255, 0.3);
}

.forum-banned-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #fca5a5;
}

/* ==========================================================================
   RF11 - Sistema de Votação/Reação (+1 Upvote / -1 Downvote)
   ========================================================================== */
.forum-vote-control {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 3px 6px;
    gap: 4px;
}

.forum-vote-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 9px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.forum-vote-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.forum-vote-btn.active-up {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.18);
}

.forum-vote-btn.active-down {
    color: #f87171;
    background: rgba(239, 68, 68, 0.18);
}

.forum-vote-score {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--text-main);
    padding: 0 4px;
}

.forum-vote-score.positive {
    color: #38bdf8;
}

.forum-vote-score.negative {
    color: #f87171;
}

/* ==========================================================================
   RF12 - Menções (@nomedousuario)
   ========================================================================== */
.forum-mention {
    display: inline-flex;
    align-items: center;
    background: rgba(40, 142, 255, 0.16);
    color: #60a5fa;
    font-weight: 600;
    border: 1px solid rgba(40, 142, 255, 0.35);
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.9em;
    margin: 0 2px;
    transition: var(--transition);
}

.forum-mention:hover {
    background: rgba(40, 142, 255, 0.28);
    color: #93c5fd;
}

/* ==========================================================================
   RF13 - Notificações e Mensagens Privadas
   ========================================================================== */
.nav-icon-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.nav-icon-btn:hover {
    color: #ffffff;
    background: rgba(40, 142, 255, 0.15);
    border-color: rgba(40, 142, 255, 0.4);
}

.nav-icon-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.2;
    border: 2px solid var(--surface);
}

.notification-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 8px;
    transition: var(--transition);
}

.notification-item.unread {
    background: rgba(40, 142, 255, 0.08);
    border-left: 3px solid var(--primary);
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pm-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 10px;
    transition: var(--transition);
}

.pm-item.unread {
    border-color: rgba(40, 142, 255, 0.4);
    background: rgba(40, 142, 255, 0.06);
}

/* ==========================================================================
   RF14 - Busca Geral e Filtros
   RF15 - Paginação
   RF16 - Tags (Etiquetas)
   ========================================================================== */

/* Search Bar & Multi-criteria Filter Bar (RF14) */
.forum-search-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.forum-search-main-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum-search-input-wrap {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.forum-search-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: var(--text-muted);
    pointer-events: none;
}

.forum-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.92rem;
    transition: var(--transition);
}

.forum-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 142, 255, 0.2);
}

.forum-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.forum-filter-control {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.85rem;
    padding: 7px 12px;
    transition: var(--transition);
    min-width: 140px;
}

.forum-filter-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(40, 142, 255, 0.2);
}

.forum-active-filters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.forum-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(40, 142, 255, 0.12);
    border: 1px solid rgba(40, 142, 255, 0.3);
    color: #60a5fa;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.forum-filter-chip a {
    color: inherit;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.forum-filter-chip a:hover {
    color: #ffffff;
}

/* Tags Badges & Filter (RF16) */
.forum-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.forum-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(40, 142, 255, 0.08);
    border: 1px solid rgba(40, 142, 255, 0.2);
    color: #70b7ff;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.forum-tag-chip:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.forum-tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 142, 255, 0.4);
}

.forum-tag-chip i {
    width: 11px;
    height: 11px;
}

/* Pagination (RF15) */
.forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.forum-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.forum-page-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
    background: rgba(40, 142, 255, 0.12);
}

.forum-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(40, 142, 255, 0.4);
}

.forum-page-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* ==========================================================================
   RNF23 - Regras Especializadas para Tema Claro (Light Mode)
   Aderência WCAG 2.1 AA (Contraste >= 4.5:1 / 3:1)
   ========================================================================== */
[data-theme="light"] body {
    background-color: var(--background);
    color: var(--text-main);
}

[data-theme="light"] .navbar {
    background: var(--navbar-bg);
    border-bottom-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .nav-link {
    color: #475569;
}

[data-theme="light"] .nav-link:hover {
    color: #0f172a;
}

[data-theme="light"] .nav-link.active {
    color: var(--primary) !important;
}

[data-theme="light"] .footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    color: #334155;
}

[data-theme="light"] .footer h4 {
    color: #0f172a;
}

[data-theme="light"] .footer-link {
    color: #475569;
}

[data-theme="light"] .footer-link:hover {
    color: var(--primary);
}

[data-theme="light"] .footer-bottom {
    border-top: 1px solid var(--border);
    color: #64748b;
}

[data-theme="light"] .btn-outline {
    border-color: #cbd5e1;
    color: #1e293b;
    background: transparent;
}

[data-theme="light"] .btn-outline:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal-footer {
    background: #f8fafc !important;
    border-color: var(--border) !important;
}

[data-theme="light"] .forum-switcher {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .forum-switcher-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

[data-theme="light"] .forum-permission-banner {
    background: #f0f9ff;
    border-color: #bae6fd;
}

[data-theme="light"] .forum-card {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .forum-card-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .forum-cat-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

[data-theme="light"] .forum-cat-item.active {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

[data-theme="light"] .forum-cat-count {
    background: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .forum-cat-item.active .forum-cat-count {
    background: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .forum-subcat-list {
    border-left-color: #e2e8f0;
}

[data-theme="light"] .forum-subcat-item:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

[data-theme="light"] .forum-subcat-item.active {
    color: #0284c7;
    background: #e0f2fe;
}

[data-theme="light"] .forum-topic-card {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .forum-topic-card:hover {
    background: #f8fafc;
    border-color: var(--primary);
    box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .forum-search-box {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .forum-search-input:focus,
[data-theme="light"] .forum-filter-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

[data-theme="light"] .forum-tag-chip {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
}

[data-theme="light"] .forum-tag-chip:hover,
[data-theme="light"] .forum-tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .forum-filter-chip {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
}

[data-theme="light"] .forum-page-btn {
    background: #ffffff;
    border-color: var(--border);
    color: #475569;
}

[data-theme="light"] .forum-page-btn:hover {
    background: #f0f9ff;
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .forum-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .forum-editor-toolbar {
    background: #f8fafc;
    border-color: var(--border);
}

[data-theme="light"] .forum-toolbar-btn {
    color: #475569;
}

[data-theme="light"] .forum-toolbar-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .forum-blockquote {
    background: #f0f9ff;
    color: #475569;
}

[data-theme="light"] .forum-inline-code {
    background: #e2e8f0;
    color: #0284c7;
}

[data-theme="light"] .topic-detail-card {
    background: #ffffff;
    border-color: var(--border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .reply-item {
    background: #ffffff;
    border-color: var(--border);
}

[data-theme="light"] .reply-item:hover {
    background: #f8fafc;
    border-color: var(--primary);
}

[data-theme="light"] .forum-badge {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .forum-badge-primary {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0284c7;
}

[data-theme="light"] .forum-badge-success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #15803d;
}

[data-theme="light"] .forum-badge-warning {
    background: #fef3c7;
    border-color: #fde68a;
    color: #b45309;
}

[data-theme="light"] .forum-badge-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

[data-theme="light"] .forum-badge-info {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

[data-theme="light"] .nav-icon-btn {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .nav-icon-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0284c7;
}

[data-theme="light"] .forum-vote-control {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[data-theme="light"] .forum-vote-btn {
    color: #64748b;
}

[data-theme="light"] .forum-vote-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .forum-vote-btn.active-up {
    background: #e0f2fe;
    color: #0284c7;
}

[data-theme="light"] .forum-vote-btn.active-down {
    background: #fee2e2;
    color: #dc2626;
}

[data-theme="light"] .forum-vote-score {
    color: #0f172a;
}

[data-theme="light"] .forum-mention {
    background: #e0f2fe;
    border-color: #93c5fd;
    color: #0284c7;
}

[data-theme="light"] .forum-mention:hover {
    background: #bae6fd;
    color: #0369a1;
}

[data-theme="light"] .notification-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .notification-item.unread {
    background: #f0f9ff;
    border-left: 3px solid var(--primary);
}

[data-theme="light"] .notification-item:hover {
    background: #f1f5f9;
}

[data-theme="light"] .pm-item {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .pm-item.unread {
    background: #f0f9ff;
    border-color: #7dd3fc;
}

[data-theme="light"] .dropdown-menu-dark-custom {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme="light"] .dropdown-menu-dark-custom .dropdown-item {
    color: #1e293b !important;
}

[data-theme="light"] .dropdown-menu-dark-custom .dropdown-item:hover {
    background: #f0f9ff !important;
    color: #0284c7 !important;
}

[data-theme="light"] .dropdown-menu-dark-custom .dropdown-item.text-danger:hover {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

[data-theme="light"] .dropdown-menu-dark-custom .dropdown-item.text-warning:hover {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

[data-theme="light"] .table-dark-custom {
    color: var(--text-main);
}

[data-theme="light"] .table-dark-custom th {
    background: #f8fafc;
    color: var(--text-muted);
    border-bottom-color: var(--border);
}

[data-theme="light"] .table-dark-custom td {
    border-bottom-color: var(--border);
}

[data-theme="light"] .table-dark-custom tr:hover td {
    background: #f1f5f9;
}

[data-theme="light"] .forum-attachment-card {
    background: #f8fafc;
    border-color: var(--border);
    color: var(--text-main);
}

[data-theme="light"] .forum-attachment-card:hover {
    background: #f0f9ff;
    border-color: #7dd3fc;
    color: #0284c7;
}

[data-theme="light"] .forum-attachment-icon {
    background: #e0f2fe;
    color: #0284c7;
}

[data-theme="light"] .forum-report-card {
    background: #f8fafc;
    border-color: var(--border);
}

[data-theme="light"] .forum-report-card:hover {
    background: #f1f5f9;
    border-color: var(--primary);
}

/* ==========================================================================
   RNF21 - Responsividade Completa (Mobile-Friendly)
   Tablets (992px), Smartphones (768px, 576px)
   ========================================================================== */
@media (max-width: 991.98px) {
    .forum-hero {
        padding-top: 100px;
        padding-bottom: 28px;
    }
    .forum-switcher {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
    }
    .forum-switcher-item {
        flex: 1 1 auto;
        justify-content: center;
        font-size: 0.85rem;
        padding: 8px 12px;
        text-align: center;
    }
    .forum-permission-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 767.98px) {
    .forum-hero {
        padding-top: 90px;
        padding-bottom: 24px;
    }
    .forum-search-box {
        padding: 14px 16px;
    }
    .forum-search-main-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .forum-search-main-row .btn {
        width: 100%;
        min-height: 42px;
    }
    .forum-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    .forum-filter-control {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }
    #customDatesWrap {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    #customDatesWrap input {
        width: 100%;
    }
    .topic-detail-title {
        font-size: 1.4rem;
    }
    .topic-detail-card {
        padding: 20px 16px;
    }
    .topic-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .topic-action-bar > div {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .reply-item {
        padding: 16px 14px;
    }
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .forum-topic-card {
        padding: 18px 16px;
    }
    .forum-topic-meta {
        gap: 10px;
        font-size: 0.775rem;
    }
    .forum-topic-meta-item {
        font-size: 0.775rem;
    }
    .forum-attachments-grid {
        grid-template-columns: 1fr;
    }
    .forum-editor-toolbar {
        gap: 4px;
        padding: 4px 6px;
    }
    .forum-toolbar-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    .btn-sm-forum {
        min-height: 38px;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding: 0 16px;
    }
    .forum-pagination {
        gap: 4px;
    }
    .forum-page-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 0.8rem;
    }
    .modal-dialog {
        margin: 10px;
    }
    .modal-header,
    .modal-footer {
        padding: 14px 16px !important;
    }
    .modal-body {
        padding: 16px !important;
    }
}



