/* ==========================================================================
   Estilos Foro Reorganizado — Zombie Revenge: Classic
   ========================================================================== */

/* ─── Barra de Navegación y Acciones Superiores ──────────────────────────── */
.forum-controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.forum-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.94rem;
    font-weight: 500;
}

.breadcrumb-item {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--cyan);
}

.breadcrumb-item.active {
    color: #ffffff;
    font-weight: 700;
}

.breadcrumb-separator {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.85rem;
}

.forum-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Buscador en tiempo real */
.forum-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(8, 12, 18, 0.85);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0 12px;
    min-height: 40px;
    backdrop-filter: blur(10px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.forum-search-box:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.25);
}

.forum-search-box .search-icon {
    font-size: 0.95rem;
    color: var(--muted);
    margin-right: 8px;
    user-select: none;
}

.forum-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    width: 220px;
}

.forum-search-box input::placeholder {
    color: var(--muted);
}

.search-clear-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: color 0.2s ease;
}

.search-clear-btn:hover {
    color: #ffffff;
}

/* Selector Móvil de Categorías */
.forum-mobile-category-bar {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    background: rgba(8, 12, 18, 0.85);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 14px;
}

.forum-mobile-category-bar label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cyan);
    white-space: nowrap;
}

.forum-mobile-category-bar select {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

/* ─── Layout Principal: Sidebar y Feed ───────────────────────────────────── */
.forum-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* ─── Sidebar de Categorías ─────────────────────────────────────────────── */
.forum-sidebar-panel {
    padding: 20px;
    position: sticky;
    top: 90px;
}

.forum-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.12);
}

.forum-sidebar-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.cat-total-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 243, 255, 0.12);
    color: var(--cyan);
    border: 1px solid rgba(0, 243, 255, 0.25);
}

/* Grupos y Elementos de Categoría */
.category-group {
    margin-top: 16px;
}

.cat-group-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    font-weight: 700;
    margin: 0 0 8px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    margin-bottom: 3px;
    transition: background 0.2s ease,
                border-color 0.2s ease;
    user-select: none;
}

.category-nav-item:hover {
    background: rgba(0, 243, 255, 0.05);
    border-color: rgba(0, 243, 255, 0.15);
    transform: none;
}

.category-nav-item.active {
    background: rgba(0, 243, 255, 0.08);
    border-color: var(--cyan);
    box-shadow: 0 0 12px rgba(0, 243, 255, 0.1);
}

.cat-icon {
    display: none;
}

.cat-text-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cat-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f0f4f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-nav-item.active .cat-name {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.cat-desc {
    font-size: 0.74rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-count-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.category-nav-item.active .cat-count-pill {
    color: var(--cyan);
    background: rgba(0, 243, 255, 0.2);
    border: 1px solid rgba(0, 243, 255, 0.3);
}

/* Sidebar Widget Informativo */
.forum-sidebar-widget {
    margin-top: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 243, 255, 0.03);
    border: 1px dashed rgba(0, 243, 255, 0.2);
}

.sidebar-widget-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 6px;
}

.sidebar-widget-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--muted);
}

/* ─── Panel Principal de Temas ───────────────────────────────────────────── */
.forum-feed-panel {
    padding: 24px;
}

.forum-feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.12);
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.feed-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.feed-icon-badge {
    display: none;
}

.feed-title {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw, 2.25rem);
    font-weight: 800;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.015em;
    color: var(--cyan) !important;
    text-shadow: 0 0 18px rgba(0, 243, 255, 0.4), 0 0 4px rgba(0, 243, 255, 0.8);
    line-height: 1.2;
}

.feed-description {
    margin: 6px 0 0;
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.5;
}

.feed-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.forum-meta-badge {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.25);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--cyan);
}

.btn-sm {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.82rem;
}

/* ─── Panel Colapsable de Creación de Tema ──────────────────────────────── */
.new-topic-panel {
    margin-bottom: 22px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.new-topic-panel.hidden {
    display: none;
}

.new-topic-card {
    background: rgba(6, 10, 16, 0.95);
    border: 1px solid var(--cyan);
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 243, 255, 0.15);
    backdrop-filter: blur(16px);
}

.new-topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
}

.new-topic-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-topic-close-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 2px;
    transition: color 0.2s ease, background 0.2s ease;
}

.new-topic-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.new-topic-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

/* ─── Lista de Temas (Feed Limpio dividido por <hr>) ─────────────────────── */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.topic-row {
    position: relative;
    padding: 16px 0;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.topic-row:first-child {
    padding-top: 4px;
}

.topic-row:last-child {
    padding-bottom: 4px;
}

.topic-row:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.topic-row-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.topic-row-title {
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
    transition: color 0.2s ease;
}

.topic-row:hover .topic-row-title {
    color: var(--cyan) !important;
}

.topic-row-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    font-family: 'Space Grotesk', sans-serif;
    margin: 2px 0 6px 0;
    color: var(--muted);
}

.topic-row-by {
    color: var(--muted);
}

.topic-author-name {
    font-weight: 800;
    display: inline-block;
}

.topic-row-date {
    color: var(--muted);
    font-size: 0.85rem;
}

.topic-replies-text {
    color: #94a3b8;
    font-size: 0.85rem;
}

.topic-row-category {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.22);
    color: var(--cyan);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.topic-row-snippet {
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0;
}

.topic-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 14px 0;
    width: 100%;
}

/* ─── Vista Detalle del Tema ─────────────────────────────────────────────── */
.topic-detail-container {
    animation: fadeIn 0.3s ease;
}

.topic-detail-container.hidden {
    display: none;
}

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

.back-to-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: rgba(8, 12, 18, 0.8);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.back-to-category-btn:hover {
    color: #ffffff;
    border-color: var(--cyan);
    background: rgba(0, 243, 255, 0.08);
}

.topic-thread-card {
    background: rgba(6, 10, 16, 0.8);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 26px;
    margin-bottom: 24px;
    backdrop-filter: blur(14px);
}

.topic-thread-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.12);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.topic-thread-author-bar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topic-thread-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.topic-thread-title {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 16px;
    line-height: 1.25;
}

.topic-thread-body {
    white-space: pre-wrap;
    color: var(--text);
    line-height: 1.8;
    font-size: 1.02rem;
}

/* Sección de Respuestas */
.replies-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.replies-section-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
}

.reply-list {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.reply-card {
    background: rgba(5, 8, 12, 0.65);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 20px;
    backdrop-filter: blur(12px);
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reply-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid rgba(0, 243, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
}

.reply-author-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.reply-date {
    font-size: 0.8rem;
    color: var(--muted);
    margin-left: auto;
}

.reply-body {
    white-space: pre-wrap;
    color: var(--text);
    line-height: 1.7;
    font-size: 0.96rem;
}

/* Caja de Respuesta */
.reply-box-panel {
    background: rgba(6, 10, 16, 0.85);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 24px;
}

.reply-box-panel h3 {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

/* ─── Estados Vacíos y Bloqueados ───────────────────────────────────────── */
.forum-empty {
    padding: 40px 20px;
    border: 1px dashed rgba(0, 243, 255, 0.25);
    border-radius: 4px;
    color: var(--muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.98rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.forum-empty-icon {
    font-size: 2.2rem;
    opacity: 0.8;
}

.login-required-card {
    text-align: center;
    padding: 34px 20px;
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.03);
    border: 1px dashed rgba(0, 243, 255, 0.25);
}

.login-required-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-required-title {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.login-required-text {
    margin: 0 auto 18px;
    max-width: 480px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.login-required-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── Responsividad ──────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .forum-layout {
        grid-template-columns: 1fr;
    }

    .forum-sidebar {
        display: none; /* Se usa el selector de categoría móvil en pantallas pequeñas */
    }

    .forum-mobile-category-bar {
        display: flex;
    }

    .forum-search-box input {
        width: 160px;
    }
}

@media (max-width: 640px) {
    .forum-controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-top-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .forum-search-box input {
        width: 100%;
    }

    .topic-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .topic-stats-col {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }
}
