/* ═══════════════════════════════════════════
   DASHBOARD STYLES — dashboard.css
═══════════════════════════════════════════ */

#dashboard { flex-direction: row; }

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh; flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.sb-header { padding: 22px 18px; border-bottom: 1px solid var(--border); }
.sb-logo { display:flex; align-items:center; gap:10px; }
.sb-logo svg { width:34px; height:34px; }
.sb-logo-img { width:34px; height:34px; border-radius:8px; object-fit:cover; box-shadow:0 0 12px rgba(0,229,255,0.25); }
.sb-logo-text {
  font-family:'Outfit',sans-serif; font-weight:700; font-size:18px;
  background:linear-gradient(135deg,var(--purple),var(--pink));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.sb-live {
  display:flex; align-items:center; gap:8px;
  padding:10px 14px; margin:12px;
  background:var(--p-green); border-radius:12px;
  font-size:13px; font-weight:600; color:var(--text2);
}
[data-theme="dark"] .sb-live { background: rgba(52,211,153,0.12); }
.sb-live-num { font-weight:800; color:var(--green); }

.sb-nav { flex:1; padding:16px 12px; display:flex; flex-direction:column; gap:3px; overflow-y:auto; }
.sb-item {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; border-radius:12px;
  color:var(--text2); text-decoration:none; font-weight:600; font-size:14px;
  cursor:pointer; border:none; background:none; width:100%;
  transition:all 0.2s; font-family:'DM Sans',sans-serif;
}
.sb-item:hover { background:var(--surface2); color:var(--text); }
.sb-item.active {
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink));
  color:var(--purple);
}
[data-theme="dark"] .sb-item.active { background:rgba(167,139,250,0.15); }
.sb-badge {
  margin-left:auto; background:var(--pink); color:white;
  font-size:11px; font-weight:700; border-radius:20px;
  padding:2px 8px; min-width:22px; text-align:center;
}
.sb-footer { padding:16px; border-top:1px solid var(--border); }
.btn-logout {
  width:100%; display:flex; align-items:center; gap:8px;
  padding:12px 14px; background:none; border:1px solid var(--border);
  border-radius:12px; color:var(--text2); font-weight:600; font-size:14px;
  cursor:pointer; transition:all 0.2s; font-family:'DM Sans',sans-serif;
}
.btn-logout:hover { background:var(--surface2); }

/* ── SIDEBAR COLLAPSED STATE ── */
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .sb-logo-text { display: none; }
.sidebar.collapsed .sb-logo-img { display: none; }
.sidebar.collapsed .sb-live span { display: none; }
.sidebar.collapsed .sb-live { justify-content: center; padding: 10px; border-radius: 50%; width: 40px; height: 40px; margin: 12px auto; }
.sidebar.collapsed .sb-item { font-size: 0; justify-content: center; padding: 12px 0; }
.sidebar.collapsed .sb-badge { display: none; }
.sidebar.collapsed .btn-logout { font-size: 0; justify-content: center; padding: 12px 0; }
.sidebar.collapsed .btn-logout svg { margin: 0; }

/* ─────────────────────────────────────────
   MAIN AREA
───────────────────────────────────────── */
.main { flex:1; display:flex; flex-direction:column; height:100vh; overflow:hidden; }

.dash-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:20px 28px; border-bottom:1px solid var(--border);
  background:var(--surface); flex-shrink:0;
}
.dash-header-left h1 { font-family:'Outfit',sans-serif; font-size:26px; font-weight:800; color:var(--text); }
.dash-header-left p  { font-size:13px; color:var(--text3); margin-top:2px; }
.dash-header-right   { display:flex; align-items:center; gap:12px; }

.user-chip {
  display:flex; align-items:center; gap:10px;
  padding:8px 14px 8px 8px;
  background:var(--surface2); border:1px solid var(--border); border-radius:14px;
}
.user-chip-av {
  width:40px; height:40px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Outfit',sans-serif; font-weight:700; font-size:16px; color:white;
  overflow:hidden; /* Para que las imágenes no se desborden */
}
.user-chip-av img {
  width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block;
}
.user-chip-name { font-weight:700; font-size:14px; color:var(--text); }
.user-chip-code { font-size:12px; color:var(--text3); }

.content { flex:1; overflow-y:auto; padding:28px; }
.section { display:none; }
.section.active { display:block; animation:fade-up 0.35s ease; }

/* ─────────────────────────────────────────
   HOME SECTION
───────────────────────────────────────── */
.welcome-banner {
  background:linear-gradient(135deg,var(--purple),var(--pink));
  border-radius:var(--radius); padding:28px 32px;
  margin-bottom:24px; position:relative; overflow:hidden;
  display:flex; align-items:center; justify-content:space-between;
}
.wb-animation-path {
  position: absolute; right: 180px; top: 50%; transform: translateY(-50%);
  width: 200px; height: 32px; display: flex; align-items: center;
}
.wb-dots {
  flex: 1; height: 4px; background: radial-gradient(circle, rgba(255,255,255,0.4) 20%, transparent 20%);
  background-size: 16px 16px; background-position: center; margin-left: -16px;
}
.wb-snail {
  position: absolute; left: 0; animation: snail-walk 10s linear infinite;
  filter: drop-shadow(0 0 6px rgba(0,229,255,0.6)); z-index: 2;
}

@keyframes snail-walk {
  0% { left: 0; }
  90% { left: 100%; opacity: 1; }
  95% { left: 100%; opacity: 0; }
  100% { left: 0; opacity: 0; }
}
.wb-title { font-family:'Outfit',sans-serif; font-size:26px; font-weight:800; color:white; margin-bottom:6px; }
.wb-sub   { font-size:15px; color:rgba(255,255,255,0.75); }
.wb-credits {
  background:rgba(255,255,255,0.2); border-radius:12px; padding:14px 22px;
  text-align:center; backdrop-filter:blur(10px);
}
.wb-credits-num   { font-family:'Outfit',sans-serif; font-size:36px; font-weight:800; color:white; }
.wb-credits-label { font-size:12px; color:rgba(255,255,255,0.75); font-weight:600; }

.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; margin-bottom:24px; }
.s-card {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px;
  display:flex; gap:14px; align-items:center;
  transition:transform 0.25s, box-shadow 0.25s;
}
.s-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.s-icon  { width:52px; height:52px; border-radius:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:22px; }
.s-val   { font-family:'Outfit',sans-serif; font-size:28px; font-weight:800; color:var(--text); }
.s-label { font-size:13px; color:var(--text3); font-weight:500; }

.chart-row   { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:24px; }
.chart-card  { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; display:flex; flex-direction:column; }

/* EL FIX: el wrapper tiene altura fija, el canvas llena ese espacio */
.chart-wrap {
  position: relative;
  height: 180px;      /* altura fija — Chart.js respeta esto */
  width: 100%;
  flex-shrink: 0;
}
.chart-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.card        { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
.card-title  { font-family:'Outfit',sans-serif; font-size:18px; font-weight:700; color:var(--text); margin-bottom:16px; }
.two-col     { display:grid; grid-template-columns:1.4fr 1fr; gap:20px; margin-bottom:24px; }

.skills-wrap { display:flex; flex-wrap:wrap; gap:10px; }
.s-tag {
  padding:8px 16px; border-radius:20px; font-size:13px; font-weight:700;
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink)); color:var(--purple);
}
.activity-list { display:flex; flex-direction:column; gap:12px; }
.act-item { display:flex; align-items:center; gap:12px; padding:12px; background:var(--surface2); border-radius:12px; }
.act-icon  { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }

/* ── PHOSPHOR NEON EFFECT ── */
.ph { transition: filter 0.3s ease, text-shadow 0.3s ease; }
.ph:hover, .feat-icon:hover .ph, .s-icon:hover .ph, .btn:hover .ph {
  filter: drop-shadow(0 0 6px rgba(0,229,255,0.6));
  text-shadow: 0 0 8px rgba(0,229,255,0.5);
}
.act-title { font-weight:600; font-size:14px; color:var(--text); }
.act-time  { font-size:12px; color:var(--text3); margin-top:2px; }

/* ─────────────────────────────────────────
   MARKETPLACE
───────────────────────────────────────── */
.mkt-header { display:flex; align-items:center; gap:14px; margin-bottom:22px; }
.search-bar {
  flex:1; display:flex; align-items:center; gap:10px;
  background:var(--card); border:1px solid var(--border);
  border-radius:12px; padding:12px 16px;
}
.search-bar input {
  flex:1; background:none; border:none; outline:none;
  font-family:'DM Sans',sans-serif; font-size:15px; color:var(--text);
}
.search-bar input::placeholder { color:var(--text3); }

.filters    { display:flex; gap:8px; margin-bottom:20px; flex-wrap:wrap; }
.filter-btn {
  padding:8px 16px; border-radius:20px; border:1px solid var(--border);
  background:var(--surface2); color:var(--text2);
  font-size:13px; font-weight:600; cursor:pointer;
  transition:all 0.2s; font-family:'DM Sans',sans-serif;
}
.filter-btn:hover,
.filter-btn.active {
  background:linear-gradient(135deg,var(--purple),var(--pink));
  color:white; border-color:transparent;
}
.mkt-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(290px,1fr)); gap:20px; }

.svc-card {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); padding:22px;
  transition:all 0.3s cubic-bezier(.4,0,.2,1);
  position:relative; overflow:hidden;
}
.svc-card::before {
  content:''; position:absolute; inset:0;
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink));
  opacity:0; transition:opacity 0.3s;
}
.svc-card:hover::before { opacity:0.04; }
.svc-card:hover { transform:translateY(-6px); box-shadow:var(--shadow-lg); }

.svc-head { display:flex; gap:12px; margin-bottom:14px; position:relative; }
.svc-av   {
  width:46px; height:46px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Outfit',sans-serif; font-weight:700; font-size:16px; color:white; flex-shrink:0;
}
.svc-name  { font-weight:700; font-size:14px; color:var(--text); }
.svc-stars { font-size:13px; color:var(--text3); margin-top:2px; }
.svc-title { font-family:'Outfit',sans-serif; font-size:17px; font-weight:700; color:var(--text); margin-bottom:8px; position:relative; }
.svc-desc  { font-size:14px; color:var(--text2); line-height:1.6; margin-bottom:14px; position:relative; }
.svc-tags  { display:flex; gap:7px; margin-bottom:14px; position:relative; flex-wrap:wrap; }
.svc-tag   { padding:5px 12px; background:var(--surface2); border-radius:8px; font-size:12px; font-weight:700; color:var(--text2); }
.svc-foot  {
  display:flex; justify-content:space-between; align-items:center;
  padding-top:14px; border-top:1px solid var(--border); position:relative;
}
.svc-price {
  font-family:'Outfit',sans-serif; font-size:22px; font-weight:800;
  background:linear-gradient(135deg,var(--purple),var(--pink));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}

/* ─────────────────────────────────────────
   SOCIAL FEED
───────────────────────────────────────── */
.feed-list    { display:flex; flex-direction:column; gap:16px; }
.post-card    { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:22px; }
.post-head    { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.post-av      {
  width:44px; height:44px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Outfit',sans-serif; font-weight:700; font-size:16px; color:white; flex-shrink:0;
}
.post-author  { font-weight:700; font-size:14px; color:var(--text); }
.post-role    { font-size:13px; color:var(--text3); }
.post-time    { margin-left:auto; font-size:12px; color:var(--text3); }
.post-body    { font-size:15px; color:var(--text2); line-height:1.6; margin-bottom:14px; }
.post-achievement {
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink));
  border-radius:12px; padding:14px 18px;
  display:flex; align-items:center; gap:12px; margin-bottom:14px;
}
.post-achievement-icon { font-size:28px; }
.post-achievement-text { font-weight:700; font-size:14px; color:var(--purple); }
.post-actions { display:flex; gap:16px; padding-top:14px; border-top:1px solid var(--border); }
.post-action  {
  display:flex; align-items:center; gap:6px;
  background:none; border:none; color:var(--text3);
  font-size:14px; font-weight:600; cursor:pointer;
  padding:6px 12px; border-radius:8px; transition:all 0.2s;
  font-family:'DM Sans',sans-serif;
}
.post-action:hover { background:var(--surface2); color:var(--purple); }

/* ─────────────────────────────────────────
   PROFILE SECTION
───────────────────────────────────────── */
.profile-layout     { display:grid; grid-template-columns:340px 1fr; gap:22px; }
.profile-main-card  {
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); padding:32px; text-align:center;
}
.prof-avatar-wrap {
  position:relative; width:110px; height:110px; margin:0 auto 18px;
}
.prof-avatar {
  width:110px; height:110px; border-radius:22px;
  display:flex; align-items:center; justify-content:center;
  font-family:'Outfit',sans-serif; font-weight:800; font-size:44px; color:white;
  box-shadow:0 8px 28px rgba(167,139,250,0.35);
  overflow:hidden; /* Para que la imagen no se salga */
}
.prof-avatar img {
  width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block;
}
.prof-avatar-upload-btn {
  position:absolute; bottom:-4px; right:-4px;
  width:34px; height:34px; border-radius:50%;
  background:var(--cyan); border:3px solid var(--surface);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; color:#050a0d;
  transition:all 0.25s ease;
  box-shadow:0 4px 12px rgba(0,229,255,0.3);
  z-index:2;
}
.prof-avatar-upload-btn:hover {
  transform:scale(1.15);
  box-shadow:0 4px 18px rgba(0,229,255,0.5);
}
.prof-name  { font-family:'Outfit',sans-serif; font-size:24px; font-weight:800; color:var(--text); }
.prof-code  { font-size:14px; color:var(--text3); margin:4px 0 20px; }
.prof-stats {
  display:grid; grid-template-columns:repeat(3,1fr); gap:12px;
  padding:20px 0; margin-bottom:20px;
  border-top:1px solid var(--border); border-bottom:1px solid var(--border);
}
.p-stat-val {
  font-family:'Outfit',sans-serif; font-size:28px; font-weight:800;
  background:linear-gradient(135deg,var(--purple),var(--pink));
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  margin-bottom:4px;
}
.p-stat-label { font-size:12px; color:var(--text3); font-weight:500; }
.prof-skills  { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; }

/* ── Timeline ── */
.timeline  { background:var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }
.tl-title  { font-family:'Outfit',sans-serif; font-size:18px; font-weight:700; color:var(--text); margin-bottom:20px; }
.tl-list   { display:flex; flex-direction:column; }
.tl-item   { display:flex; gap:16px; position:relative; }
.tl-item::before {
  content:''; position:absolute; left:19px; top:36px; bottom:-24px;
  width:2px; background:linear-gradient(180deg,var(--p-purple),transparent);
}
.tl-item:last-child::before { display:none; }
.tl-dot {
  width:40px; height:40px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:18px;
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink));
  border:3px solid var(--surface);
}
.tl-content { padding-bottom:24px; }
.tl-event   { font-weight:700; font-size:15px; color:var(--text); }
.tl-date    { font-size:13px; color:var(--text3); margin-top:3px; }
.tl-badge   {
  display:inline-block; margin-top:6px; padding:4px 12px;
  border-radius:20px; font-size:12px; font-weight:700;
  background:linear-gradient(135deg,var(--p-purple),var(--p-pink)); color:var(--purple);
}
