/* =========================================================
   FORO MOONDRIVEHD — Fase Beta
   Tema oscuro consistente con el resto del sitio
========================================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: #0d0d0d;
    color: #e0e0e0;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a { color: #7cb9ff; text-decoration: none; }
a:hover { color: #a8d4ff; text-decoration: underline; }

/* ── HEADER (idéntico al catálogo) ── */
.main-header {
    background: #111;
    border-bottom: 2px solid #1e3a5f;
    padding: .75rem 1.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.logo-area { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text  { font-size: 1.3rem; font-weight: 900; color: #fff; letter-spacing: .05em; }
.accent-text { color: #3b82f6; }
.sub-logo   { font-size: .65rem; color: #888; letter-spacing: .15em; text-transform: uppercase; }

.main-nav { display: flex; gap: .5rem; margin-left: auto; align-items: center; }
.nav-link  {
    background: none; border: none; cursor: pointer;
    color: #ccc; font-size: .88rem; padding: .4rem .8rem;
    border-radius: 6px; transition: background .2s, color .2s;
    font-family: inherit;
}
.nav-link:hover, .nav-link.active { background: #1e3a5f; color: #fff; }
.auth-nav-btn { border: 1px solid #3b82f6; color: #3b82f6; }
.auth-nav-btn:hover { background: #3b82f6; color: #fff; }

/* ── HERO BANNER ── */
.foro-hero {
    background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 50%, #0d1b2a 100%);
    border-bottom: 1px solid #1e3a5f;
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
}
.foro-hero-content h1 { font-size: 2rem; color: #fff; margin-bottom: .5rem; }
.foro-hero-content p  { color: #aaa; font-size: 1rem; margin-bottom: 1.5rem; }

.foro-hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 700; color: #3b82f6; }
.hero-stat-lbl { font-size: .78rem; color: #888; text-transform: uppercase; letter-spacing: .08em; }

/* ── BREADCRUMB ── */
.foro-breadcrumb {
    background: #111;
    padding: .6rem 1.5rem;
    font-size: .83rem;
    color: #888;
    border-bottom: 1px solid #1e2a3a;
    max-width: 100%;
}
.foro-breadcrumb a { color: #7cb9ff; }
.foro-breadcrumb span { margin: 0 .4rem; }

/* ── LAYOUT ── */
.foro-layout {
    max-width: 1300px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: start;
}
.foro-layout--narrow { grid-template-columns: 1fr; max-width: 800px; }

/* ── SECTION ── */
.foro-section {
    background: #141414;
    border: 1px solid #1e2a3a;
    border-radius: 10px;
    overflow: hidden;
}
.foro-section-header {
    background: #111;
    border-bottom: 1px solid #1e2a3a;
    padding: .9rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.foro-section-header h2,
.foro-section-header h3 { font-size: 1rem; color: #fff; }

/* ── CATEGORIES LIST ── */
.categories-list { padding: .5rem 0; }

.category-row {
    display: grid;
    grid-template-columns: 3rem 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.2rem;
    border-bottom: 1px solid #1a2232;
    transition: background .15s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.category-row:last-child { border-bottom: none; }
.category-row:hover { background: #1a2232; }

.cat-icon { font-size: 1.6rem; text-align: center; }
.cat-info-name { font-weight: 600; color: #fff; font-size: .95rem; }
.cat-info-desc { font-size: .8rem; color: #888; margin-top: .15rem; }
.cat-info-last { font-size: .75rem; color: #666; margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 350px; }
.cat-stat { text-align: center; min-width: 60px; }
.cat-stat-num { font-weight: 700; color: #3b82f6; font-size: 1rem; display: block; }
.cat-stat-lbl { font-size: .72rem; color: #666; }
.cat-vip-badge { background: #7c3aed; color: #fff; font-size: .7rem; padding: .15rem .4rem; border-radius: 4px; margin-left: .5rem; vertical-align: middle; }

/* ── RECENT THREADS ── */
.recent-threads { padding: .5rem 0; }
.recent-row {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem 1.2rem;
    border-bottom: 1px solid #1a2232;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: #1a2232; }
.recent-cat-badge {
    font-size: .7rem; background: #1e3a5f; color: #7cb9ff;
    padding: .15rem .5rem; border-radius: 4px; white-space: nowrap;
}
.recent-title { flex: 1; color: #e0e0e0; font-size: .9rem; }
.recent-meta  { font-size: .75rem; color: #666; white-space: nowrap; }
.recent-replies { font-size: .78rem; color: #888; }

/* ── THREADS TABLE ── */
.threads-table { padding: .5rem 0; }
.thread-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: .85rem 1.2rem;
    border-bottom: 1px solid #1a2232;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: #1a2232; }
.thread-pinned-icon { color: #f59e0b; margin-right: .4rem; }
.thread-closed-icon { color: #6b7280; margin-right: .4rem; }
.thread-title { color: #e0e0e0; font-weight: 600; font-size: .92rem; }
.thread-sub   { font-size: .77rem; color: #666; margin-top: .2rem; }
.thread-stat  { text-align: center; }
.thread-stat-num { font-weight: 700; color: #3b82f6; display: block; }
.thread-stat-lbl { font-size: .72rem; color: #666; }

/* ── HILO DETALLE ── */
.thread-post {
    padding: 1.5rem;
    border-bottom: 1px solid #1e2a3a;
}
.thread-post-header {
    display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem;
}
.post-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: #1e3a5f; display: flex; align-items: center;
    justify-content: center; font-weight: 700; color: #7cb9ff;
    font-size: 1.1rem; flex-shrink: 0;
}
.post-author   { font-weight: 600; color: #fff; }
.post-date     { font-size: .78rem; color: #666; }
.post-body     { color: #ccc; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.thread-post-title { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: 1rem; }

.reply-item {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #1a2232;
}
.reply-item:last-child { border-bottom: none; }
.reply-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.reply-footer { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }

.btn-like {
    background: none; border: 1px solid #2a3a4a; color: #888;
    padding: .25rem .7rem; border-radius: 6px; cursor: pointer;
    font-size: .8rem; transition: all .2s; font-family: inherit;
}
.btn-like:hover, .btn-like.liked { border-color: #3b82f6; color: #3b82f6; }

/* ── FORMULARIOS ── */
.form-group    { margin-bottom: 1.2rem; padding: 0 1.5rem; }
.form-label    { display: block; font-size: .85rem; color: #aaa; margin-bottom: .4rem; font-weight: 600; }
.form-hint     { font-size: .75rem; color: #555; margin-top: .25rem; display: block; }
.foro-input, .foro-select {
    width: 100%; background: #0d0d0d; border: 1px solid #2a3a4a;
    color: #e0e0e0; padding: .65rem .9rem; border-radius: 7px;
    font-size: .9rem; font-family: inherit;
    transition: border-color .2s;
}
.foro-input:focus, .foro-select:focus, .foro-textarea:focus {
    outline: none; border-color: #3b82f6;
}
.foro-select option { background: #141414; }
.foro-textarea {
    width: 100%; background: #0d0d0d; border: 1px solid #2a3a4a;
    color: #e0e0e0; padding: .65rem .9rem; border-radius: 7px;
    font-size: .9rem; font-family: inherit; resize: vertical;
    transition: border-color .2s; display: block;
}
/* Cuando el textarea está dentro de .foro-section directamente */
#replyBody { margin: 1rem 1.5rem; width: calc(100% - 3rem); }
#btnSubmitReply { margin-left: 1.5rem; margin-bottom: 1rem; }
#replyMsg { margin-left: 0; }

/* ── BOTONES ── */
.btn-primary {
    background: #3b82f6; color: #fff; border: none;
    padding: .55rem 1.2rem; border-radius: 7px; cursor: pointer;
    font-size: .88rem; font-weight: 600; font-family: inherit;
    transition: background .2s;
}
.btn-primary:hover { background: #2563eb; }
.btn-secondary {
    background: #1e2a3a; color: #ccc; border: 1px solid #2a3a4a;
    padding: .55rem 1.2rem; border-radius: 7px; cursor: pointer;
    font-size: .88rem; font-family: inherit; transition: background .2s;
    text-decoration: none; display: inline-block;
}
.btn-secondary:hover { background: #253347; color: #fff; }
.w-100 { width: 100%; }

/* ── SIDEBAR ── */
.foro-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.sidebar-card {
    background: #141414; border: 1px solid #1e2a3a;
    border-radius: 10px; padding: 1rem 1.2rem;
}
.sidebar-card h3 { font-size: .9rem; color: #fff; margin-bottom: .75rem; border-bottom: 1px solid #1e2a3a; padding-bottom: .5rem; }
.sidebar-text  { font-size: .83rem; color: #888; margin-bottom: .75rem; }
.sidebar-list  { list-style: none; font-size: .82rem; color: #aaa; display: flex; flex-direction: column; gap: .4rem; }
.sidebar-list li::before { content: "›  "; color: #3b82f6; }

/* ── PAGINACIÓN ── */
.foro-pagination {
    display: flex; justify-content: center; gap: .5rem;
    padding: 1rem; flex-wrap: wrap;
}
.page-btn {
    background: #1e2a3a; border: 1px solid #2a3a4a; color: #ccc;
    padding: .4rem .8rem; border-radius: 6px; cursor: pointer;
    font-size: .83rem; font-family: inherit; transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }

/* ── MISC ── */
.foro-loading { padding: 2rem; text-align: center; color: #666; }
.foro-notice  { margin: 1rem 1.5rem; padding: .85rem 1rem; background: #1e2a3a; border-radius: 7px; color: #aaa; font-size: .88rem; }
.foro-msg     { font-size: .83rem; }
.foro-msg.ok  { color: #4ade80; }
.foro-msg.err { color: #f87171; }
.category-desc { padding: .75rem 1.2rem; color: #888; font-size: .85rem; border-bottom: 1px solid #1a2232; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .foro-layout { grid-template-columns: 1fr; }
    .foro-sidebar { order: -1; }
    .category-row { grid-template-columns: 2.5rem 1fr auto; }
    .thread-row { grid-template-columns: 1fr auto; }
}
@media (max-width: 600px) {
    .foro-hero-stats { gap: 1.2rem; }
    .category-row { grid-template-columns: 2.5rem 1fr; }
    .cat-stat { display: none; }
    .thread-stat { display: none; }
}
