/* =====================================================
   PAGINAS PUBLICAS (noticias, foros, tema)
   ===================================================== */

/* ---------- CONTENEDOR ---------- */
.pub-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

.pub-container h1 {
  color: var(--color-primary, #00ff99);
  margin-bottom: 8px;
  font-size: 2rem;
}

.pub-container .pub-sub {
  color: #aaa;
  margin-bottom: 30px;
}

/* ---------- FORO HEADER ---------- */
.foro-header {
  margin-bottom: 10px;
}

.foro-loading, .foro-empty {
  text-align: center;
  padding: 50px 20px;
  color: #777;
  background: rgba(20, 20, 20, 0.6);
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.foro-login-prompt {
  text-align: center;
  padding: 24px;
  color: #999;
  background: rgba(20, 20, 20, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 20px;
  font-size: 0.95rem;
}

.foro-login-prompt a { color: var(--color-primary, #00ff99); font-weight: 600; text-decoration: none; }
.foro-login-prompt a:hover { text-decoration: underline; }

/* ---------- BREADCRUMBS ---------- */
.crumbs {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crumbs a { color: var(--color-primary, #00ff99); text-decoration: none; font-weight: 500; }
.crumbs a:hover { text-decoration: underline; }
.crumb-sep { color: #555; }
.crumb-active { color: #ccc; }

/* ---------- CATEGORÍAS GRID ---------- */
.categorias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.categoria-card {
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  transition: transform 0.2s, border-color 0.25s, box-shadow 0.25s;
}

.categoria-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, #00ff99);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.cat-bar {
  width: 5px;
  flex-shrink: 0;
  background: var(--cat-color, #00ff99);
}

.cat-body {
  flex: 1;
  padding: 18px 16px;
}

.cat-body h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.cat-body p {
  color: #999;
  font-size: 0.85rem;
  line-height: 1.4;
}

.cat-count {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.count-num {
  color: var(--color-primary, #00ff99);
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1;
}

.count-label {
  color: #888;
  font-size: 0.75rem;
  margin-top: 4px;
}

.cat-description {
  color: #aaa;
  font-size: 0.9rem;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-left: 3px solid #00ff99;
  background: rgba(0, 255, 153, 0.03);
  border-radius: 0 8px 8px 0;
}

/* ---------- TEMAS LIST ---------- */
.tema-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s;
}

.tema-card:hover {
  border-color: var(--color-primary, #00ff99);
  transform: translateX(4px);
}

.tema-left { flex-shrink: 0; }

.tema-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #59058a, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  color: #fff;
}

.tema-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary, #00ff99);
}

.tema-center { flex: 1; min-width: 0; }

.tema-center h3 {
  color: #eee;
  font-size: 0.95rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tema-card:hover .tema-center h3 { color: #fff; }

.tema-meta {
  color: #777;
  font-size: 0.78rem;
  margin-top: 4px;
}

.tema-meta b { color: #bbb; }

.tema-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 0.3px;
}

.tag-pin  { background: #59058a; color: #fff; }
.tag-lock { background: #991b1b; color: #fff; }

.tema-right {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}

.tema-stat {
  text-align: center;
  color: #888;
  font-size: 0.78rem;
  line-height: 1.3;
}

.tema-stat b {
  display: block;
  color: #fff;
  font-size: 1.1rem;
}

.tema-stat span { font-size: 0.72rem; color: #666; }

/* ---------- MENSAJE (tema individual) ---------- */
.mensaje-card {
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.mensaje-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.mensaje-header b { color: var(--color-primary, #00ff99); }
.mensaje-meta { color: #777; font-size: 0.8rem; }

.mensaje-cuerpo {
  color: #ddd;
  line-height: 1.65;
  font-size: 0.93rem;
}

/* ---------- TEMA BADGES (en la cabecera) ---------- */
.tema-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: bold;
  margin-right: 5px;
}
.tema-badge.fijo    { background: #59058a; color: #fff; }
.tema-badge.cerrado { background: #991b1b; color: #fff; }

/* ---------- NOTICIAS PUBLICAS ---------- */
.pub-card {
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
  transition: transform 0.2s, border-color 0.2s;
}

.pub-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary, #00ff99);
}

.pub-card h2 { color: #fff; margin-bottom: 8px; }
.pub-card .meta { color: #888; font-size: 0.85rem; margin-bottom: 12px; }
.pub-card .resumen { color: #ccc; line-height: 1.6; white-space: pre-wrap; }

.pub-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 14px;
  max-height: 300px;
  object-fit: cover;
}

.pub-card a, .pub-link {
  color: var(--color-primary, #00ff99);
  text-decoration: none;
  font-weight: 600;
}

.pub-card a:hover, .pub-link:hover { text-decoration: underline; }

/* ---------- FORMULARIOS PUBLICOS ---------- */
.pub-form {
  background: rgba(20, 20, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.pub-form h3 { color: #fff; margin-bottom: 14px; }

.pub-form label {
  display: block;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 6px;
}

.pub-form input[type="text"],
.pub-form select,
.pub-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 12px;
  font-family: inherit;
}

.pub-form textarea { min-height: 130px; resize: vertical; }
.pub-form input:focus, .pub-form textarea:focus, .pub-form select:focus {
  outline: none;
  border-color: var(--color-primary, #00ff99);
}

.pub-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pub-btn:hover { opacity: 0.88; }
.pub-btn.primary { background: var(--color-primary, #00ff99); color: #000; }

/* ---------- ESTADOS VACIOS ---------- */
.pub-empty {
  text-align: center;
  padding: 50px 20px;
  color: #888;
  background: rgba(20, 20, 20, 0.85);
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .pub-container { padding: 80px 16px 40px; }
  .categorias-grid { grid-template-columns: 1fr; }
  .tema-card { flex-wrap: wrap; }
  .tema-right { width: 100%; justify-content: flex-start; gap: 20px; margin-top: 6px; }
  .tema-stat { text-align: left; }
  .msg-thread { flex-direction: column; }
  .msg-sidebar { flex-direction: row; gap: 10px; }
}

/* ---------- TEMA HEADER BOX ---------- */
.tema-header-box {
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--color-primary, #00ff99);
  border-radius: 10px;
  padding: 22px 24px;
  margin-bottom: 20px;
}

.tema-header-box h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.tema-header-meta {
  color: #888;
  font-size: 0.85rem;
}

.tema-header-meta b { color: #ccc; }

/* ---------- THREAD DE MENSAJES ---------- */
.msg-thread {
  display: flex;
  gap: 16px;
  background: rgba(18, 18, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.msg-thread:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.msg-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.msg-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #59058a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: #fff;
}

.msg-avatar.admin {
  background: linear-gradient(135deg, #59058a, #dc2626);
  box-shadow: 0 0 8px var(--color-accent-glow, rgba(89, 5, 138, 0.5));
}

.msg-avatar-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary, #00ff99);
}

.msg-avatar-img.admin {
  border-color: #b58aff;
  box-shadow: 0 0 8px var(--color-accent-glow, rgba(89, 5, 138, 0.5));
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msg-author {
  font-weight: 600;
  color: var(--color-primary, #00ff99);
  font-size: 0.92rem;
}

.msg-author.admin { color: #b58aff; }

.msg-time {
  color: #666;
  font-size: 0.78rem;
  margin-left: auto;
}

.msg-content {
  color: #ddd;
  line-height: 1.65;
  font-size: 0.93rem;
}
