:root {
    /* Color Palette - Premium Dark Mode */
    --color-bg: #030712;
    --color-surface: #111827;
    --color-surface-soft: #1f2937;
    --color-primary: #3b82f6; /* Twitter Blue */
    --color-primary-glow: rgba(59, 130, 246, 0.5);
    --color-secondary: #ff4500; /* Reddit Orange */
    --color-accent: #f48024; /* StackOverflow Orange */
    --color-text-main: #f9fafb;
    --color-text-dim: #9ca3af;
    --color-glass: rgba(255, 255, 255, 0.03);
    --color-border: rgba(255, 255, 255, 0.1);
    
    /* Typography */
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout Grid */
.contenedor-app {
    display: grid;
    grid-template-columns: 280px 1fr 350px;
    height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
}

/* Glassmorphism Components */
.panel-cristal {
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem;
}

.barra-lateral {
    height: 100vh;
    position: sticky;
    top: 0;
}

.feed-principal {
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 0;
}

.panel-widgets {
    height: 100vh;
    position: sticky;
    top: 0;
    border-right: none;
}

/* Header & Typography */
h1 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
}

.titulo-seccion {
    color: var(--color-text-dim);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Post Styling - Feed */
.publicacion {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
    cursor: pointer;
}

.publicacion:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cabecera-publicacion {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-soft);
}

.autor-publicacion {
    font-weight: 700;
}

.arroba-publicacion {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

.contenido-publicacion {
    font-size: 1rem;
}

.acciones-publicacion {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    color: var(--color-text-dim);
    max-width: 300px;
}

/* Community Tags */
.item-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--color-text-main);
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.item-nav:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
}

.item-nav.activo {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

/* Utils/Widgets */
.tarjeta {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.insignia-resuelto {
    color: var(--color-accent);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

html {
    scroll-behavior: smooth;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.publicacion {
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.2);
}
/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS (paleta del primer CSS) ────────────────────── */
:root {
  /* Colores */
  --bg:           #030712;
  --surface:      #111827;
  --surface-2:    #1f2937;
  --border:       rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --text:         #f9fafb;
  --text-muted:   #9ca3af;
  --accent:       #3b82f6;          /* Azul primario */
  --accent-dim:   rgba(59,130,246,0.35);
  --accent-glow:  rgba(59,130,246,0.5);
  --danger:       #ef4444;
  --like-active:  #f43f5e;
  --glass:        rgba(255, 255, 255, 0.03);

  /* Tipografía – sistema nativo del primer CSS */
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
               'Helvetica Neue', sans-serif;

  --radius:    0.75rem;
  --radius-sm: 0.5rem;
  --shadow:    0 4px 32px rgba(0, 0, 0, 0.6);
}

/* ── BASE ───────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── HEADER – glassmorphism del primer CSS ──────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo con degradado del primer CSS */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-symbol { font-size: 20px; color: var(--accent); line-height: 1; }
.logo-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-meta {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── LAYOUT ─────────────────────────────────────────────── */
.main-layout {
  max-width: 700px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── COMPOSER ───────────────────────────────────────────── */
.composer-section { width: 100%; }

.composer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.composer-card:focus-within {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow);
}

.composer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.composer-prompt {
  font-style: italic;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.composer-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.65;
  resize: vertical;
  min-height: 72px;
}
.composer-textarea::placeholder { color: var(--text-muted); }

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

.char-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.char-counter.warning { color: var(--accent); }
.char-counter.danger  { color: var(--danger); }

/* ── LANGUAGE SELECT ────────────────────────────────────── */
.language-select {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-main);
  font-size: 12px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.language-select:focus,
.language-select:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}

/* ── BOTONES ────────────────────────────────────────────── */
.btn-publish {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 22px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
}
.btn-publish:hover {
  background: #60a5fa;
  box-shadow: 0 0 14px var(--accent-glow);
}
.btn-publish:active { transform: scale(0.97); }
.btn-publish:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* ── FEED HEADER ────────────────────────────────────────── */
.feed-section { width: 100%; }

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* Título de sección – estilo del primer CSS */
.feed-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ── SORT CONTROLS ──────────────────────────────────────── */
.sort-controls { display: flex; gap: 4px; }
.sort-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-family: var(--font-main);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s;
}
.sort-btn:hover { border-color: var(--border-light); color: var(--text); }
.sort-btn.active {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

/* ── COMMENTS FEED ──────────────────────────────────────── */
.comments-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── COMMENT CARD – glassmorphism suave del primer CSS ───── */
.comment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.comment-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-light);
}

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

/* ── META ROW ───────────────────────────────────────────── */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Avatar – estilo del primer CSS */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent);
  font-weight: 700;
}
.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.meta-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.meta-author {
  font-size: 13px;
  font-weight: 700;          /* autor-publicacion del primer CSS */
  color: var(--text);
  letter-spacing: 0.01em;
}
.meta-time {
  font-size: 11px;
  color: var(--text-muted);  /* arroba-publicacion del primer CSS */
}

.btn-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}
.comment-card:hover .btn-delete,
.reply-card:hover .btn-delete { opacity: 1; }
.btn-delete:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ── COMMENT BODY ───────────────────────────────────────── */
.comment-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 12px;
}

/* ── ACCIONES ───────────────────────────────────────────── */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  /* Igual que acciones-publicacion del primer CSS */
}

.btn-like,
.btn-reply {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.btn-like svg, .btn-reply svg { width: 14px; height: 14px; }
.btn-like:hover  { color: var(--like-active); background: rgba(244, 63, 94, 0.08); }
.btn-reply:hover { color: var(--accent); background: rgba(59, 130, 246, 0.08); }

.btn-like.liked { color: var(--like-active); }
.btn-like.liked svg { fill: var(--like-active); stroke: var(--like-active); }

.reply-count { font-size: 11px; color: var(--text-muted); margin-left: 2px; }

/* ── REPLY COMPOSER ─────────────────────────────────────── */
.reply-composer {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  animation: fadeIn 0.2s ease both;
}
.reply-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  min-height: 56px;
}
.reply-textarea::placeholder { color: var(--text-muted); }
.reply-composer-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn-cancel-reply {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: var(--font-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel-reply:hover { border-color: var(--border-light); color: var(--text); }

.btn-submit-reply {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  font-family: var(--font-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-submit-reply:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── REPLIES ────────────────────────────────────────────── */
.replies-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reply-card {
  display: flex;
  gap: 0;
  padding: 10px 0;
  position: relative;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reply-thread-line {
  width: 2px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
  margin: 4px 14px 4px 8px;
  transition: background 0.15s;
}
.reply-card:hover .reply-thread-line { background: var(--accent-dim); }

.reply-content { flex: 1; }
.reply-content .comment-meta  { margin-bottom: 6px; }
.reply-content .comment-body  { font-size: 14px; margin-bottom: 8px; }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 16px; opacity: 0.4; }
.empty-state p { font-size: 14px; line-height: 1.8; }

/* ── CODE PREVIEW ───────────────────────────────────────── */
.preview-wrapper {
  margin-top: 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #0d1117;
  overflow: hidden;
}
.preview-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.code-preview {
  margin: 0 !important;
  padding: 14px 16px !important;
  max-height: 250px;
  overflow-y: auto;
  font-size: 13px;
  background: transparent !important;
}
#preview code:empty::before {
  content: "El código resaltado aparecerá aquí...";
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.5;
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--accent-dim); color: var(--accent); }
.toast.error   { border-color: rgba(239, 68, 68, 0.4); color: var(--danger); }

/* ── UTILITY ────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .main-layout  { padding: 20px 14px 60px; gap: 24px; }
  .header-inner { padding: 14px 16px; }
  .feed-header  { flex-direction: column; align-items: flex-start; }
  .sort-controls { width: 100%; }
  .sort-btn     { flex: 1; text-align: center; }
}