/* ==========================================================================
   Estilos específicos del Foro - Entrenadores Pokémon (Modo Claro)
   ========================================================================== */

/* Migas de Pan (Breadcrumbs) */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
    background: var(--bg-card);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs i {
    font-size: 10px;
    opacity: 0.5;
}

.breadcrumbs span {
    color: var(--text-main);
    font-weight: 600;
}

/* Barra de Cabecera del Foro (Título + Botón) */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.forum-header h2 {
    margin: 0;
}

/* Layout Principal del Foro (Grid con barra lateral) */
.forum-layout {
    display: grid;
    grid-template-columns: 2.8fr 1.2fr;
    gap: 30px;
    align-items: start;
}

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

/* Listado de Categorías */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: rgba(192, 54, 52, 0.3);
    box-shadow: var(--shadow-md);
}

/* Iconos de Categoría */
.category-icon-wrapper {
    width: 65px;
    height: 65px;
    border-radius: 14px;
    background: #f1f5f9;
    padding: 6px;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.category-card:hover .category-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

.category-icon-img {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Contenido de la Categoría */
.category-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-name-link {
    text-decoration: none;
}

.category-name {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
    transition: color var(--transition-fast);
    margin: 0;
}

.category-name-link:hover .category-name {
    color: var(--primary);
}

.category-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Estadísticas de Categoría */
.category-stats-bar {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 5px;
}

.category-stats-bar span strong {
    color: var(--text-main);
}

/* Actividad Reciente de la Categoría */
.category-last-post {
    max-width: 250px;
    font-size: 12.5px;
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-last-post-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: color var(--transition-fast);
}

.category-last-post-title:hover {
    color: var(--primary);
}

.category-last-post-meta {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.category-last-post-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .category-card {
        grid-template-columns: auto 1fr;
        gap: 15px;
        padding: 16px;
    }
    .category-last-post {
        grid-column: 1 / span 2;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-left: 0;
        padding-top: 10px;
        max-width: 100%;
    }
}

/* Listado de Temas (Topics) */
.topics-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.topics-header-row {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: grid;
    grid-template-columns: 1fr 120px 180px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.topic-row {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 120px 180px;
    align-items: center;
    transition: background-color var(--transition-fast);
}

.topic-row:last-child {
    border-bottom: none;
}

.topic-row:hover {
    background-color: #f8fafc;
}

.topic-row.sticky-topic {
    background-color: rgba(246, 224, 94, 0.05);
}

.topic-row.sticky-topic:hover {
    background-color: rgba(246, 224, 94, 0.08);
}

/* Títulos y Metadatos de Temas */
.topic-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.topic-icon {
    font-size: 16px;
    margin-top: 4px;
}

.topic-icon.sticky { color: var(--primary); }
.topic-icon.locked { color: var(--text-muted); }
.topic-icon.normal { color: var(--accent-blue); }

.topic-main-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.topic-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    word-break: break-word;
    transition: color var(--transition-fast);
}

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

.topic-meta-info {
    font-size: 12.5px;
    color: var(--text-muted);
}

.topic-meta-info a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.topic-meta-info a:hover {
    color: var(--primary);
}

/* Respuestas / Vistas de Temas */
.topic-replies-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

.topic-views-count {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 2px;
}

/* Último mensaje del Tema */
.topic-last-reply {
    font-size: 12.5px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topic-last-reply-user {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
}

.topic-last-reply-user:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .topics-header-row {
        display: none;
    }
    .topic-row {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px;
    }
    .topic-replies-count {
        text-align: left;
        font-size: 13px;
        color: var(--text-muted);
    }
    .topic-replies-count span {
        font-weight: bold;
        color: var(--text-main);
    }
    .topic-last-reply {
        border-top: 1px solid var(--border-color);
        padding-top: 8px;
    }
}

/* Barra Lateral (Sidebar) */
.forum-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Enlaces / Filas en Sidebar */
.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.sidebar-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.sidebar-item-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.sidebar-item-title {
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.sidebar-item-title:hover {
    color: var(--primary);
}

.sidebar-item-meta {
    color: var(--text-muted);
}

/* Buscador Lateral */
.sidebar-search-form {
    display: flex;
    gap: 8px;
}

.sidebar-search-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: var(--font-primary);
}

.sidebar-search-input:focus {
    border-color: var(--primary);
}

/* Hilo de Discusión (Topic & Replies View) */
.topic-main-post {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.post-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    min-height: 200px;
}

@media (max-width: 768px) {
    .post-container {
        grid-template-columns: 1fr;
    }
}

/* Columna del Autor del Post */
.post-author {
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

@media (max-width: 768px) {
    .post-author {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        text-align: left;
        padding: 16px;
        gap: 16px;
    }
}

.post-author-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .post-author-avatar {
        width: 60px;
        height: 60px;
    }
}

.post-author-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-author-name:hover {
    color: var(--primary);
}

.post-author-role {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-author-role.admin {
    background: rgba(192, 54, 52, 0.1);
    color: var(--primary);
    border: 1px solid rgba(192, 54, 52, 0.2);
}

.post-author-role.mod {
    background: rgba(49, 130, 206, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(49, 130, 206, 0.2);
}

.post-author-role.user {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

.post-author-stats {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Columna de Contenido del Post */
.post-content-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.post-body {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.6;
    word-break: break-word;
}

.post-body p {
    margin-bottom: 16px;
}

.post-body p:last-child {
    margin-bottom: 0;
}

/* Firma Dinámica de Entrenador */
.post-signature {
    margin-top: 30px;
    border-top: 1px dashed var(--border-color);
    padding-top: 20px;
    max-width: 550px;
}

.post-signature img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

/* Acciones en Publicaciones */
.post-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    font-size: 13px;
}

.post-action-btn {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
}

.post-action-btn:hover {
    color: var(--primary);
    background: rgba(192, 54, 52, 0.05);
}

.post-action-btn.edit:hover {
    color: var(--accent-blue);
    background: rgba(49, 130, 206, 0.05);
}

.post-action-btn.delete:hover {
    color: var(--primary);
    background: rgba(192, 54, 52, 0.05);
}

/* Respuestas (Listado) */
.replies-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.reply-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Formulario / Textarea del Editor */
.editor-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.editor-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.editor-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-form-group label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-main);
}

.editor-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    font-family: var(--font-primary);
    transition: border-color var(--transition-fast);
}

.editor-input:focus {
    border-color: var(--primary);
}

.editor-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    min-height: 200px;
    font-family: var(--font-primary);
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.editor-textarea:focus {
    border-color: var(--primary);
}

/* Paginación SEO del Foro */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.pagination-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-item.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Ventanas Modales de Reporte (Sleek CSS pure implementation or standard popup) */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 15, 23, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.report-modal.open {
    opacity: 1;
    visibility: visible;
}

.report-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.report-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 12px;
}

.report-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
}

.report-modal-close:hover {
    color: var(--primary);
}

/* Caja de búsqueda global o en foro */
.search-results-meta {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.search-results-meta strong {
    color: var(--text-main);
}

/* TCG Metric Cards Premium Design */
.tcg-metric-card {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 18px 24px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.25s ease !important;
    text-align: left !important;
}

.tcg-metric-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-md) !important;
}

.tcg-metric-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
}

/* --- Formateo de Quill Rich Text --- */
.post-body .ql-align-center {
    text-align: center;
}
.post-body .ql-align-center img,
.post-body .ql-align-center iframe {
    display: inline-block;
}
.post-body .ql-align-right {
    text-align: right;
}
.post-body .ql-align-justify {
    text-align: justify;
}
.post-body iframe.ql-video {
    width: 100%;
    max-width: 640px;
    aspect-ratio: 16/9;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 15px 0;
    box-shadow: var(--shadow-md);
    display: inline-block;
}
.post-body .ql-align-center iframe.ql-video,
.post-body iframe.ql-video.ql-align-center {
    display: block !important;
    margin: 15px auto !important;
}

/* --- BANNER DE FORO PREMIUM --- */
.forum-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    overflow: hidden;
    padding: 3.5rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md), 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(15, 23, 42, 0.5) 0%, rgba(9, 13, 22, 0.75) 100%);
    z-index: 1;
}

.banner-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: 850;
    color: #ffffff;
    margin-bottom: 0.8rem;
    font-family: var(--font-secondary), sans-serif;
    letter-spacing: -0.8px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.banner-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
