/* ============================================================
   Forum CSS Styles - SelvaSoftware / PokeAllianceBot
   Design System Matching Dark Neon Glassmorphism Theme
   ============================================================ */

.forum-view {
    padding-top: 100px;
    padding-bottom: 80px;
    min-height: calc(100vh - 80px);
}

.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.forum-header-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 0;
}

.forum-header-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

.forum-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Barra de Pesquisa e Filtros */
.forum-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(10px);
}

.forum-search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.forum-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 10px 14px 10px 38px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.forum-search-input:focus {
    border-color: var(--accent-purple);
    outline: none;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.2);
}

.forum-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.forum-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Layout Principal: Categorias + Lista de Tópicos */
.forum-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.75rem;
    align-items: start;
}

@media (max-width: 900px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }
}

/* Barra Lateral de Categorias */
.forum-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
}

.forum-sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-tertiary);
    margin-bottom: 0.85rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.category-item:hover, .category-item.active {
    background: rgba(124, 58, 237, 0.15);
    color: #fff;
    border-left: 3px solid var(--accent-purple);
}

.category-item-count {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    color: var(--text-tertiary);
}

.category-item.active .category-item-count {
    background: var(--accent-purple);
    color: #fff;
}

/* Lista de Cards de Tópicos */
.topics-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.topic-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.topic-card:hover {
    border-color: rgba(124, 58, 237, 0.4);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Caixa de Votos / Reações Separadas */
.vote-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 4px;
    min-width: 52px;
}

.vote-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-vote {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 3px 6px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
}

.btn-vote:hover {
    transform: scale(1.18);
    opacity: 1;
}

.btn-vote-up:hover {
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.7));
}

.btn-vote-down:hover {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.7));
}

.btn-vote.active-up {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.5);
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.9));
    transform: scale(1.12);
    opacity: 1;
}

.btn-vote.active-down {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9));
    transform: scale(1.12);
    opacity: 1;
}

.vote-count {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.vote-count-up {
    color: #10b981;
}

.vote-count-down {
    color: #ef4444;
}

/* Conteúdo do Tópico */
.topic-card-body {
    flex: 1;
    min-width: 0;
}

.topic-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.topic-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.4;
    transition: color 0.2s;
}

.topic-card:hover .topic-card-title {
    color: var(--accent-purple-light);
}

.badge-pin {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-locked {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
}

.topic-excerpt {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.topic-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-wrap: wrap;
}

.topic-author {
    color: var(--text-secondary);
    font-weight: 600;
}

.topic-tag {
    background: rgba(124, 58, 237, 0.15);
    color: var(--accent-purple-light);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

/* ============================================================
   TELA DE DETALHES DO TÓPICO E DISCUSSÃO
   ============================================================ */
.topic-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.topic-detail-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;
}

.topic-detail-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.replies-section {
    margin-top: 2rem;
}

.replies-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #fff;
}

/* Respostas e aninhamento (árvore) */
.reply-card {
    background: rgba(18, 18, 30, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    transition: border-color 0.2s;
}

.reply-card.nested {
    margin-left: 2.5rem;
    border-left: 2px solid var(--accent-purple);
    background: rgba(14, 14, 24, 0.5);
}

@media (max-width: 600px) {
    .reply-card.nested {
        margin-left: 1rem;
    }
}

.reply-body {
    flex: 1;
}

.reply-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

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

.reply-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.8rem;
}

.btn-reply-text {
    background: none;
    border: none;
    color: var(--accent-purple-light);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    font-weight: 600;
}

.btn-reply-text:hover {
    text-decoration: underline;
}

/* Caixa de Criação de Resposta */
.new-reply-box {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.reply-textarea {
    width: 100%;
    min-height: 110px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.reply-textarea:focus {
    border-color: var(--accent-purple);
}

/* Paginação das Respostas do Fórum */
.forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.forum-page-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.forum-page-btn:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.2);
    border-color: var(--accent-purple);
    color: #fff;
}

.forum-page-btn.active {
    background: var(--accent-purple);
    border-color: var(--accent-purple-light);
    color: #fff;
    font-weight: 700;
}

.forum-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.forum-page-info {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin: 0 0.5rem;
}

/* Modal de Novo Tópico */
.modal-forum-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-forum-card {
    background: #0f101a;
    border: 1px solid var(--border-medium);
    border-radius: 16px;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
