/* ==========================================================================
   FORO DE DEBATE ESTUDIANTIL — IDENTIDAD PROFESIONAL Y SISTEMA DE DISEÑO
   Proyecto: Estudiantina de Posadas (estudiantina.online)
   Estética: Production-Grade Sólido / Dual Theme Sobrio (Light & Dark)
   ========================================================================== */

:root {
  /* Variable funcional de acento institucional dinámica (hereda del colegio activo o azul estándar) */
  --school-primary: #2563eb;
  --school-secondary: #1d4ed8;
  --school-accent: #3b82f6;
  --school-glow: transparent;
  --school-surface: rgba(37, 99, 235, 0.08);
  --school-border: rgba(37, 99, 235, 0.22);
  --school-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --school-gradient-subtle: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, transparent 100%);
  --foro-accent: var(--school-primary, #2563eb);

  /* Colores semánticos estándar */
  --gold-primary: #d97706;
  --gold-bright: #f59e0b;
  --red-hot: #dc2626;
  --green-success: #16a34a;
  --reddit-orange: #ff4500;

  /* Espaciado */
  --spacing-xs: 0.5rem;
  --spacing-sm: 0.75rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Dimensiones */
  --foro-header-height: 56px;
  --foro-max-width: 1400px;

  /* Radios contenidos y estructurados */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 10px;
  --r-pill: 9999px;

  /* Sombras suaves y realistas de elevación */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transiciones */
  --transition: all 0.18s ease;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Claro (Reddit Light Clean & Accessible) */
:root,
body.light-mode,
html.light-mode,
[data-theme="light"] {
  --foro-bg: #f4f6f8;
  --foro-bg-secondary: #eaedef;
  --foro-card: #ffffff;
  --foro-card-elevated: #ffffff;
  --foro-card-hover: #f7f9fa;
  --foro-border: #e2e8f0;
  --foro-border-light: #edf2f7;
  --foro-border-strong: #cbd5e1;
  --foro-text: #0f172a;
  --foro-text-secondary: #334155;
  --foro-text-muted: #64748b;
  --foro-text-subtle: #94a3b8;
  --foro-pill-bg: #eaedef;
  --foro-pill-hover: #dfe3e6;
  --foro-accent: var(--school-primary, #2563eb);
}

/* Modo Oscuro (Reddit Dark Theme Exact Parity) */
body.page-foro.dark-mode,
html.dark-mode,
[data-theme="dark"] {
  --foro-bg: #0e1113;
  --foro-bg-secondary: #14171a;
  --foro-card: #0e1113;
  --foro-card-elevated: #14171a;
  --foro-card-hover: #121518;
  --foro-border: #1f2328;
  --foro-border-light: #1a1d21;
  --foro-border-strong: #34383f;
  --foro-text: #f2f4f5;
  --foro-text-secondary: #d7dadc;
  --foro-text-muted: #818384;
  --foro-text-subtle: #57606a;
  --foro-pill-bg: #1a1d21;
  --foro-pill-hover: #22252a;
  --foro-accent: var(--school-primary, #2563eb);
  --reddit-orange: #ff4500;

  /* Sombras sutiles controladas */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.65);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.75);
}

/* Base */
body.page-foro {
  background-color: var(--foro-bg);
  color: var(--foro-text);
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

/* Iconos SVG Consistentes y Minimalistas */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.75px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.svg-icon-xs { width: 14px; height: 14px; }
.svg-icon-sm { width: 16px; height: 16px; }
.svg-icon-md { width: 18px; height: 18px; }
.svg-icon-lg { width: 20px; height: 20px; }
.svg-icon-xl { width: 24px; height: 24px; }

/* Indicador de Color Escolar Sobrio */
.school-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BARRA DE ADMINISTRADOR
   ========================================================================== */

.admin-top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background: var(--foro-card);
  border-bottom: 1px solid var(--gold-primary);
  box-shadow: var(--shadow-sm);
  animation: slideDownBar 0.25s ease-out;
}

@keyframes slideDownBar {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.admin-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.admin-badge {
  background: var(--gold-primary);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.admin-user-label {
  color: #cbd5e1;
  font-size: 0.85rem;
}

.admin-user-label strong {
  color: var(--gold-bright);
  font-weight: 700;
}

.admin-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-admin-bar-portal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--r-md);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.btn-admin-bar-portal:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.btn-admin-bar-logout {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-md);
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-admin-bar-logout:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Ajuste cuando hay barra admin */
body.has-admin-bar .foro-app-header {
  top: 44px;
}

/* ==========================================================================
   HEADER ESTILO REDDIT (TOP NAVBAR)
   ========================================================================== */

.foro-app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--foro-bg);
  border-bottom: 1px solid var(--foro-border);
  box-shadow: none;
  transition: var(--transition);
}

.foro-app-header-inner {
  max-width: 100%;
  margin: 0 auto;
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.foro-header-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-toggle-nav-drawer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--foro-text-secondary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-toggle-nav-drawer:hover {
  background: var(--foro-pill-bg, #1a1d21);
  color: #ffffff;
}

.foro-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.foro-brand-title:hover {
  opacity: 0.9;
}

.brand-logo {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--foro-text);
  letter-spacing: -0.02em;
}

.brand-domain {
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-left: 1px;
}

.foro-tag-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--school-surface, rgba(37, 99, 235, 0.08));
  border: 1px solid var(--school-border, rgba(37, 99, 235, 0.25));
  color: var(--school-primary, var(--foro-accent, #2563eb)) !important;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  transition: all 0.2s ease;
}

/* Omnibar de Búsqueda estilo Reddit */
.foro-header-search-wrap.reddit-omnibar-wrap {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.foro-search-lens {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--foro-text-muted);
  pointer-events: none;
}

.foro-header-search-input {
  width: 100%;
  height: 38px;
  background: var(--foro-pill-bg);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-pill);
  padding: 0 38px 0 40px;
  color: var(--foro-text);
  font-size: 14px;
  font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.foro-header-search-input::placeholder {
  color: var(--foro-text-muted);
}

.foro-header-search-input:focus {
  outline: none;
  background: var(--foro-card);
  border-color: var(--school-primary, var(--foro-accent));
  box-shadow: 0 0 0 2px var(--school-surface);
}

.forum-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--foro-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.forum-search-clear:hover {
  background: var(--foro-border);
  color: var(--foro-text);
}

/* Acciones usuario */
.foro-header-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Botón + Crear Píldora estilo Reddit */
.btn-reddit-header-create {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 34px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--foro-border-strong, #34383f);
  color: var(--foro-text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-reddit-header-create:hover {
  background: var(--foro-pill-bg, #1a1d21);
  border-color: #4b515c;
  color: #ffffff;
}

/* Toggle modo oscuro */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--foro-border);
  color: var(--foro-text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

.theme-toggle:hover {
  background: var(--foro-pill-bg, #1a1d21);
  color: var(--foro-text);
}

.foro-game-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border-light);
  color: var(--foro-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  transition: var(--transition);
}

.foro-game-btn:hover {
  background: var(--foro-border);
  color: var(--foro-text);
}

.btn-google-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.btn-google-login-pill:hover {
  background: var(--foro-bg-secondary);
  border-color: var(--foro-accent);
  box-shadow: var(--shadow-sm);
}

.google-icon {
  flex-shrink: 0;
}

/* Perfil usuario */
.forum-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-pill);
  padding: 4px 14px 4px 4px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.forum-user-profile:hover {
  background: var(--foro-bg-secondary);
  border-color: var(--foro-accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.user-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--school-border);
  flex-shrink: 0;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--foro-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-profile-school-badge {
  font-size: 12px;
  color: var(--school-primary, var(--foro-accent, #2563eb));
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.user-profile-school-badge .user-school-name {
  color: var(--school-primary, inherit);
  font-weight: 700;
}

.btn-logout {
  background: none;
  border: none;
  color: var(--foro-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: var(--transition);
  font-size: 16px;
}

.btn-logout:hover {
  color: var(--red-hot);
}

.foro-mobile-search-strip {
  display: none;
}

/* ==========================================================================
   BARRA DE CANALES (OBSOLETA - INTEGRADA AL SIDEBAR IZQUIERDO)
   ========================================================================== */

.foro-channels-strip-wrap {
  display: none !important;
}

/* ==========================================================================
   LAYOUT PRINCIPAL (REDDIT 3-COLUMN LAYOUT)
   ========================================================================== */

.foro-main-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 20px 5rem;
  transition: max-width 0.2s ease;
}

.foro-layout-container {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 312px;
  gap: 24px;
  align-items: start;
  transition: grid-template-columns 0.2s ease;
}

/* Estado Colapsado en PC (Reddit PC Toggle: Oculta / Muestra Canales y Filtros) */
body.sidebar-collapsed .foro-left-sidebar {
  display: none !important;
}

body.sidebar-collapsed .foro-layout-container {
  grid-template-columns: minmax(0, 760px) 312px;
  justify-content: center;
}

body.sidebar-collapsed .foro-main-layout {
  max-width: 1140px;
}

/* ==========================================================================
   SIDEBAR IZQUIERDO: FEEDS, CANALES Y COLEGIOS (REDDIT SEAMLESS RAIL)
   ========================================================================== */

.foro-left-sidebar {
  display: block;
}

.left-sidebar-sticky {
  position: sticky;
  top: calc(var(--foro-header-height) + 12px);
  max-height: calc(100vh - var(--foro-header-height) - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.left-sidebar-sticky::-webkit-scrollbar {
  width: 4px;
}

.left-sidebar-sticky::-webkit-scrollbar-thumb {
  background: var(--foro-border);
  border-radius: var(--r-pill);
}

.left-nav-section {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--foro-border);
  border-radius: 0;
  padding: 10px 4px 14px;
  box-shadow: none;
}

.left-nav-section:last-child {
  border-bottom: none;
}

.left-nav-heading {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--foro-text-muted);
  margin-bottom: 8px;
  padding-left: 10px;
  display: block;
  text-transform: uppercase;
}

.left-nav-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-left: 10px;
  padding-right: 4px;
}

.btn-clear-school-filter {
  background: none;
  border: none;
  color: var(--red-hot);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  transition: var(--transition);
}

.btn-clear-school-filter:hover {
  background: rgba(239, 68, 68, 0.1);
}

.left-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.left-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--foro-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.left-nav-item:hover {
  background: var(--foro-pill-hover, #1a1d21);
  color: var(--foro-text);
}

.left-nav-item.active {
  background: var(--foro-pill-hover, #22252a);
  border-color: transparent;
  color: var(--foro-text);
  font-weight: 700;
}

/* Backdrop para Drawer Mobile */
#sidebar-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#sidebar-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.left-nav-item .nav-icon {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
}

.left-nav-item .nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.left-nav-count {
  margin-left: auto;
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.06);
  color: var(--foro-text-muted);
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-weight: 700;
}

.dark-mode .left-nav-count {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-schools-search-wrap {
  margin-bottom: 8px;
}

.sidebar-school-search-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.8rem;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  color: var(--foro-text);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.sidebar-school-search-input:focus {
  border-color: var(--school-border);
  box-shadow: 0 0 0 2px var(--school-surface);
}

.sidebar-schools-scrollable {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-schools-scrollable::-webkit-scrollbar {
  width: 3px;
}

.sidebar-schools-scrollable::-webkit-scrollbar-thumb {
  background: var(--foro-border);
  border-radius: var(--r-pill);
}

.sidebar-school-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--foro-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.sidebar-school-chip:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.sidebar-school-chip.active {
  background: var(--school-surface, rgba(37, 99, 235, 0.1));
  border-color: var(--school-border, rgba(37, 99, 235, 0.3));
  color: var(--foro-text);
  font-weight: 700;
}

.sidebar-school-chip.active .school-name {
  font-weight: 700;
}

.school-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-school-chip .school-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.left-nav-count {
  font-size: 0.72rem;
  color: var(--foro-text-muted);
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-weight: 700;
  margin-left: auto;
  line-height: 1.3;
  flex-shrink: 0;
}

body.light-mode .left-nav-count,
[data-theme="light"] .left-nav-count {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.left-nav-item.active .left-nav-count,
.sidebar-school-chip.active .left-nav-count {
  background: var(--school-surface, rgba(37, 99, 235, 0.15));
  border-color: var(--school-border, rgba(37, 99, 235, 0.35));
  color: var(--school-primary, #2563eb);
}

.left-nav-links-section {
  background: transparent;
  border: none;
  padding: 4px 8px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.left-nav-link-subtle {
  display: block;
  font-size: 0.8rem;
  color: var(--foro-text-muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: var(--transition);
}

.left-nav-link-subtle:hover {
  color: var(--foro-accent);
  background: var(--school-surface);
}

/* ==========================================================================
   FEED CENTRAL DE DEBATES
   ========================================================================== */

.foro-feed-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  min-width: 0;
}

/* Reddit Quick "Create Post" Card */
.reddit-create-post-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  padding: 10px 16px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.reddit-create-post-card:hover {
  border-color: var(--school-border);
  box-shadow: var(--shadow-sm);
}

.reddit-create-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--foro-border);
  flex-shrink: 0;
}

.reddit-create-input-trigger {
  flex: 1;
  height: 40px;
  background: var(--foro-pill-bg);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  padding: 0 16px;
  text-align: left;
  color: var(--foro-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.reddit-create-input-trigger:hover {
  background: var(--foro-pill-hover);
  border-color: var(--school-border, var(--foro-border-strong));
  color: var(--foro-text);
}

.reddit-create-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reddit-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  background: transparent;
  border: none;
  color: var(--foro-text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
}

.reddit-quick-btn:hover {
  background: var(--foro-bg-secondary);
  transform: scale(1.08);
}

/* Barra ordenamiento estilo Reddit */
.forum-sort-bar-reddit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-lg);
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
  gap: 8px;
}

.sort-pills-group {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
}

.sort-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--foro-text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.sort-pill-btn:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.sort-pill-btn.active {
  background: var(--school-surface);
  border: 1px solid var(--school-border);
  color: var(--foro-accent);
}

.feed-active-indicator {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.active-school-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--school-surface);
  border: 1px solid var(--school-border);
  color: var(--foro-accent);
  cursor: pointer;
}

/* Indicador dinámico de filtro activo en el feed */
.forum-feed-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-lg);
  padding: 8px 14px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.feed-filter-chips-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.feed-filter-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foro-text-muted);
}

.feed-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--foro-pill-bg);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  cursor: pointer;
  transition: var(--transition);
}

.feed-filter-chip:hover {
  background: var(--foro-pill-hover);
  border-color: var(--foro-border-strong);
}

.btn-feed-clear-all {
  background: none;
  border: none;
  color: var(--red-hot);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background 0.15s ease;
}

.btn-feed-clear-all:hover {
  background: rgba(239, 68, 68, 0.1);
}

.active-channel-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--foro-text-muted);
}

.threads-count-pill {
  font-size: 12px;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border-light);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  color: var(--foro-text-muted);
  font-weight: 600;
}

/* ==========================================================================
   TARJETAS DE DEBATE ESTILO REDDIT (CON VOTE GUTTER)
   ========================================================================== */

.threads-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.thread-card {
  display: flex;
  flex-direction: column;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: 12px;
  overflow: hidden;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  position: relative;
}

.thread-card:hover {
  background: var(--foro-card-hover, #121518);
  border-color: var(--foro-border-strong, #34383f);
}

.thread-card.is-pinned {
  border-left: 3px solid var(--gold-primary);
}

/* Ocultar vote gutter en tarjetas Reddit feed (los votos van en el action bar inferior) */
.thread-card .reddit-post-gutter {
  display: none !important;
}

/* Área principal del debate */
.reddit-post-main {
  width: 100%;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.thread-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--foro-text-muted);
}

.reddit-card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.community-meta-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--foro-text-muted);
  flex-wrap: wrap;
}

.community-name {
  font-weight: 700;
  color: var(--foro-text);
  text-decoration: none;
  font-size: 12px;
}

.community-name:hover {
  text-decoration: underline;
}

.meta-separator {
  color: var(--foro-text-muted);
  opacity: 0.6;
}

.school-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.btn-card-overflow {
  background: transparent;
  border: none;
  color: var(--foro-text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: background 0.15s, color 0.15s;
}

.btn-card-overflow:hover {
  background: var(--foro-pill-hover, #22252a);
  color: var(--foro-text);
}

.thread-author-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.thread-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--foro-border);
}

.thread-author-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.thread-author-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.thread-school-badge,
.reddit-school-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--foro-pill-bg);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  line-height: 1.3;
}

.thread-flairs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.meta-dot {
  color: var(--foro-text-muted);
  font-size: 12px;
}

.thread-author-name {
  color: var(--foro-text-secondary);
  font-weight: 600;
  font-size: 12.5px;
}

.thread-author-handle {
  color: var(--foro-text-muted);
  font-size: 12px;
}

.thread-time {
  color: var(--foro-text-muted);
  font-size: 12px;
}

.pinned-badge {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--r-pill);
}

.thread-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-channel-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--foro-accent);
  background: var(--school-surface);
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.thread-title {
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--foro-text);
  margin: 0 0 6px;
  word-break: break-word;
}

.thread-excerpt {
  font-size: 14px;
  color: var(--foro-text-secondary);
  line-height: 1.5;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Barra de acciones en tarjeta (Capsulas Reddit) */
.reddit-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: none;
  flex-wrap: wrap;
}

.reddit-vote-capsule {
  display: inline-flex;
  align-items: center;
  background: var(--foro-pill-bg);
  border: 1px solid transparent;
  border-radius: 9999px;
  height: 32px;
  padding: 0 4px;
  color: var(--foro-text-secondary);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}

.reddit-vote-capsule:hover {
  background: var(--foro-pill-hover);
}

.btn-vote-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}

.btn-vote-arrow:hover {
  background: rgba(125, 125, 125, 0.15);
}

.btn-vote-arrow.vote-up:hover {
  color: var(--reddit-orange, #ff4500);
}

.btn-vote-arrow.vote-down:hover {
  color: #7193ff;
}

.reddit-vote-capsule.voted-up .btn-vote-arrow.vote-up {
  color: var(--reddit-orange, #ff4500);
}

.reddit-vote-capsule.voted-up .vote-count-num {
  color: var(--reddit-orange, #ff4500);
}

.reddit-vote-capsule.voted-down .btn-vote-arrow.vote-down {
  color: #7193ff;
}

.reddit-vote-capsule.voted-down .vote-count-num {
  color: #7193ff;
}

.vote-count-num {
  padding: 0 4px;
  min-width: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.reddit-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--foro-pill-bg);
  border: 1px solid transparent;
  border-radius: 9999px;
  height: 32px;
  padding: 0 12px;
  color: var(--foro-text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}

.reddit-action-pill:hover {
  background: var(--foro-pill-hover);
  color: var(--foro-text);
}

.reddit-action-pill svg,
.btn-vote-arrow svg {
  flex-shrink: 0;
}

.btn-vote-arrow {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-size: 13px;
  line-height: 1;
}

.vote-icon {
  font-size: 14px;
  line-height: 1;
}

/* ==========================================================================
   SIDEBAR LATERAL DERECHO: WIDGETS DE COMUNIDAD
   ========================================================================== */

.foro-desktop-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  position: sticky;
  top: calc(var(--foro-header-height) + 16px);
}

.sidebar-reddit-card {
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.reddit-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--spacing-sm);
}

.reddit-card-icon {
  font-size: 20px;
}

.reddit-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--foro-text);
  margin: 0;
}

.reddit-card-desc {
  font-size: 13px;
  color: var(--foro-text-secondary);
  line-height: 1.5;
  margin: 0 0 var(--spacing-md);
}

/* Tarjeta Acerca de con Hero Strip */
.about-card {
  padding: 0;
}

.reddit-card-hero-strip {
  height: 48px;
  background: var(--school-gradient, linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%));
  transition: background 0.3s ease;
}

.about-card .reddit-card-content {
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
}

.reddit-card-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--foro-bg-secondary);
  border-radius: var(--r-md);
  padding: 10px;
  margin-bottom: 12px;
}

.card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card-stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--foro-text);
  line-height: 1;
}

.card-stat-label {
  font-size: 10.5px;
  color: var(--foro-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  font-weight: 700;
}

.btn-reddit-sidebar-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--school-gradient);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
}

.btn-reddit-sidebar-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Tarjeta Cuenta Regresiva 2026 */
.countdown-card {
  background: linear-gradient(180deg, var(--foro-card) 0%, var(--foro-bg-secondary) 100%);
}

.countdown-subtitle {
  font-size: 12.5px;
  color: var(--foro-text-muted);
  margin: 0 0 10px;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.countdown-box {
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  padding: 8px 4px;
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.countdown-num {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--school-accent, #38bdf8);
  font-family: 'Outfit', system-ui, sans-serif;
  display: block;
  line-height: 1;
}

.countdown-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--foro-text-muted);
  text-transform: uppercase;
  margin-top: 4px;
  display: block;
}

.countdown-footer-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-success);
  text-align: center;
  padding: 6px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--r-sm);
}

/* Top Colegios en Debate */
.sidebar-top-colegios-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-colegio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
  color: inherit;
  text-decoration: none;
}

.top-colegio-item:hover {
  background: var(--foro-bg-secondary);
}

.top-colegio-rank {
  font-size: 12px;
  font-weight: 900;
  color: var(--foro-text-muted);
  width: 14px;
  text-align: center;
}

.top-colegio-badge {
  font-size: 1rem;
  line-height: 1;
}

.top-colegio-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foro-text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-colegio-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--foro-text-muted);
  background: var(--foro-bg-secondary);
  padding: 2px 7px;
  border-radius: var(--r-pill);
}

/* Reglas de Convivencia Numeradas */
.rules-list-numbered {
  padding-left: 18px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rules-list-numbered li {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--foro-text-secondary);
}

.rules-list-numbered strong {
  color: var(--foro-text);
  display: block;
}

/* ==========================================================================
   BOTÓN FLOTANTE (FAB)
   ========================================================================== */

.btn-fab-topic {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--school-gradient);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-fab-topic:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 24px 32px rgba(0, 0, 0, 0.15);
}

.btn-fab-topic:active {
  transform: translateY(-1px) scale(0.98);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.foro-footer {
  background: var(--foro-card);
  border-top: 1px solid var(--foro-border);
  padding: var(--spacing-xl) var(--spacing-lg);
  margin-top: var(--spacing-xl);
}

.foro-footer-inner {
  max-width: var(--foro-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.foro-footer-brand .brand-logo {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: var(--foro-text);
}

.foro-footer-brand p {
  font-size: 13px;
  color: var(--foro-text-muted);
  margin: 4px 0 0;
}

.foro-footer-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.foro-footer-link {
  color: var(--foro-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.foro-footer-link:hover {
  color: var(--foro-text);
}

.foro-footer-admin-btn {
  background: none;
  border: 1px solid var(--foro-border);
  color: var(--foro-text-muted);
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.foro-footer-admin-btn:hover {
  color: var(--foro-text);
  border-color: var(--foro-accent);
}

/* Botón Load More */
.forum-load-more-wrap {
  display: flex;
  justify-content: center;
  padding: var(--spacing-lg) 0;
}

.btn-load-more-threads {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  padding: 12px 24px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-load-more-threads:hover {
  background: var(--foro-bg-secondary);
  border-color: var(--foro-accent);
}

/* ==========================================================================
   MODAL THREAD (Hilo Completo)
   ========================================================================== */

.thread-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  overflow-y: auto;
}

.thread-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.thread-modal-card {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--foro-card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.thread-modal-header {
  padding: var(--spacing-lg);
  background: var(--foro-bg-secondary);
  border-bottom: 1px solid var(--foro-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-shrink: 0;
}

.thread-modal-header-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.btn-modal-back-reddit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  border-radius: var(--r-md);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-modal-back-reddit:hover {
  background: var(--foro-bg-secondary);
}

.thread-modal-date {
  font-size: 13px;
  color: var(--foro-text-muted);
}

/* ==========================================================================
   PESTAÑA COMPLETA DE HILO Y DEBATE (REDDIT & TWITTER FULL PAGE VIEW)
   ========================================================================== */

.forum-feed-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.18s ease-in-out;
}

.forum-thread-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* 1. Barra de Navegación Superior del Hilo (Minimal Reddit Back) */
.thread-page-nav-bar {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  padding: 4px 0 6px;
  margin-bottom: 4px;
}

.btn-thread-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  color: var(--foro-text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.btn-thread-nav-back:hover {
  background: var(--foro-bg-secondary);
  border-color: var(--foro-accent);
  color: var(--foro-accent);
  transform: translateX(-2px);
}

.nav-back-arrow {
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.18s ease;
}

.btn-thread-nav-back:hover .nav-back-arrow {
  transform: translateX(-3px);
}

.kbd-back-key {
  font-size: 0.7rem;
  font-family: monospace;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--foro-border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--foro-text-muted);
  line-height: 1;
}

body.light-mode .kbd-back-key,
[data-theme="light"] .kbd-back-key {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

/* En mobile se oculta el botón 'Volver a debates' para usar los botones nativos del sistema/gestos */
@media (max-width: 768px) {
  .thread-page-nav-bar,
  .btn-thread-nav-back {
    display: none !important;
  }
}

/* ==========================================================================
   2. TARJETA DE PUBLICACIÓN NATIVA REDDIT (.reddit-post-page-card)
   ========================================================================== */
.reddit-post-page-card {
  background: var(--foro-card, #0e1113);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
}

.reddit-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.reddit-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--foro-border);
  transition: transform 0.18s ease;
}

.reddit-avatar-circle:hover {
  transform: scale(1.08);
}

.reddit-meta-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.reddit-community-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--foro-text, #f8fafc);
  line-height: 1.2;
}

.reddit-community-title {
  color: var(--foro-text, #f8fafc);
  font-weight: 700;
}

.reddit-meta-dot {
  color: var(--foro-text-muted, #818384);
  font-size: 0.75rem;
}

.reddit-time-ago {
  color: var(--foro-text-muted, #818384);
  font-weight: 400;
  font-size: 0.82rem;
}

.reddit-author-line {
  font-size: 0.82rem;
  color: var(--foro-text-muted, #818384);
  font-weight: 500;
  line-height: 1.2;
}

.reddit-author-text {
  cursor: pointer;
  transition: color 0.15s ease;
}

.reddit-author-text:hover {
  color: var(--foro-text, #d7dadc);
  text-decoration: underline;
}

.reddit-more-options-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--foro-text-muted, #818384);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-md);
  transition: var(--transition);
  line-height: 1;
}

.reddit-more-options-btn:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.reddit-title-text {
  font-family: inherit;
  font-size: 1.48rem;
  font-weight: 700;
  color: var(--foro-text, #f8fafc);
  line-height: 1.34;
  margin: 0 0 10px;
  letter-spacing: -0.012em;
}

.reddit-flairs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.reddit-flair-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.reddit-school-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

body.light-mode .reddit-flair-tag,
[data-theme="light"] .reddit-flair-tag {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

body.light-mode .reddit-school-tag,
[data-theme="light"] .reddit-school-tag {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

.reddit-body-content {
  font-size: 0.98rem;
  color: var(--foro-text-secondary, #d7dadc);
  line-height: 1.72;
  margin-bottom: 18px;
  word-break: break-word;
}

.reddit-body-content p {
  margin: 0 0 12px;
}

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

.reddit-body-content blockquote {
  margin: 12px 0;
  padding: 10px 16px;
  background: var(--foro-bg-secondary);
  border-left: 3px solid var(--school-accent, #38bdf8);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--foro-text);
  font-style: italic;
}

/* Barra de Píldoras Ovaladas de Reddit */
.reddit-action-pills-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
}

.reddit-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: var(--foro-text, #d7dadc);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.1s ease;
  font-family: inherit;
  user-select: none;
}

body.light-mode .reddit-pill-btn,
[data-theme="light"] .reddit-pill-btn {
  background: #f1f5f9;
  color: #334155;
}

.reddit-pill-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

body.light-mode .reddit-pill-btn:hover,
[data-theme="light"] .reddit-pill-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.reddit-vote-pill {
  padding: 0;
}

.reddit-vote-arrow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--r-pill);
  font-family: inherit;
}

.reddit-vote-arrow-btn .arrow-icon {
  font-size: 1.05rem;
  line-height: 1;
  color: var(--foro-text-muted, #94a3b8);
  transition: color 0.15s ease, transform 0.15s ease;
}

.reddit-vote-arrow-btn:hover .arrow-icon {
  color: #ff4500;
}

.reddit-vote-arrow-btn.voted {
  color: #ff4500;
}

.reddit-vote-arrow-btn.voted .arrow-icon {
  color: #ff4500;
}

.vote-number {
  min-width: 14px;
  text-align: center;
}

.pill-icon {
  font-size: 0.92rem;
  line-height: 1;
}


/* ==========================================================================
   3. BARRA "JOIN THE CONVERSATION" (REDDIT EXPANDABLE COMPOSER)
   ========================================================================== */
.reddit-join-conversation-wrap {
  margin: 12px 0;
}

.reddit-join-bar {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--foro-card, #0e1113);
  border: 1px solid var(--foro-border);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.reddit-join-bar:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

body.light-mode .reddit-join-bar:hover,
[data-theme="light"] .reddit-join-bar:hover {
  border-color: #94a3b8;
}

.reddit-join-placeholder {
  color: var(--foro-text-muted, #818384);
  font-size: 0.92rem;
  font-weight: 500;
  user-select: none;
}

.reddit-expanded-composer {
  animation: fadeIn 0.18s ease;
}

.reddit-composer-box {
  background: var(--foro-card, #0e1113);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease;
}

.reddit-composer-box:focus-within {
  border-color: var(--foro-accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.reply-format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--foro-border);
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .reply-format-toolbar,
[data-theme="light"] .reply-format-toolbar {
  background: rgba(0, 0, 0, 0.03);
}

.btn-reply-format {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--foro-text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-reply-format:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.reddit-composer-textarea {
  width: 100%;
  min-height: 85px;
  background: transparent;
  border: none;
  padding: 12px 16px;
  color: var(--foro-text);
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.reddit-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--foro-border);
  gap: 12px;
}

.reddit-composer-hint {
  font-size: 0.8rem;
  color: var(--foro-text-muted);
}

.composer-btn-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reddit-btn-cancel {
  background: transparent;
  border: 1px solid var(--foro-border);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--foro-text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.reddit-btn-cancel:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.reddit-btn-comment {
  background: #d7dadc;
  color: #0e1113;
  border: none;
  border-radius: var(--r-pill);
  padding: 6px 20px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease;
}

.reddit-btn-comment:hover {
  background: #ffffff;
}

body.light-mode .reddit-btn-comment,
[data-theme="light"] .reddit-btn-comment {
  background: #0f172a;
  color: #ffffff;
}

/* ==========================================================================
   4. CONTROLES DE COMENTARIOS (SORT & SEARCH STYLE REDDIT)
   ========================================================================== */
.reddit-comments-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
  flex-wrap: wrap;
}

.reddit-sort-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reddit-sort-label {
  color: var(--foro-text-muted, #818384);
  font-size: 0.84rem;
  font-weight: 500;
}

.reddit-sort-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--foro-text, #f8fafc);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--r-md);
  transition: background 0.15s ease;
}

.reddit-sort-select-btn:hover {
  background: var(--foro-bg-secondary);
}

.sort-caret {
  font-size: 0.72rem;
  color: var(--foro-text-muted, #818384);
}

.reddit-sort-popup-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  background: var(--foro-card, #1a1a1b);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  padding: 4px;
  min-width: 120px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.reddit-sort-option {
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--foro-text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
  display: block;
  transition: var(--transition);
}

.reddit-sort-option:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

.reddit-sort-option.active {
  color: var(--school-accent, #38bdf8);
  font-weight: 700;
}

.reddit-comments-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--foro-border);
  width: 220px;
  transition: border-color 0.18s ease, background 0.18s ease;
}

body.light-mode .reddit-comments-search-wrap,
[data-theme="light"] .reddit-comments-search-wrap {
  background: #f1f5f9;
}

.reddit-comments-search-wrap:focus-within {
  border-color: var(--foro-accent);
  background: rgba(255, 255, 255, 0.09);
}

.search-lens-icon {
  font-size: 0.82rem;
  color: var(--foro-text-muted);
}

.reddit-comments-search-field {
  background: transparent;
  border: none;
  color: var(--foro-text);
  font-size: 0.84rem;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.reddit-comments-search-field::placeholder {
  color: var(--foro-text-muted);
}

/* ==========================================================================
   5. ÁRBOL CONTINUO DE COMENTARIOS REDDIT (.reddit-comments-tree-stream)
   ========================================================================== */
.reddit-comments-tree-stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.empty-state-stream {
  text-align: center;
  padding: 40px 20px;
  background: var(--foro-card);
  border: 1px dashed var(--foro-border);
  border-radius: var(--r-xl);
  color: var(--foro-text-muted);
}

.empty-state-stream .empty-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 10px;
}

.empty-state-stream p {
  margin: 0;
  font-size: 0.95rem;
}

/* Bloque individual de comentario */
.reddit-comment-block {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 6px 0;
}

.reddit-comment-block.is-collapsed .reddit-comment-body-wrapper {
  display: none !important;
}

.reddit-comment-block.is-collapsed .reddit-comment-collapse-btn {
  color: var(--school-accent, #38bdf8);
}

/* Cabecera del autor del comentario */
.reddit-comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.reddit-comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border: 1px solid var(--foro-border);
  transition: transform 0.15s ease;
}

.reddit-comment-avatar:hover {
  transform: scale(1.08);
}

.reddit-comment-author-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.reddit-comment-author {
  font-weight: 700;
  color: var(--foro-text, #f8fafc);
  cursor: pointer;
}

.reddit-comment-author:hover {
  text-decoration: underline;
  color: var(--foro-accent);
}

.reddit-comment-time {
  color: var(--foro-text-muted, #818384);
  font-weight: 400;
}

.reddit-op-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
}

.reddit-comment-school {
  font-size: 0.75rem;
  color: var(--foro-text-muted, #94a3b8);
  font-weight: 600;
}

/* Contenedor de cuerpo y guía vertical */
.reddit-comment-body-wrapper {
  display: flex;
  position: relative;
  margin-left: 13px; /* Centrado bajo el avatar de 28px */
}

.reddit-thread-line-container {
  width: 20px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  position: relative;
  padding: 2px 0 6px;
}

.reddit-thread-line {
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 1px;
  transition: background 0.18s ease;
}

body.light-mode .reddit-thread-line,
[data-theme="light"] .reddit-thread-line {
  background: #cbd5e1;
}

.reddit-thread-line-container:hover .reddit-thread-line {
  background: var(--school-accent, #38bdf8);
}

.reddit-comment-main-col {
  flex: 1;
  min-width: 0;
  padding-left: 6px;
}

.reddit-comment-text {
  color: var(--foro-text-secondary, #d7dadc);
  font-size: 0.94rem;
  line-height: 1.58;
  margin-bottom: 6px;
  word-break: break-word;
}

.reddit-comment-text p {
  margin: 0 0 8px;
}

.reddit-comment-text p:last-child {
  margin-bottom: 0;
}

.reddit-comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--foro-text-muted, #818384);
}

.reddit-comment-collapse-btn {
  background: transparent;
  border: none;
  color: var(--foro-text-muted, #818384);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  transition: var(--transition);
}

.reddit-comment-collapse-btn:hover {
  color: var(--foro-text);
  background: var(--foro-bg-secondary);
}

.reddit-comment-vote-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reddit-comment-vote-arrow {
  background: transparent;
  border: none;
  color: var(--foro-text-muted, #818384);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: var(--transition);
}

.reddit-comment-vote-arrow:hover {
  color: #ff4500;
  background: rgba(255, 255, 255, 0.08);
}

.reddit-comment-vote-arrow.voted {
  color: #ff4500;
  font-weight: 700;
}

.reddit-comment-vote-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: inherit;
  min-width: 14px;
  text-align: center;
}

.reddit-comment-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--foro-text-muted, #818384);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-family: inherit;
  transition: var(--transition);
}

.reddit-comment-action-btn:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
}

/* Mini-Compositor Inline desplegable */
.reddit-inline-reply-box {
  margin-top: 8px;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-lg);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.15s ease;
}

.reddit-inline-textarea {
  width: 100%;
  min-height: 60px;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  padding: 8px 10px;
  color: var(--foro-text);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.reddit-inline-textarea:focus {
  border-color: var(--foro-accent);
}

.reddit-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Compatibilidad de selectores heredados */
.reply-card {
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-lg);
  padding: 14px;
}

/* Respuestas anidadas en el árbol de comentarios (Reddit Nested Tree) */
.reddit-comment-replies {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.09);
  padding-left: 10px;
  margin-left: 4px;
}

body.light-mode .reddit-comment-replies,
[data-theme="light"] .reddit-comment-replies {
  border-left-color: #e2e8f0;
}

.reddit-comment-reply-block {
  padding: 4px 0;
  position: relative;
}

.reddit-comment-reply-block .reddit-comment-avatar {
  width: 24px;
  height: 24px;
}

.reddit-comment-reply-block .reddit-comment-body-wrapper {
  margin-left: 11px;
}

/* ==========================================================================
   MODAL DE PERFIL DE USUARIO ESTILO REDDIT (REDDIT PROFILE & TROPHY CASE)
   ========================================================================== */

.profile-modal-overlay,
.profile-modal-overlay,
.reddit-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-modal-overlay.active,
.profile-modal-overlay.is-active,
.profile-modal-overlay.open,
.reddit-modal-overlay.active,
.reddit-modal-overlay.open {
  display: flex;
  animation: redditFadeIn 0.22s ease-out;
}

@keyframes redditFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes redditSlideUp {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-modal-card,
.reddit-profile-card {
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 740px;
  margin: auto;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: redditSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reddit Hero Banner con colores institucionales */
.reddit-hero-banner,
.profile-hero-banner {
  height: 140px;
  background: var(--foro-bg-secondary);
  border-bottom: 1px solid var(--foro-border);
  position: relative;
  background-size: cover;
  background-position: center;
}

/* Botón de Cierre Flotante */
.reddit-close-btn,
.profile-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-md);
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  color: var(--foro-text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  transition: var(--transition);
}

.reddit-close-btn:hover,
.profile-close-btn:hover {
  background: var(--foro-bg-secondary);
  color: var(--foro-text);
  border-color: var(--foro-border);
}

/* Acciones en el Banner Superior */
.reddit-banner-actions {
  position: absolute;
  top: 14px;
  right: 58px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 14;
}

.reddit-btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  font-family: inherit;
}

.reddit-btn-edit {
  background: var(--foro-accent);
  color: #ffffff;
  border-color: transparent;
}

.reddit-btn-edit:hover {
  filter: brightness(1.08);
}

.reddit-btn-secondary {
  background: var(--foro-card);
  border-color: var(--foro-border);
  color: var(--foro-text);
}

.reddit-btn-secondary:hover {
  background: var(--foro-bg-secondary);
}

.reddit-btn-mod {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #ef4444;
}

.reddit-btn-mod:hover {
  background: rgba(220, 38, 38, 0.2);
}

/* Avatar Superpuesto Estilo Reddit */
.reddit-avatar-wrapper {
  position: absolute;
  bottom: -44px;
  left: 24px;
  z-index: 10;
}

.reddit-avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  background: var(--foro-card);
  border: 2px solid var(--foro-border);
  box-shadow: var(--shadow-md);
  position: relative;
}

.reddit-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: var(--foro-card);
  border: 2px solid var(--foro-card);
  display: block;
}

.reddit-flair-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 2px solid var(--foro-card);
  box-shadow: var(--shadow-sm);
  background: var(--gold-primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* Cuerpo del Perfil */
.reddit-profile-body,
.profile-body {
  padding: 58px 28px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Bloque de Identidad Estilo Reddit */
.reddit-identity-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reddit-names-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reddit-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reddit-display-name,
.profile-user-name {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 1.55rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.reddit-handle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reddit-u-handle,
.profile-user-handle {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--foro-cyan, #38bdf8);
  background: var(--school-surface, rgba(56, 189, 248, 0.1));
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
  letter-spacing: 0.3px;
}

/* Flairs Temáticos */
.reddit-flairs-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.reddit-flair-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reddit-flair-pill.flair-school {
  background: var(--school-surface, rgba(56, 189, 248, 0.12));
  color: var(--school-primary, #38bdf8);
  border-color: var(--school-border, rgba(56, 189, 248, 0.35));
}

.reddit-flair-pill.flair-role {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.reddit-flair-pill.flair-grade {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

/* Biografía */
.reddit-bio-text,
.profile-user-bio {
  font-size: 0.92rem;
  color: var(--foro-text-secondary, #cbd5e1);
  line-height: 1.55;
  margin: 4px 0 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Instagram */
.reddit-social-row {
  margin-top: 2px;
}

.reddit-instagram-pill,
.profile-instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #f472b6;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.25);
  padding: 4px 12px;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.reddit-instagram-pill:hover,
.profile-instagram-link:hover {
  background: rgba(244, 114, 182, 0.2);
  transform: translateY(-1px);
}

/* Barra de Reputación y Cake Day Estilo Reddit */
.reddit-karma-cakeday-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 12px 18px;
  margin-top: 6px;
}

.reddit-karma-group {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.reddit-karma-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reddit-karma-item.karma-highlight {
  padding-right: 4px;
}

.karma-number {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.karma-caption {
  font-size: 0.7rem;
  color: var(--foro-text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.reddit-karma-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
}

.reddit-cakeday-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: 600;
}

.cakeday-icon {
  font-size: 1rem;
}

/* Navegación de Pestañas Estilo Reddit */
.reddit-tabs-nav,
.profile-main-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.reddit-tab-btn,
.profile-main-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--foro-text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.reddit-tab-btn:hover,
.profile-main-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.reddit-tab-btn.active,
.profile-main-tab-btn.active {
  background: var(--school-surface, rgba(56, 189, 248, 0.16));
  border-color: var(--school-primary, var(--foro-cyan, #38bdf8));
  color: #fff;
  box-shadow: 0 0 16px var(--school-glow, rgba(56, 189, 248, 0.25));
}

.reddit-tab-panel,
.profile-view-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeInProfileTab 0.22s ease-out;
}

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

/* Listas de Feed estilo Reddit */
.reddit-feed-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Tarjeta de Debate / Post Estilo Reddit */
.reddit-post-card {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  align-items: flex-start;
}

.reddit-post-card:hover {
  border-color: var(--school-border, rgba(56, 189, 248, 0.35));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.reddit-post-vote-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-weight: 900;
  font-size: 0.95rem;
  color: #ffffff;
}

.reddit-vote-arrow {
  font-size: 0.78rem;
  color: var(--school-primary, var(--foro-cyan, #38bdf8));
}

.reddit-post-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.reddit-post-header {
  font-size: 0.75rem;
  color: var(--foro-text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.reddit-channel-badge {
  color: var(--school-primary, var(--foro-cyan, #38bdf8));
  font-weight: 700;
}

.reddit-post-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.reddit-post-card:hover .reddit-post-title {
  color: var(--school-primary, var(--foro-cyan, #38bdf8));
}

.reddit-post-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--foro-text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.reddit-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Tarjeta de Comentario Estilo Reddit */
.reddit-comment-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--school-primary, var(--foro-cyan, #38bdf8));
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.reddit-comment-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  border-color: var(--school-border, rgba(56, 189, 248, 0.35));
}

.reddit-comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--foro-text-muted);
  font-weight: 600;
}

.reddit-comment-thread-ref {
  color: var(--school-primary, var(--foro-cyan, #38bdf8));
  font-weight: 700;
}

.reddit-comment-body {
  font-size: 0.88rem;
  color: #e2e8f0;
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.reddit-comment-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--foro-text-muted);
  font-weight: 600;
}

/* Estados Vacíos en Feeds */
.reddit-empty-feed {
  padding: 36px 16px;
  text-align: center;
  color: var(--foro-text-muted);
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.reddit-empty-icon {
  font-size: 2rem;
  opacity: 0.7;
}

/* Vitrina de Trofeos Estilo Reddit (Trophy Case) */
.reddit-trophy-case {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reddit-trophy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), transparent);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 14px;
}

.trophy-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trophy-header-icon {
  font-size: 1.8rem;
}

.trophy-header-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.trophy-header-subtitle {
  font-size: 0.78rem;
  color: var(--foro-text-muted);
  margin: 3px 0 0 0;
  line-height: 1.4;
}

.reddit-trophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.reddit-trophy-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: help;
}

.reddit-trophy-card:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.reddit-trophy-icon {
  font-size: 2rem;
  min-width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.reddit-trophy-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.reddit-trophy-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.reddit-trophy-desc {
  font-size: 0.74rem;
  color: var(--foro-text-muted);
  line-height: 1.35;
}

/* Panel de Edición Inline */
.reddit-edit-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reddit-edit-header-strip {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.reddit-edit-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.reddit-edit-subtitle {
  font-size: 0.84rem;
  color: var(--foro-text-muted);
  margin: 4px 0 0 0;
}

.reddit-photo-edit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
}

.photo-preview-wrap {
  position: relative;
  width: 110px;
  height: 110px;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.1);
}

.photo-upload-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 34px;
  height: 34px;
  background: var(--foro-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  border: 2px solid var(--foro-card);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  color: #ffffff;
}

.photo-upload-badge:hover {
  filter: brightness(1.1);
}

.photo-actions-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-photo-action {
  padding: 8px 16px;
  background: var(--foro-accent);
  border: none;
  color: white;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}

.btn-photo-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
}

.btn-photo-action-outline {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--foro-text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-photo-action-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.reddit-username-input-wrap {
  display: flex;
  align-items: center;
  background: var(--foro-bg-secondary, #121824);
  border: 1px solid var(--foro-border, rgba(255, 255, 255, 0.1));
  border-radius: 8px;
  overflow: hidden;
}

.reddit-username-input-wrap .username-at {
  padding: 10px 12px;
  font-weight: 800;
  color: var(--foro-cyan, #38bdf8);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.reddit-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Contadores en pestañas */
#profile-count-tab-threads,
#profile-count-tab-replies,
#profile-count-tab-badges {
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  color: var(--foro-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
}

.reddit-tab-btn.active #profile-count-tab-threads,
.reddit-tab-btn.active #profile-count-tab-replies,
.reddit-tab-btn.active #profile-count-tab-badges {
  background: var(--school-surface, rgba(56, 189, 248, 0.25));
  color: var(--school-primary, #38bdf8);
}

/* Responsive para móvil */
@media (max-width: 768px) {
  .profile-modal-overlay,
  .reddit-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .profile-modal-card,
  .reddit-profile-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 94vh;
  }

  .reddit-banner-actions {
    right: 54px;
    gap: 6px;
  }

  .reddit-btn-action span:not(.btn-icon):not(:first-child) {
    display: none;
  }

  .reddit-btn-action {
    padding: 7px 10px;
  }

  .reddit-profile-body {
    padding: 54px 18px 24px 18px;
  }

  .profile-form-grid-2 {
    grid-template-columns: 1fr;
  }

  .reddit-karma-cakeday-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .reddit-karma-group {
    width: 100%;
    justify-content: space-between;
  }

  .reddit-trophy-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   MODO CLARO PARA MODAL DE PERFILES DE USUARIO ESTILO REDDIT
   ========================================================================== */

body.light-mode .reddit-profile-card,
body.light-mode .profile-modal-card,
[data-theme="light"] .reddit-profile-card,
[data-theme="light"] .profile-modal-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22) !important;
}

body.light-mode .reddit-hero-banner::after,
body.light-mode .profile-hero-banner::after,
[data-theme="light"] .reddit-hero-banner::after,
[data-theme="light"] .profile-hero-banner::after {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.35) 100%) !important;
}

body.light-mode .reddit-close-btn,
body.light-mode .profile-close-btn,
[data-theme="light"] .reddit-close-btn,
[data-theme="light"] .profile-close-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

body.light-mode .reddit-avatar-img,
[data-theme="light"] .reddit-avatar-img {
  background: #ffffff !important;
  border: 3px solid #ffffff !important;
}

body.light-mode .reddit-display-name,
body.light-mode .profile-user-name,
[data-theme="light"] .reddit-display-name,
[data-theme="light"] .profile-user-name {
  color: #0f172a !important;
}

body.light-mode .reddit-u-handle,
[data-theme="light"] .reddit-u-handle {
  background: #f1f5f9 !important;
  color: var(--school-primary, #0284c7) !important;
}

body.light-mode .reddit-bio-text,
body.light-mode .profile-user-bio,
[data-theme="light"] .reddit-bio-text,
[data-theme="light"] .profile-user-bio {
  color: #334155 !important;
}

body.light-mode .reddit-karma-cakeday-bar,
[data-theme="light"] .reddit-karma-cakeday-bar {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .karma-number,
[data-theme="light"] .karma-number {
  color: #0f172a !important;
}

body.light-mode .reddit-karma-divider,
[data-theme="light"] .reddit-karma-divider {
  background: #cbd5e1 !important;
}

body.light-mode .reddit-cakeday-item,
[data-theme="light"] .reddit-cakeday-item {
  color: #64748b !important;
}

body.light-mode .reddit-tabs-nav,
[data-theme="light"] .reddit-tabs-nav {
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode .reddit-tab-btn,
body.light-mode .profile-main-tab-btn,
[data-theme="light"] .reddit-tab-btn,
[data-theme="light"] .profile-main-tab-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

body.light-mode .reddit-tab-btn:hover,
body.light-mode .profile-main-tab-btn:hover,
[data-theme="light"] .reddit-tab-btn:hover,
[data-theme="light"] .profile-main-tab-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .reddit-tab-btn.active,
body.light-mode .profile-main-tab-btn.active,
[data-theme="light"] .reddit-tab-btn.active,
[data-theme="light"] .profile-main-tab-btn.active {
  background: var(--school-primary, #0284c7) !important;
  border-color: var(--school-primary, #0284c7) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3) !important;
}

body.light-mode .reddit-post-card,
body.light-mode .reddit-comment-card,
[data-theme="light"] .reddit-post-card,
[data-theme="light"] .reddit-comment-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .reddit-post-card:hover,
[data-theme="light"] .reddit-post-card:hover {
  background: #ffffff !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode .reddit-post-title,
[data-theme="light"] .reddit-post-title {
  color: #0f172a !important;
}

body.light-mode .reddit-post-vote-box,
[data-theme="light"] .reddit-post-vote-box {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

body.light-mode .reddit-comment-body,
[data-theme="light"] .reddit-comment-body {
  color: #1e293b !important;
}

body.light-mode .reddit-trophy-card,
[data-theme="light"] .reddit-trophy-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .reddit-trophy-card:hover,
[data-theme="light"] .reddit-trophy-card:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

body.light-mode .reddit-trophy-title,
[data-theme="light"] .reddit-trophy-title {
  color: #0f172a !important;
}

body.light-mode .reddit-trophy-header,
[data-theme="light"] .reddit-trophy-header {
  background: #fffbeb !important;
  border-color: #fde68a !important;
}

body.light-mode .trophy-header-title,
[data-theme="light"] .trophy-header-title {
  color: #92400e !important;
}

body.light-mode .reddit-edit-header-strip,
body.light-mode .reddit-photo-edit-card,
[data-theme="light"] .reddit-edit-header-strip,
[data-theme="light"] .reddit-photo-edit-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

body.light-mode .reddit-edit-title,
[data-theme="light"] .reddit-edit-title {
  color: #0f172a !important;
}

body.light-mode #profile-count-tab-threads,
body.light-mode #profile-count-tab-replies,
body.light-mode #profile-count-tab-badges,
[data-theme="light"] #profile-count-tab-threads,
[data-theme="light"] #profile-count-tab-replies,
[data-theme="light"] #profile-count-tab-badges {
  background: #e2e8f0 !important;
  color: #475569 !important;
}

body.light-mode .reddit-tab-btn.active #profile-count-tab-threads,
body.light-mode .reddit-tab-btn.active #profile-count-tab-replies,
body.light-mode .reddit-tab-btn.active #profile-count-tab-badges,
[data-theme="light"] .reddit-tab-btn.active #profile-count-tab-threads,
[data-theme="light"] .reddit-tab-btn.active #profile-count-tab-replies,
[data-theme="light"] .reddit-tab-btn.active #profile-count-tab-badges {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   MODALES GENERALES (Topic, Auth, Onboarding, etc)
   ========================================================================== */

.topic-modal-overlay,
.auth-modal-overlay,
.admin-modal-overlay,
.profile-modal-overlay,
.share-modal-overlay,
.report-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  overflow-y: auto;
}

.topic-modal-overlay.active,
.auth-modal-overlay.active,
.admin-modal-overlay.active,
.profile-modal-overlay.active,
.profile-modal-overlay.is-active,
.share-modal-overlay.active,
.report-modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.topic-modal-card,
.auth-modal-card,
.admin-modal-card,
.profile-modal-card,
.share-modal-card,
.report-modal-card {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.share-modal-card {
  max-width: 480px;
}

.onboarding-modal-card {
  max-width: 520px;
}

.profile-modal-card {
  max-width: 660px;
}

.topic-modal-header,
.auth-modal-header,
.admin-modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--foro-border);
  position: relative;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-icon,
.auth-modal-icon,
.admin-modal-icon {
  font-size: 24px;
}

.auth-modal-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-modal-title,
.admin-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--foro-text);
  margin: 0;
}

.auth-modal-desc,
.admin-modal-desc {
  font-size: 14px;
  color: var(--foro-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.topic-modal-card .btn-close-modal,
.auth-modal-card .btn-close-modal,
.share-modal-card .btn-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

/* Modal Compartir Debate */
.share-modal-card .topic-modal-header {
  padding-right: 48px;
}

.share-modal-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.share-modal-main-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--foro-text);
  margin: 0;
}

.share-modal-thread-title {
  font-size: 13px;
  color: var(--foro-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.share-modal-body {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foro-text-secondary);
  margin: 0;
}

.share-social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 10px;
}

.share-social-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: var(--foro-card-hover, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-social-btn .social-icon {
  font-size: 22px;
  line-height: 1;
}

.share-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.share-social-btn.share-whatsapp:hover {
  background: rgba(37, 211, 102, 0.12);
  border-color: #25D366;
  color: #25D366;
}

.share-social-btn.share-x:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
  color: #ffffff;
}

.share-social-btn.share-telegram:hover {
  background: rgba(0, 136, 204, 0.12);
  border-color: #0088cc;
  color: #0088cc;
}

.share-social-btn.share-native:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.share-copy-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--foro-card-inner, rgba(0, 0, 0, 0.2));
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--foro-border);
}

.share-copy-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--foro-text-secondary);
  margin: 0;
}

.share-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-input-url {
  flex: 1;
  min-width: 0;
  background: var(--foro-card, #11141e);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--foro-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  text-overflow: ellipsis;
}

.share-input-url:focus {
  border-color: var(--gold-primary);
}

.btn-share-copy-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--gold-primary, #f59e0b);
  color: #090a0f;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-share-copy-action:hover {
  background: var(--gold-hover, #fbbf24);
  transform: scale(1.02);
}

.btn-share-copy-action.copied {
  background: #10b981 !important;
  color: #ffffff !important;
}

/* Menú Desplegable Flotante de Opciones (Tres Puntitos) */
.forum-more-dropdown {
  position: fixed;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  background: var(--foro-card, #11141e);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md, 10px);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  min-width: 180px;
  gap: 2px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.15s ease-out;
}

.dropdown-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm, 6px);
  background: transparent;
  border: none;
  color: var(--foro-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.dropdown-action-btn:hover {
  background: var(--foro-card-hover, rgba(255, 255, 255, 0.08));
}

.dropdown-action-btn.action-danger {
  color: #f87171;
}

.dropdown-action-btn.action-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Modal Reportar Usuario / Publicación */
.report-modal-card {
  max-width: 480px;
}

.report-modal-card .btn-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.report-modal-main-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--foro-text);
  margin: 0;
}

.report-modal-subtitle {
  font-size: 13px;
  color: var(--foro-text-secondary);
  margin: 0;
}

.report-modal-body {
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-target-preview {
  background: var(--foro-card-inner, rgba(0, 0, 0, 0.25));
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.report-preview-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-primary, #f59e0b);
}

.report-preview-snippet {
  font-size: 13px;
  color: var(--foro-text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.report-section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--foro-text);
  margin: 0;
}

.report-reasons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-reason-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  cursor: pointer;
  background: var(--foro-card-inner, rgba(0, 0, 0, 0.15));
  transition: all 0.15s ease;
}

.report-reason-item:hover {
  background: var(--foro-card-hover, rgba(255, 255, 255, 0.05));
  border-color: rgba(255, 255, 255, 0.2);
}

.report-reason-item input[type="radio"] {
  accent-color: #ef4444;
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
}

.report-reason-item .reason-text {
  font-size: 13px;
  color: var(--foro-text);
  font-weight: 500;
  flex: 1;
}

.report-details-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-details-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--foro-text-secondary);
  margin: 0;
}

.report-details-textarea {
  background: var(--foro-card, #11141e);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--foro-text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 54px;
}

.report-details-textarea:focus {
  border-color: #ef4444;
}

/* Formularios */
.topic-form,
.auth-form,
.admin-form,
.onboarding-form {
  padding: var(--spacing-lg);
}

.topic-form-group {
  margin-bottom: var(--spacing-md);
}

.topic-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--foro-text);
  margin-bottom: 6px;
}

.required-star {
  color: var(--red-hot);
}

.topic-form-input,
.topic-form-select,
.topic-form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  border-radius: var(--r-md);
  color: var(--foro-text);
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
}

.topic-form-input:focus,
.topic-form-select:focus,
.topic-form-textarea:focus {
  outline: none;
  border-color: var(--foro-accent);
  box-shadow: 0 0 0 3px var(--school-surface);
  background: var(--foro-card);
}

.topic-form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: var(--foro-text-muted);
  margin-top: 4px;
}

.form-hint-lock {
  font-weight: 600;
  color: var(--foro-warning, #d97706);
}

.btn-propose-topic,
.btn-submit-admin-login {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--school-gradient);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  margin-top: var(--spacing-md);
}

.btn-propose-topic:hover,
.btn-submit-admin-login:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary-modal {
  width: 100%;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary-modal:hover {
  background: var(--foro-border);
}

/* Google Login Container */
.google-login-action-wrap {
  padding: var(--spacing-md) 0;
}

.google-gis-container {
  display: flex;
  justify-content: center;
}

/* Username validator */
.username-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.username-at {
  position: absolute;
  left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--foro-text-muted);
}

.username-field {
  padding-left: 28px;
  padding-right: 80px;
}

.username-status-badge {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--r-sm);
}

.username-status-badge.available {
  color: var(--green-success);
}

.username-status-badge.taken,
.username-status-badge.invalid {
  color: var(--red-hot);
}

.username-status-badge.checking {
  color: var(--foro-text-muted);
}

/* Photo upload */
.onboarding-photo-section,
.profile-photo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.photo-preview-wrap {
  position: relative;
  width: 120px;
  height: 120px;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--foro-border);
}

.photo-upload-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--school-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  border: 3px solid var(--foro-card);
  transition: var(--transition);
}

.photo-upload-badge:hover {
  transform: scale(1.1);
}

.photo-actions-wrap {
  display: flex;
  gap: var(--spacing-sm);
}

.btn-photo-action {
  padding: 8px 16px;
  background: var(--school-gradient);
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
}

.btn-photo-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-photo-action-outline {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
}

.btn-photo-action-outline:hover {
  background: var(--foro-bg-secondary);
}

/* Sanction Modal */
.sanction-modal-card {
  max-width: 520px;
}

.sanction-user-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--foro-bg-secondary);
  padding: var(--spacing-md);
  border-radius: var(--r-lg);
  margin-bottom: var(--spacing-md);
}

.sanction-user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--foro-border);
}

.sanction-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sanction-user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--foro-text);
}

.sanction-user-school {
  font-size: 13px;
  color: var(--foro-text-secondary);
}

.user-status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  margin-top: 4px;
}

.user-status-pill.status-activo {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
}

.sanction-options-grid {
  display: grid;
  gap: var(--spacing-sm);
}

.sanction-radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--spacing-md);
  background: var(--foro-bg-secondary);
  border: 2px solid var(--foro-border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: var(--transition);
}

.sanction-radio-card:hover {
  border-color: var(--foro-accent);
}

.sanction-radio-card input[type="radio"] {
  flex-shrink: 0;
}

.sanction-card-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sanction-type-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--foro-text);
}

.sanction-type-desc {
  font-size: 12px;
  color: var(--foro-text-secondary);
}

.modal-actions-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

.btn-confirm-danger {
  background: var(--red-hot);
  border: none;
  color: white;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: var(--transition);
}

.btn-confirm-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* ==========================================================================
   ESTADOS Y UTILIDADES
   ========================================================================== */

.empty-state-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--foro-text-muted);
  background: var(--foro-bg-secondary);
  border: 2px dashed var(--foro-border);
  border-radius: var(--r-lg);
  gap: var(--spacing-sm);
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--foro-border);
  border-top-color: var(--foro-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Visibilidad */
.forum-user-bar.is-authenticated #btn-google-login,
body.has-user #btn-google-login,
#btn-google-login[hidden],
#btn-google-login.is-hidden {
  display: none !important;
}

.forum-user-bar:not(.is-authenticated) #forum-user-profile,
body:not(.has-user) #forum-user-profile,
#forum-user-profile[hidden],
#forum-user-profile.is-hidden {
  display: none !important;
}

/* Toast Notification */
#toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--foro-card);
  border: 1px solid var(--foro-border);
  color: var(--foro-text);
  padding: 12px 24px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-xl);
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .foro-layout-container {
    grid-template-columns: 1fr;
  }

  .foro-desktop-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --foro-header-height: 60px;
    --admin-bar-height: 76px;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
  }

  /* Evitar auto-zoom molesto en iOS Safari */
  .foro-header-search-input,
  .topic-form-input,
  .topic-form-textarea,
  .topic-form-select,
  .reply-form-textarea,
  input, select, textarea {
    font-size: 16px !important;
  }

  .foro-app-header-inner {
    padding: 0 10px;
    gap: 6px;
  }

  .foro-back-link {
    padding: 6px 10px;
    font-size: 13px;
    gap: 4px;
    flex-shrink: 0;
  }

  .brand-logo {
    font-size: clamp(15px, 4.2vw, 18px);
    white-space: nowrap;
  }

  .brand-domain {
    display: inline;
  }

  .foro-tag-pill {
    padding: 1px 5px;
    font-size: 9px;
  }

  .foro-header-search-wrap {
    display: none;
  }

  /* Buscador en tira móvil limpia */
  .foro-mobile-search-strip {
    display: block;
    padding: 8px 12px;
    background: var(--foro-bg, #0e1113);
    border-bottom: 1px solid var(--foro-border);
  }

  .foro-mobile-search-strip .foro-header-search-wrap {
    display: flex;
    position: relative;
    width: 100%;
    align-items: center;
  }

  .foro-mobile-search-strip .foro-search-lens {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--foro-text-muted);
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
  }

  .foro-mobile-search-strip .foro-header-search-input {
    width: 100%;
    height: 36px;
    padding: 0 34px 0 36px;
    background: var(--foro-bg-secondary, #14171a);
    border: 1px solid var(--foro-border, #1f2328);
    border-radius: 9999px;
    color: var(--foro-text);
    font-size: 13px;
    outline: none;
    font-family: inherit;
  }

  .foro-mobile-search-strip .forum-search-clear {
    right: 8px;
  }

  .foro-header-user-actions {
    gap: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  /* En mobile, ocultar botón de crear del header (se usa el FAB flotante inferior) */
  .foro-header-user-actions .btn-reddit-header-create {
    display: none !important;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
    min-height: 32px;
    font-size: 15px;
    flex-shrink: 0;
  }

  .btn-google-login-pill {
    padding: 5px 10px;
    font-size: 12px;
    min-height: 32px;
    height: 32px;
    gap: 5px;
    border-radius: 9999px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .foro-main-layout {
    padding: 0 0 5.5rem;
  }

  .thread-card {
    padding: 12px 14px;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    margin-bottom: 8px;
  }

  .thread-author-wrap {
    gap: 8px;
  }

  .thread-author-row {
    gap: 4px 6px;
    font-size: 13px;
  }

  .thread-title {
    font-size: 16px;
    line-height: 1.35;
    margin: 6px 0 4px;
  }

  .thread-excerpt {
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 10px;
  }

  .thread-card-footer.reddit-action-bar {
    gap: 6px;
  }

  .reddit-vote-capsule {
    height: 34px;
    padding: 2px 10px;
  }

  .reddit-action-pill {
    height: 34px;
    padding: 2px 10px;
    font-size: 12.5px;
  }

  /* Modales en Mobile: Formato Bottom Sheet */
  .topic-modal-overlay,
  .auth-modal-overlay,
  .admin-modal-overlay,
  .profile-modal-overlay,
  .thread-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .topic-modal-card,
  .auth-modal-card,
  .admin-modal-card,
  .profile-modal-card,
  .thread-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 20px 20px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .thread-modal-body {
    padding: var(--spacing-md);
  }

  .thread-op-title {
    font-size: 19px;
  }

  .btn-fab-topic {
    display: inline-flex;
    bottom: 16px;
    right: 16px;
    padding: 10px 18px;
    font-size: 13.5px;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.45);
  }

  .admin-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .admin-bar-left {
    justify-content: center;
  }

  .admin-bar-actions {
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }

  .modal-actions-dual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .foro-back-link .back-text {
    display: none;
  }

  .foro-back-link {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-size: 16px;
    flex-shrink: 0;
  }

  .brand-logo {
    font-size: clamp(14px, 4vw, 17px);
  }

  .foro-tag-pill {
    font-size: 10px;
    padding: 2px 5px;
  }
}

@media (max-width: 480px) {
  .btn-google-login-pill {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .btn-google-login-pill span {
    display: none;
  }

  .btn-google-login-pill {
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 50%;
  }

  .brand-logo {
    font-size: 16px;
  }

  .user-profile-school-badge {
    display: none;
  }

  .user-profile-name {
    font-size: 12.5px;
    max-width: 70px;
  }

  .forum-user-profile {
    padding: 2px 6px 2px 2px;
    max-width: 120px;
  }

  .thread-author-avatar {
    width: 34px;
    height: 34px;
  }

  .thread-excerpt {
    -webkit-line-clamp: 2;
  }

  .forum-sort-bar-reddit {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 12px;
  }

  .feed-active-indicator {
    justify-content: space-between;
    font-size: 12px;
  }

  .profile-hero-banner {
    height: 110px;
  }

  .profile-avatar-wrap {
    width: 80px;
    height: 80px;
  }

  .profile-user-name {
    font-size: 17px;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
  }

  .profile-stat-karma,
  .profile-stat-threads,
  .profile-stat-replies {
    font-size: 18px;
  }

  .profile-form-grid-2 {
    grid-template-columns: 1fr;
  }

  .modal-actions-dual {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   AJUSTES ADICIONALES Y UTILIDADES
   ========================================================================== */

/* Ajuste dinámico para cuando hay admin bar */
body.has-admin-bar {
  padding-top: var(--admin-bar-height, 44px);
}

body.has-admin-bar .foro-app-header {
  top: var(--admin-bar-height, 44px);
}

body.has-admin-bar .foro-channels-strip-wrap {
  top: calc(var(--foro-header-height, 64px) + var(--admin-bar-height, 44px));
}

/* Scrollbars personalizados para navegadores webkit */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--foro-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--foro-border);
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--foro-accent);
}

/* Modo oscuro para scrollbars */
.dark-mode ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: var(--foro-accent);
}

/* Selección de texto */
::selection {
  background: var(--school-surface);
  color: var(--foro-text);
}

/* Focus visible para accesibilidad */
*:focus-visible {
  outline: 2px solid var(--foro-accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

/* Imágenes responsive */
img {
  max-width: 100%;
  height: auto;
}

/* Links sin estilos base */
a {
  color: inherit;
  text-decoration: none;
}

/* Botones sin estilos base */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Inputs y selects */
input,
select,
textarea {
  font-family: inherit;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Ocultar elementos de forma accesible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Estado de carga */
.is-loading {
  pointer-events: none;
  opacity: 0.6;
  cursor: wait;
}

/* Animación de pulso para elementos que cargan */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Skeleton loaders */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--foro-bg-secondary) 25%,
    var(--foro-border) 50%,
    var(--foro-bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 12px;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* Estados de error */
.error-message {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red-hot);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
}

.dark-mode .error-message {
  background: rgba(239, 68, 68, 0.15);
}

.success-message {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green-success);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
}

.dark-mode .success-message {
  background: rgba(16, 185, 129, 0.15);
}

/* Tooltips simples */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 12px;
  white-space: nowrap;
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  z-index: 1000;
}

.dark-mode [data-tooltip]:hover::after {
  background: rgba(255, 255, 255, 0.95);
  color: var(--foro-bg);
}

/* Badges y pills adicionales */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

.badge-primary {
  background: var(--school-surface);
  color: var(--foro-accent);
  border: 1px solid var(--school-border);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-hot);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Dividers */
.divider {
  height: 1px;
  background: var(--foro-border);
  margin: var(--spacing-lg) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--foro-text-muted);
  font-size: 13px;
  font-weight: 600;
  margin: var(--spacing-lg) 0;
}

.divider-text::before,
.divider-text::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--foro-border);
}
/* ==========================================================================
   RESPONSIVE BREAKPOINTS (REDDIT LAYOUT)
   ========================================================================== */

@media (max-width: 1200px) {
  .foro-layout-container {
    grid-template-columns: 220px 1fr 290px;
    gap: 16px;
  }
}

@media (max-width: 1024px) {
  .btn-toggle-nav-drawer {
    display: inline-flex !important;
  }

  .foro-layout-container {
    grid-template-columns: 1fr 290px;
    gap: 20px;
  }

  .foro-left-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--foro-bg, #0e1113);
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    border-right: 1px solid var(--foro-border);
    padding: 16px 12px 32px;
    display: block !important;
    box-shadow: none;
  }

  .foro-left-sidebar.open {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.85);
  }

  .left-sidebar-sticky {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

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

  .foro-desktop-sidebar {
    display: none;
  }

  .foro-main-layout {
    padding: 8px 0 5rem;
  }

  .thread-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 6px;
    padding: 12px 14px;
  }

  .reddit-create-post-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 8px 12px;
  }

  .reddit-create-avatar {
    width: 32px;
    height: 32px;
  }

  .reddit-create-input-trigger {
    height: 36px;
    font-size: 0.85rem;
    padding: 0 12px;
  }

  .reddit-action-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-top: 4px;
  }

  .reddit-action-bar::-webkit-scrollbar {
    display: none;
  }

  .forum-sort-bar-reddit {
    display: none !important;
  }

  /* Optimización de Vista de Debates en Mobile */
  body.thread-view-active #btn-fab-topic {
    display: none !important;
  }

  body.thread-view-active .foro-mobile-search-strip {
    display: none !important;
  }

  body.thread-view-active .foro-main-layout {
    padding-top: 2px;
  }

  .reddit-post-page-card {
    padding: 14px 12px;
    border-radius: var(--r-md);
    margin-bottom: 8px;
  }

  .reddit-title-text {
    font-size: 1.2rem;
    line-height: 1.34;
    margin-bottom: 8px;
  }

  .reddit-body-content {
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 12px;
  }

  .reddit-action-pills-bar {
    gap: 6px;
    padding-top: 4px;
  }

  .reddit-pill-btn {
    height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .reddit-comments-controls-bar {
    margin: 8px 0 6px;
    gap: 8px;
  }

  .reddit-comments-search-wrap {
    width: 100%;
    max-width: none;
    order: 2;
  }

  .reddit-sort-dropdown-wrap {
    order: 1;
  }

  .reddit-comment-block {
    padding: 4px 0;
  }

  .reddit-comment-avatar {
    width: 26px;
    height: 26px;
  }

  .reddit-comment-text {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .reddit-comment-body-wrapper {
    margin-left: 10px;
  }

  .reddit-thread-line-container {
    width: 16px;
  }

  .reddit-comment-main-col {
    padding-left: 4px;
  }

  .reddit-comment-replies {
    margin-top: 6px;
    gap: 6px;
    padding-left: 8px;
    margin-left: 2px;
  }
}

@media (max-width: 480px) {
  .sort-pills-group {
    width: 100%;
    justify-content: flex-start;
  }

  .sort-pill-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .thread-title {
    font-size: 15.5px;
  }

  .thread-excerpt {
    font-size: 13.5px;
  }
}

/* Print styles */
@media print {
  .foro-app-header,
  .foro-channels-strip-wrap,
  .btn-fab-topic,
  .foro-footer,
  .admin-top-bar,
  .theme-toggle {
    display: none !important;
  }

  body.page-foro {
    background: white;
    color: black;
  }

  .thread-card,
  .sidebar-reddit-card {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   MODO OSCURO - PREFERENCIA DEL SISTEMA
   ========================================================================== */

@media (prefers-color-scheme: dark) {
  body.page-foro:not(.light-mode) {
    --foro-bg: #0a0b0f;
    --foro-bg-secondary: #0f1117;
    --foro-card: #13151d;
    --foro-card-hover: #181b26;
    --foro-border: rgba(255, 255, 255, 0.08);
    --foro-border-light: rgba(255, 255, 255, 0.06);
    --foro-text: #f1f5f9;
    --foro-text-secondary: #cbd5e1;
    --foro-text-muted: #94a3b8;
    --foro-text-subtle: #64748b;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7);
  }
}

/* ==========================================================================
   MEJORA INTEGRAL DE INTERFAZ — FORO ESTUDIANTINA 2026
   Mobile-First Design Overhaul: Cards, Perfiles, Hilos y Comentarios
   ========================================================================== */

/* ── TARJETA FEED: Avatar + Autor ─────────────────────────────────────────── */
.thread-card-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--foro-border);
  background: var(--foro-bg-secondary);
}

.thread-channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--foro-accent);
  background: var(--school-surface);
  border: 1px solid var(--school-border);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  letter-spacing: 0.02em;
  transition: var(--transition);
}

/* ── THREAD CARD IMPROVEMENTS ─────────────────────────────────────────────── */
.thread-card {
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease !important;
}

@media (min-width: 769px) {
  .thread-card:hover {
    transform: translateY(-1px);
  }
}

/* ── AUTHOR ROLE FLAIR ────────────────────────────────────────────────────── */
.reddit-author-role-flair {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.28);
  white-space: nowrap;
}

body.light-mode .reddit-author-role-flair,
[data-theme="light"] .reddit-author-role-flair {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

/* ── COMMENT SCHOOL CHIP ──────────────────────────────────────────────────── */
.reddit-comment-school-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--foro-pill-bg);
  border: 1px solid var(--foro-border-light);
  color: var(--foro-text-muted);
  line-height: 1.4;
}

/* ── COMMENT AVATAR ───────────────────────────────────────────────────────── */
.reddit-comment-avatar {
  width: 32px !important;
  height: 32px !important;
  border: 2px solid var(--foro-border);
  box-shadow: var(--shadow-xs);
}

/* ── NESTED REPLIES ───────────────────────────────────────────────────────── */
.reddit-comment-replies {
  border-left: 2px solid var(--foro-border-strong, rgba(255,255,255,0.14)) !important;
}

body.light-mode .reddit-comment-replies,
[data-theme="light"] .reddit-comment-replies {
  border-left-color: #cbd5e1 !important;
}

/* ── THREAD PAGE CARD ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .reddit-post-page-card {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  .reddit-title-text {
    font-size: 1.18rem !important;
  }
}

/* ── PROFILE MODAL MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .profile-modal-overlay.open {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .reddit-profile-card,
  .profile-modal-card {
    border-radius: 20px 20px 0 0 !important;
    max-height: 94vh !important;
    max-height: 94dvh !important;
  }
  .reddit-hero-banner,
  .profile-hero-banner {
    height: 100px !important;
  }
  .reddit-avatar-wrapper {
    bottom: -36px !important;
    left: 16px !important;
  }
  .reddit-avatar-ring {
    width: 72px !important;
    height: 72px !important;
  }
  .reddit-profile-body,
  .profile-body {
    padding: 46px 16px 24px 16px !important;
  }
  .reddit-display-name,
  .profile-user-name {
    font-size: 1.3rem !important;
  }
  .reddit-trophy-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
}

/* ── SIDEBAR LEFT ACTIVE STATE ────────────────────────────────────────────── */
.left-nav-item.active {
  background: var(--school-surface, rgba(37, 99, 235, 0.1)) !important;
  border-color: var(--school-border, rgba(37, 99, 235, 0.25)) !important;
  color: var(--school-primary, var(--foro-accent)) !important;
}

.left-nav-item .nav-icon svg {
  transition: color 0.15s;
}

.left-nav-item.active .nav-icon svg,
.left-nav-item:hover .nav-icon svg {
  color: var(--school-primary, var(--foro-accent));
}

/* ── VOTE CAPSULE ─────────────────────────────────────────────────────────── */
.reddit-vote-capsule.voted-up {
  background: rgba(255, 69, 0, 0.12) !important;
  border-color: rgba(255, 69, 0, 0.28) !important;
}
.reddit-vote-capsule.voted-down {
  background: rgba(113, 147, 255, 0.12) !important;
  border-color: rgba(113, 147, 255, 0.28) !important;
}

/* ── FAB BUTTON MOBILE ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .btn-fab-topic {
    display: inline-flex !important;
    bottom: 20px;
    right: 16px;
    padding: 12px 20px;
    font-size: 14px;
  }
  body.thread-view-active .btn-fab-topic {
    display: none !important;
  }
}

/* ── TOAST IMPROVEMENTS ───────────────────────────────────────────────────── */
#toast-notification {
  max-width: calc(100vw - 32px);
  text-align: center;
}

@media (max-width: 768px) {
  #toast-notification {
    bottom: calc(5rem + 12px);
    font-size: 13px;
    padding: 10px 18px;
  }
}

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  gap: 12px;
  color: var(--foro-text-muted);
  background: var(--foro-card);
  border: 1px dashed var(--foro-border);
  border-radius: var(--r-xl);
  min-height: 180px;
  animation: fadeIn 0.3s ease;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foro-text);
  margin: 0;
}

.empty-state p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--foro-text-secondary);
  margin: 0;
  max-width: 300px;
}

.empty-state-icon {
  opacity: 0.5;
}

/* ── LOADING STATE ────────────────────────────────────────────────────────── */
.forum-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 3rem 1rem;
  color: var(--foro-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ── PINNED THREAD HIGHLIGHT ──────────────────────────────────────────────── */
.thread-card.is-pinned {
  background: linear-gradient(
    90deg,
    rgba(217, 119, 6, 0.04) 0%,
    var(--foro-card) 50%
  ) !important;
}

@media (max-width: 768px) {
  .thread-card.is-pinned {
    border-left: 3px solid var(--gold-primary) !important;
    border-right: none !important;
  }
}

/* ── MOD ACTION BUTTONS ───────────────────────────────────────────────────── */
.thread-admin-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-mod-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: 1px solid var(--foro-border);
  background: var(--foro-card);
  color: var(--foro-text-muted);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.btn-mod-action:hover {
  background: var(--foro-pill-hover);
  color: var(--foro-text);
}

.btn-mod-pin.pinned-active {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  background: rgba(217, 119, 6, 0.1);
}

.btn-mod-del:hover {
  color: var(--red-hot) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}

.btn-mod-sanction:hover {
  color: var(--reddit-orange) !important;
  border-color: rgba(255, 69, 0, 0.35) !important;
  background: rgba(255, 69, 0, 0.08) !important;
}

/* ── REPORT BUTTON ────────────────────────────────────────────────────────── */
.reddit-more-dots-btn {
  font-size: 14px;
  color: var(--foro-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-md);
  transition: var(--transition);
  line-height: 1;
  background: transparent;
  border: none;
}

.reddit-more-dots-btn:hover {
  background: var(--foro-pill-hover);
  color: var(--foro-text);
}

/* ── SCHOOL DOT SIZE FIX ──────────────────────────────────────────────────── */
.school-dot {
  width: 10px !important;
  height: 10px !important;
}

/* ── COMMENTS CONTROLS ────────────────────────────────────────────────────── */
.reddit-comments-controls-bar {
  background: var(--foro-card);
  border: 1px solid var(--foro-border-light);
  border-radius: var(--r-lg);
  padding: 8px 14px;
}

/* ── ACTION PILLS BAR TOP BORDER ─────────────────────────────────────────── */
.reddit-action-pills-bar {
  border-top: 1px solid var(--foro-border-light);
  padding-top: 12px !important;
}

/* ── THREAD PAGE NAV SPACING ─────────────────────────────────────────────── */
.thread-page-nav-bar {
  padding: 6px 0 10px;
}

/* ── MICRO ANIMATIONS ─────────────────────────────────────────────────────── */
.forum-thread-view {
  animation: threadSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes threadSlideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── LIGHT MODE: THREAD CARDS ─────────────────────────────────────────────── */
body.light-mode .thread-card,
[data-theme="light"] .thread-card {
  background: #ffffff;
  border-color: #e8edf2;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

body.light-mode .thread-card:hover,
[data-theme="light"] .thread-card:hover {
  background: #f9fafc;
  border-color: #c9d4e0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

body.light-mode .thread-title,
[data-theme="light"] .thread-title {
  color: #0f172a;
}

body.light-mode .thread-excerpt,
[data-theme="light"] .thread-excerpt {
  color: #334155;
}

body.light-mode .reddit-vote-capsule,
[data-theme="light"] .reddit-vote-capsule {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

body.light-mode .reddit-action-pill,
[data-theme="light"] .reddit-action-pill {
  background: #f1f5f9;
  color: #475569;
}

body.light-mode .reddit-action-pill:hover,
[data-theme="light"] .reddit-action-pill:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ── LIGHT MODE: THREAD VIEW ──────────────────────────────────────────────── */
body.light-mode .reddit-post-page-card,
[data-theme="light"] .reddit-post-page-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

body.light-mode .reddit-title-text,
[data-theme="light"] .reddit-title-text {
  color: #0f172a;
}

body.light-mode .reddit-body-content,
[data-theme="light"] .reddit-body-content {
  color: #1e293b;
}

body.light-mode .reddit-pill-btn,
[data-theme="light"] .reddit-pill-btn {
  background: #f1f5f9;
  color: #334155;
}

body.light-mode .reddit-pill-btn:hover,
[data-theme="light"] .reddit-pill-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ── LIGHT MODE: COMMENTS ─────────────────────────────────────────────────── */
body.light-mode .reddit-comment-text,
[data-theme="light"] .reddit-comment-text {
  color: #1e293b;
}

body.light-mode .reddit-comment-author,
[data-theme="light"] .reddit-comment-author {
  color: #0f172a;
}

body.light-mode .reddit-comment-school-chip,
[data-theme="light"] .reddit-comment-school-chip {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

body.light-mode .reddit-join-bar,
[data-theme="light"] .reddit-join-bar {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-mode .reddit-composer-box,
[data-theme="light"] .reddit-composer-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.light-mode .reddit-composer-textarea,
[data-theme="light"] .reddit-composer-textarea {
  color: #0f172a;
}

body.light-mode .reply-format-toolbar,
[data-theme="light"] .reply-format-toolbar {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

body.light-mode .reddit-comments-controls-bar,
[data-theme="light"] .reddit-comments-controls-bar {
  background: #ffffff;
  border-color: #e8edf2;
}

/* ── LIGHT MODE: SIDEBAR LEFT ─────────────────────────────────────────────── */
body.light-mode .left-nav-item,
[data-theme="light"] .left-nav-item {
  color: #475569;
}

body.light-mode .left-nav-item:hover,
[data-theme="light"] .left-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.light-mode .left-nav-heading,
[data-theme="light"] .left-nav-heading {
  color: #94a3b8;
}

body.light-mode .left-nav-section,
[data-theme="light"] .left-nav-section {
  border-bottom-color: #e2e8f0;
}

body.light-mode .sidebar-school-chip,
[data-theme="light"] .sidebar-school-chip {
  color: #475569;
}

body.light-mode .sidebar-school-chip:hover,
[data-theme="light"] .sidebar-school-chip:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* ── LIGHT MODE: HEADER ───────────────────────────────────────────────────── */
body.light-mode .foro-app-header,
[data-theme="light"] .foro-app-header {
  background: #ffffff;
  border-bottom-color: #e8edf2;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

body.light-mode .foro-header-search-input,
[data-theme="light"] .foro-header-search-input {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.light-mode .btn-reddit-header-create,
[data-theme="light"] .btn-reddit-header-create {
  border-color: #cbd5e1;
  color: #334155;
}

body.light-mode .forum-user-profile,
[data-theme="light"] .forum-user-profile {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* ── LIGHT MODE: MOBILE SEARCH ────────────────────────────────────────────── */
body.light-mode .foro-mobile-search-strip,
[data-theme="light"] .foro-mobile-search-strip {
  background: #ffffff;
  border-bottom-color: #e8edf2;
}

/* ── LIGHT MODE: RIGHT SIDEBAR WIDGETS ────────────────────────────────────── */
body.light-mode .sidebar-reddit-card,
[data-theme="light"] .sidebar-reddit-card {
  background: #ffffff;
  border-color: #e8edf2;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

body.light-mode .countdown-box,
[data-theme="light"] .countdown-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

body.light-mode .empty-state,
[data-theme="light"] .empty-state {
  background: #ffffff;
  border-color: #e2e8f0;
}

/* ── LIGHT MODE: THREAD PAGE NAV ──────────────────────────────────────────── */
body.light-mode .reddit-action-pills-bar,
[data-theme="light"] .reddit-action-pills-bar {
  border-top-color: #e8edf2;
}

/* ── LIGHT MODE: PINNED THREAD ────────────────────────────────────────────── */
body.light-mode .thread-card.is-pinned,
[data-theme="light"] .thread-card.is-pinned {
  background: linear-gradient(
    90deg,
    rgba(217, 119, 6, 0.06) 0%,
    #ffffff 50%
  ) !important;
}

/* ── BACK TO FEED BUTTON: HIDE ON MOBILE ──────────────────────────────────── */
/* El botón "Volver a debates" no es necesario en mobile,
   el usuario usa los botones del sistema operativo */
@media (max-width: 768px) {
  #btn-back-to-feed,
  .btn-thread-nav-back {
    display: none !important;
  }

  /* Hide the entire nav bar on mobile since it only has the back button */
  .thread-page-nav-bar:has(#btn-back-to-feed:only-child) {
    display: none !important;
  }
}

/* ── REPOST BUTTON: GLOBALLY REMOVED ─────────────────────────────────────── */
/* El botón de repost fue eliminado por pedido del usuario */
.btn-repost-thread,
.btn-repost,
[id*="btn-repost"],
[class*="btn-repost"] {
  display: none !important;
}

/* ── MOBILE: THREAD VIEW TOP PADDING FIX ──────────────────────────────────── */
@media (max-width: 768px) {
  /* When there's no back button, remove the nav bar gap */
  .forum-thread-view .thread-page-nav-bar {
    padding: 0;
    min-height: 0;
  }

  /* Better spacing for the post card on mobile */
  .reddit-post-page-card {
    margin-top: 0 !important;
  }
}

/* ── THREAD NAV BAR DESKTOP STYLE ─────────────────────────────────────────── */
.btn-thread-nav-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--foro-border);
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--foro-text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.btn-thread-nav-back:hover {
  background: var(--foro-pill-hover);
  color: var(--foro-text);
  border-color: var(--foro-border-strong);
}

.nav-back-arrow {
  font-size: 1rem;
}

.kbd-back-key {
  font-size: 0.72rem;
  background: var(--foro-bg-secondary);
  border: 1px solid var(--foro-border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 2px;
  color: var(--foro-text-muted);
  font-family: monospace;
}

body.light-mode .btn-thread-nav-back,
[data-theme="light"] .btn-thread-nav-back {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}

body.light-mode .btn-thread-nav-back:hover,
[data-theme="light"] .btn-thread-nav-back:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.light-mode .kbd-back-key,
[data-theme="light"] .kbd-back-key {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}
