@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Syne:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0a0c;
    --sidebar-bg: rgba(18, 18, 23, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --accent: #7c4dff;
    --accent-glow: rgba(124, 77, 255, 0.3);
    --accent-soft: rgba(124, 77, 255, 0.12);
    --text-main: #e8e8f0;
    --text-dim: #b8b8cc;
    --text-muted: #9898b4;
    --text-faint: #8080a0;
    --success: #00e676;
    --error: #ff5252;
    --warning: #ffd740;
    --info: #40c4ff;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* ── Sidebar rediseño Opción A ── */
    --sbr-bg:            #0f0f15;
    --sbr-canvas-bg:     #0a0a0e;
    --sbr-hover:         #16161f;
    --sbr-border:        rgba(255,255,255,0.06);
    --sbr-border-strong: rgba(255,255,255,0.10);
    --sbr-text:          #e8e8ef;
    --sbr-text-dim:      #8a8a99;
    --sbr-text-faint:    #5a5a6a;
    --sbr-violet:        #8b5cf6;
    --sbr-violet-soft:   rgba(139,92,246,0.12);
    --sbr-violet-border: rgba(139,92,246,0.35);
    --sbr-credits-warn:  #fbbf24;
    --sbr-credits-crit:  #f87171;
}

:root {
  --espacios-bg-base: #0c0c18;
  --espacios-orb-violet: rgba(139, 92, 246, 0.28);
  --espacios-orb-pink: rgba(236, 72, 153, 0.16);
}

:root {
  --cv-bg:              #0a0712;
  --cv-panel:           #130d22;
  --cv-panel-hover:     #1c1530;
  --cv-panel-raised:    #1f1836;
  --cv-border:          rgba(255,255,255,0.07);
  --cv-border-strong:   rgba(255,255,255,0.11);
  --cv-violet-bright:   #a78bfa;
  --cv-violet-deep:     #7c3aed;
  --cv-violet-glow:     rgba(139,92,246,0.35);
  --cv-text:            #ebe7f4;
  --cv-text-dim:        #8a84a0;
  --cv-text-faint:      #5a526b;
  --cv-red:        #f87171;
  --cv-red-soft:   rgba(248,113,113,0.12);
  --cv-red-border: rgba(248,113,113,0.30);
}

:root {
  --sticky-yellow: #fde68a;
  --sticky-orange: #fed7aa;
  --sticky-pink:   #fbcfe8;
  --sticky-rose:   #fecdd3;
  --sticky-violet: #ddd6fe;
  --sticky-blue:   #bae6fd;
  --sticky-cyan:   #a5f3fc;
  --sticky-green:  #bbf7d0;
  --sticky-gray:   #e5e7eb;
  --sticky-text:   #3a2a10;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

/* ── Scrollbar global — tema oscuro con accent ── */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(124, 77, 255, 0.25);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(124, 77, 255, 0.45); border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(124, 77, 255, 0.25) transparent; }

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.app-container { display: flex; height: 100vh; }

/* ── Sidebar (collapsible: 48px → 240px on hover) ── */
.sidebar {
    width: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    z-index: 100;
    transition: width 0.3s ease, padding 0.3s ease;
    overflow: visible;
}
.sidebar.expanded {
    width: 260px;
    overflow: hidden;
    padding: 10px 20px;
}

.logo { display: flex; align-items: center; gap: 0; margin-bottom: 32px; white-space: nowrap; width: 100%; justify-content: center; height: 28px; }
.sidebar.expanded .logo { justify-content: flex-start; gap: 10px; }
.logo-icon { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent-glow)); flex-shrink: 0; width: 24px; height: 24px; }
.logo-text {
    font-size: 1.2rem; font-weight: 800; letter-spacing: -0.5px;
    opacity: 0; transition: opacity 0.15s ease;
    overflow: hidden; width: 0;
}
.sidebar.expanded .logo-text { opacity: 1; width: auto; }
.accent { color: var(--accent); }

.nav-menu { flex: 1; display: flex; flex-direction: column; gap: 4px; width: 100%; }

.nav-item {
    display: flex; align-items: center; gap: 0;
    padding: 10px 0; border-radius: 10px;
    text-decoration: none; color: var(--text-dim);
    transition: all 0.2s ease;
    white-space: nowrap;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    width: 100%;
}
.sidebar.expanded .nav-item { padding: 10px 16px; justify-content: flex-start; gap: 12px; }
.nav-item:hover { color: var(--text-main); }
.sidebar.expanded .nav-item:hover { background: var(--glass-bg); }
.nav-item.active { color: var(--accent); }
/* DEPRECATED — reemplazado por bloque sidebar rediseño Opción A (ver final del archivo) */
/* .sidebar.expanded .nav-item.active { background: var(--accent-glow); color: var(--text-main); box-shadow: inset 0 0 0 1px var(--accent); } */
.nav-item i { width: 20px; height: 20px; flex-shrink: 0; }
.nav-label {
    opacity: 0; transition: opacity 0.15s ease;
    overflow: hidden; width: 0;
}
.sidebar.expanded .nav-label { opacity: 1; width: auto; }

/* ── Sidebar tooltips (collapsed only) ── */
.sidebar [data-tooltip] { position: relative; }
.sidebar [data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) scale(0.96);
    background: linear-gradient(145deg, rgba(8, 6, 18, 0.92) 0%, rgba(16, 10, 32, 0.92) 100%);
    color: #ede8f5;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(140, 100, 255, 0.5);
    box-shadow: 0 0 15px rgba(124, 77, 255, 0.3), 0 8px 24px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    z-index: 200;
}
.sidebar [data-tooltip]:hover::after { opacity: 1; transform: translateY(-50%) scale(1); }
.sidebar.expanded [data-tooltip]::after { display: none; }

.sidebar-footer { padding-top: 16px; border-top: 1px solid var(--glass-border); }
/* [v5.7.27.103] La fila social ahora es un contenedor de nav-items reales
   (Comunidad Reddit, futuro Twitter, etc). Stack vertical idéntico a la
   columna de items, sin padding extra. La armonía visual la aporta cada
   `.nav-item--social` al heredar las reglas globales de `.nav-item`. */
.sidebar-social {
    display: flex;
    flex-direction: column;
}
/* Hover de marca: brand color al pasar el cursor — Reddit naranja, etc.
   Se mantiene en collapsed (icono solo) y en expanded (icono + label). */
.sidebar .nav-item--reddit:hover { color: #ff4500; }
.sidebar .nav-item--reddit:hover svg { color: #ff4500; }
.sidebar .nav-item--social svg {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.status-indicator { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--text-dim); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.online { background: var(--success); box-shadow: 0 0 8px rgba(0, 230, 118, 0.5); }

/* ── Main Content ── */
.content-area {
    flex: 1; padding: 32px; padding-bottom: 48px; overflow-y: auto;
    transition: padding 0.2s;
    background: radial-gradient(circle at top right, rgba(124, 77, 255, 0.05), transparent 40%);
    transition: margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
body.chat-open .content-area { margin-right: 31.5vw; }
/* Deep-link landings (/invite/:token + /ws-join/:id) nunca tienen chat activo.
   Si body.chat-open persiste por bfcache o por orden de carga de scripts,
   `invite-view` anula la reserva de espacio del chat para que el card quede
   centrada en todo el viewport. */
body.invite-view.chat-open .content-area,
body.invite-view .content-area { margin-right: 0 !important; }
.content-area.feed-active { padding-top: 0; }
.content-area.hub-active { padding: 0 !important; overflow: hidden !important; }
.content-area.hub-active #dynamic-content { height: 100%; }
#dynamic-content {
    display: flex; flex-direction: column;
    min-height: 100%;
}

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }

.search-box {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; border-radius: 30px; width: 400px;
}
.search-box input { background: transparent; border: none; outline: none; color: white; width: 100%; font-family: var(--font-main); }

.api-status {
    background: var(--glass-bg); padding: 8px 16px; border-radius: 10px;
    border: 1px solid var(--glass-border); font-family: var(--font-mono); font-size: 0.85rem;
}
.label { color: var(--text-dim); margin-right: 8px; }

.view-header { margin-bottom: 32px; }
.view-header h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.subtitle { color: var(--text-dim); margin-top: 4px; }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 40px; }
.stat-card { padding: 24px; border-radius: 20px; display: flex; align-items: center; gap: 20px; }

/* ── Tabs Navigation ── */
.tabs-nav {
    display: flex;
    gap: 8px;
    padding: 6px;
    margin-bottom: 24px;
    border-radius: 14px;
    max-width: fit-content;
}

.tab-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-item:hover {
    background: var(--glass-hover);
    color: var(--text-main);
}

.tab-item.active {
    background: var(--accent-glow);
    color: white;
    box-shadow: inset 0 0 0 1px var(--accent);
}

.tab-item i {
    width: 18px;
    height: 18px;
}
.tab-count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: rgba(124,77,255,0.25); border: 1px solid rgba(124,77,255,0.4);
    color: #d8b4fe; font-size: 11px; font-weight: 700;
    border-radius: 20px; margin-left: 4px;
}
.tab-item.active .tab-count-badge {
    background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.3); color: white;
}
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.stat-icon.purple { background: rgba(124, 77, 255, 0.15); color: #7c4dff; }
.stat-icon.blue { background: rgba(64, 196, 255, 0.15); color: #40c4ff; }
.stat-icon.green { background: rgba(0, 230, 118, 0.15); color: #00e676; }
.stat-label { color: var(--text-dim); font-size: 0.9rem; display: block; }
.stat-value { font-size: 1.5rem; font-weight: 600; }

