/* ============================================================================
   SIDE PANEL V2 — Rediseño del panel derecho (BETA, ElDoria only)
   2026-05-14
   Selectores con prefijo `.sp2-` para no chocar con el panel viejo.
   Las clases nativas (.chat-widget, .chat-widget-tab, etc.) se mantienen
   para que la lógica del chat siga funcionando.
   ============================================================================ */

.side-panel.side-panel-v2 {
  background: linear-gradient(180deg, #14102b 0%, #0a0518 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.side-panel.side-panel-v2::-webkit-scrollbar { width: 6px; }
.side-panel.side-panel-v2::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }

/* ── Card base ── */
.sp2-card {
  background: linear-gradient(180deg, rgba(28, 19, 52, 0.6), rgba(10, 5, 24, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.sp2-card:hover { border-color: rgba(255, 255, 255, 0.1); }
.sp2-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.sp2-card-icon { font-size: 14px; color: #ffc857; }
.sp2-card-body {
  padding: 10px 14px 12px;
}
.sp2-loading {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  font-style: italic;
}

/* ===== COLLAPSIBLE CARDS ===== */
.sp2-collapsible > .sp2-card-head {
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-title);
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.18s ease, background 0.18s ease;
}
.sp2-collapsible > .sp2-card-head:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.02);
}
.sp2-card-caret {
  margin-left: auto;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.25s ease, color 0.18s ease;
}
.sp2-collapsible.is-collapsed > .sp2-card-head .sp2-card-caret {
  transform: rotate(-90deg);
}
.sp2-collapsible.is-collapsed > .sp2-card-head {
  border-bottom-color: transparent;
}
.sp2-card-collapse {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.28s ease;
}
.sp2-collapsible.is-collapsed > .sp2-card-collapse {
  max-height: 0;
}

/* ===== VITALES ===== */
.sp2-vitals { padding: 0 0 4px; }
.sp2-vital-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
}
.sp2-vital-row + .sp2-vital-row { border-top: 1px solid rgba(255,255,255,0.03); }
.sp2-vital-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.sp2-vital-label i { font-size: 13px; }
.sp2-vital-hp   .sp2-vital-label { color: #ff7e93; }
.sp2-vital-hp   .sp2-vital-label i { color: #e85a6a; }
.sp2-vital-mp   .sp2-vital-label { color: #7dd3fc; }
.sp2-vital-mp   .sp2-vital-label i { color: #5aa6ff; }
.sp2-vital-stam .sp2-vital-label { color: #ffd97a; }
.sp2-vital-stam .sp2-vital-label i { color: #ffd24a; }

.sp2-vital-bar {
  height: 9px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}
.sp2-vital-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px currentColor;
}
/* 2026-05-19: la stamina tiene un ticker que actualiza cada 1s con la regen
   en curso. Usamos transición linear de 1s para que la barra se "deslice"
   suavemente entre updates sin saltos. HP/MP siguen con la transición rápida
   (0.4s ease) para que las curaciones/daño se vean bruscos. */
#side-stamina {
  transition: width 1.05s linear;
}
.sp2-vital-hp   .sp2-vital-bar-fill { background: linear-gradient(90deg, #c83e4f, #e85a6a); color: rgba(232, 90, 106, 0.5); }
.sp2-vital-mp   .sp2-vital-bar-fill { background: linear-gradient(90deg, #3a82d0, #5aa6ff); color: rgba(90, 166, 255, 0.5); }
.sp2-vital-stam .sp2-vital-bar-fill { background: linear-gradient(90deg, #c08020, #ffd24a); color: rgba(255, 210, 74, 0.5); }

.sp2-vital-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  min-width: 64px;
  text-align: right;
  letter-spacing: 0.02em;
}

/* ===== UBICACIÓN ===== */
.sp2-zone-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
}
.sp2-zone-row > i {
  font-size: 18px;
  color: #ffc857;
  flex: 0 0 auto;
}
.sp2-zone-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.02em;
}

/* ===== BUFFS ===== */
.sp2-buffs-list {
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== COMUNIDAD (Telegram links) ===== */
.sp2-community-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.sp2-tg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: all 0.18s ease;
}
.sp2-tg:hover {
  background: rgba(38, 165, 228, 0.10);
  border-color: rgba(38, 165, 228, 0.4);
  transform: translateY(-1px);
}
.sp2-tg-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(38, 165, 228, 0.15);
  border: 1px solid rgba(38, 165, 228, 0.35);
  color: #26A5E4;
  font-size: 15px;
  flex: 0 0 auto;
}
.sp2-tg-channel .sp2-tg-ico { background: rgba(255, 200, 87, 0.15); border-color: rgba(255, 200, 87, 0.4); color: #ffc857; }
.sp2-tg-channel:hover { background: rgba(255, 200, 87, 0.10); border-color: rgba(255, 200, 87, 0.4); }
.sp2-tg-support .sp2-tg-ico { background: rgba(95, 214, 132, 0.15); border-color: rgba(95, 214, 132, 0.4); color: #5fd684; }
.sp2-tg-support:hover { background: rgba(95, 214, 132, 0.10); border-color: rgba(95, 214, 132, 0.4); }
.sp2-tg-info { flex: 1; min-width: 0; }
.sp2-tg-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 12.5px;
  color: #fff;
  line-height: 1.2;
}
.sp2-tg-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.02em;
}
.sp2-tg-arrow {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
  transition: color 0.15s ease;
}
.sp2-tg:hover .sp2-tg-arrow { color: rgba(255, 255, 255, 0.75); }

/* ===== CHAT RÁPIDO ===== */
.sp2-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  padding: 0;
}
.sp2-chat .sp2-card-head {
  padding: 10px 14px 8px;
}
.sp2-chat .chat-widget {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  /* En tablet/mobile el side-panel ya se oculta por el shell, no hace falta tocar */
}
