/* Campus NikaMed+ — tema premium (violeta degradé) para NikaMed+ y admin.
   Se activa con body.tema-premium (js/campusTema.js). Convive con body.dark-mode (el premium es una variante oscura).
   También mejora el banner de la sidebar: versión común y versión NikaMed+/admin. */

/* =============== BANNER DE LA SIDEBAR (todos los usuarios) =============== */
.sidebar-brand-box { position: relative; overflow: hidden; isolation: isolate; border-radius: 16px; padding: 20px 18px 16px;
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.16), rgba(2, 132, 199, 0.05) 60%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(56, 189, 248, 0.28); box-shadow: 0 8px 24px rgba(2, 132, 199, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.sidebar-brand-box::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 140px; height: 140px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%); filter: blur(6px); animation: cpOrbe 7s ease-in-out infinite alternate; }
.sidebar-brand-box::after { content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16), transparent); transform: skewX(-18deg); animation: cpBrillo 6s ease-in-out infinite; }
.sidebar-brand-box:hover { transform: translateY(-2px); border-color: rgba(125, 211, 252, 0.5); box-shadow: 0 12px 28px rgba(2, 132, 199, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.sidebar-brand-logo .nika-isotipo { filter: drop-shadow(0 4px 10px rgba(56, 189, 248, 0.45)); transition: transform .3s ease; animation: cpFlota 5s ease-in-out infinite; }
.sidebar-brand-box:hover .nika-isotipo { transform: scale(1.06) rotate(-2deg); }
.sidebar-brand-name { background: linear-gradient(120deg, #e0f2fe, #38bdf8 55%, #7dd3fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.4px; }
.brand-chip { display: none; margin: 8px auto 0; padding: 3px 11px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; width: fit-content; }

/* ---- versión NikaMed+ / admin ---- */
.sidebar-brand-box.brand-plus { border: 1px solid transparent; padding: 22px 18px 18px;
  background: linear-gradient(#150a33, #0c0522) padding-box, conic-gradient(from var(--cp-ang, 0deg), #a855f7, #38bdf8, #e9d5ff, #7c3aed, #a855f7) border-box;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.35), 0 0 0 1px rgba(168, 85, 247, 0.15); animation: cpGiro 6s linear infinite; }
.sidebar-brand-box.brand-plus::before { background: radial-gradient(circle, rgba(168, 85, 247, 0.55), transparent 70%); width: 170px; height: 170px; }
.sidebar-brand-box.brand-plus:hover { box-shadow: 0 14px 38px rgba(168, 85, 247, 0.5), 0 0 0 1px rgba(192, 132, 252, 0.4); border-color: transparent; }
.sidebar-brand-box.brand-plus .nika-isotipo { filter: drop-shadow(0 4px 14px rgba(168, 85, 247, 0.75)); }
.sidebar-brand-box.brand-plus .sidebar-brand-name { background: linear-gradient(110deg, #c084fc 0%, #f5f3ff 35%, #a855f7 60%, #e9d5ff 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: cpTexto 5s linear infinite; }
.sidebar-brand-box.brand-plus .brand-chip { display: block; color: #fff; background: linear-gradient(90deg, #7e22ce, #a855f7, #7e22ce); background-size: 200% 100%;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.5); animation: cpTexto 4s linear infinite; }
.sidebar-brand-box.brand-admin .brand-chip { background: linear-gradient(90deg, #b91c1c, #ef4444, #b91c1c); background-size: 200% 100%; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45); }

@property --cp-ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes cpGiro { to { --cp-ang: 360deg; } }
@keyframes cpTexto { to { background-position: 220% 0; } }
@keyframes cpBrillo { 0%, 55% { left: -70%; } 100% { left: 150%; } }
@keyframes cpOrbe { from { transform: translate(0, 0) scale(1); } to { transform: translate(-18px, 14px) scale(1.25); } }
@keyframes cpFlota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* =============== SELECTOR DE APARIENCIA =============== */
.cp-apariencia { padding: 6px 4px 2px; }
.cp-apariencia small { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: #94a3b8; margin: 0 0 6px 12px; }
.cp-opciones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cp-op { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 0.68rem; font-weight: 700;
  color: var(--sidebar-text); background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); transition: transform .18s, background .18s, border-color .18s, box-shadow .18s; }
.cp-op span { font-size: 1.15rem; line-height: 1; }
.cp-op:hover { transform: translateY(-2px); background: rgba(168, 85, 247, 0.18); border-color: rgba(192, 132, 252, 0.5); }
.cp-op.on { color: #fff; background: linear-gradient(135deg, #7e22ce, #a855f7); border-color: #c084fc; box-shadow: 0 6px 16px rgba(168, 85, 247, 0.4); }

/* =============== TEMA PREMIUM =============== */
body.tema-premium {
  --nika-primary: #a855f7; --nika-accent: #c4b5fd; --nika-dark: #f8fafc; --nika-deep: #0b0620;
  --bg-body: transparent; --border: rgba(168, 85, 247, 0.25); --text-main: #f8fafc; --text-muted: #a5b4d0;
  --card-bg: rgba(18, 10, 44, 0.72); --sidebar-bg: #0e0629; --sidebar-text: #e2e8f0;
  --shadow: 0 14px 34px -10px rgba(76, 29, 149, 0.55);
  background-color: transparent; position: relative;
}
html:has(body.tema-premium) { background: #050212; }
body.tema-premium::before { content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(900px 600px at 12% -5%, rgba(168, 85, 247, 0.28), transparent 60%),
              radial-gradient(800px 560px at 100% 10%, rgba(56, 189, 248, 0.18), transparent 60%),
              radial-gradient(700px 500px at 50% 110%, rgba(124, 58, 237, 0.26), transparent 60%), #050212;
  animation: cpAurora 18s ease-in-out infinite alternate; }
body.tema-premium::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(196, 181, 253, 0.55) 1px, transparent 1.5px); background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000, transparent 75%); mask-image: radial-gradient(ellipse at 50% 30%, #000, transparent 75%); animation: cpPuntos 40s linear infinite; }
@keyframes cpAurora { from { filter: hue-rotate(0deg); transform: scale(1); } to { filter: hue-rotate(-18deg); transform: scale(1.06); } }
@keyframes cpPuntos { to { background-position: 46px 46px; } }

body.tema-premium .sidebar { background: linear-gradient(180deg, #14083a 0%, #0a0420 55%, #06021a 100%); border-right: 1px solid rgba(168, 85, 247, 0.28);
  box-shadow: 8px 0 40px rgba(76, 29, 149, 0.35); }
body.tema-premium .sidebar::before { content: ""; position: absolute; top: 0; right: 0; width: 1px; height: 100%; pointer-events: none;
  background: linear-gradient(180deg, transparent, #a855f7, #38bdf8, transparent); background-size: 100% 300%; animation: cpLinea 7s linear infinite; }
@keyframes cpLinea { to { background-position: 0 300%; } }
body.tema-premium .sidebar::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.5); }
body.tema-premium .sidebar-category { color: #a78bfa; }
body.tema-premium .sidebar-link { position: relative; overflow: hidden; }
body.tema-premium .sidebar-link:hover { background: linear-gradient(90deg, rgba(168, 85, 247, 0.22), rgba(56, 189, 248, 0.08)); color: #f5f3ff; box-shadow: inset 3px 0 0 #a855f7; }
body.tema-premium .sidebar-user-card { background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(56, 189, 248, 0.08)); border: 1px solid rgba(192, 132, 252, 0.4);
  box-shadow: 0 6px 18px rgba(76, 29, 149, 0.35); }
body.tema-premium .sidebar-user-card:hover { background: linear-gradient(135deg, rgba(168, 85, 247, 0.32), rgba(56, 189, 248, 0.12)); transform: translateY(-1px); }
body.tema-premium .sidebar-user-avatar { border-color: #c084fc; box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25); }
body.tema-premium .sidebar-user-info span { color: #c4b5fd; }

body.tema-premium .top-header { background: rgba(12, 6, 34, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; border-image: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.7), rgba(56, 189, 248, 0.5), transparent) 1; box-shadow: 0 8px 30px rgba(76, 29, 149, 0.25); }
body.tema-premium .toggle-sidebar-btn { background: rgba(168, 85, 247, 0.16); color: #e9d5ff; border-color: rgba(192, 132, 252, 0.4); }
body.tema-premium .toggle-sidebar-btn:hover { background: rgba(168, 85, 247, 0.3); box-shadow: 0 6px 16px rgba(168, 85, 247, 0.35); }
body.tema-premium .account-btn { background: linear-gradient(135deg, #7e22ce, #a855f7 55%, #6366f1); background-size: 200% 100%; color: #fff; border: 1px solid rgba(233, 213, 255, 0.35);
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4); transition: transform .2s, box-shadow .2s, background-position .5s; }
body.tema-premium .account-btn:hover { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(168, 85, 247, 0.55); }

body.tema-premium .hero-banner { background: linear-gradient(120deg, #1e0b4b 0%, #4c1d95 38%, #6d28d9 62%, #0ea5e9 130%); background-size: 220% 220%; animation: cpHero 14s ease-in-out infinite;
  border: 1px solid rgba(192, 132, 252, 0.4); box-shadow: 0 18px 44px -12px rgba(124, 58, 237, 0.6); position: relative; overflow: hidden; }
body.tema-premium .hero-banner::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.14), transparent); transform: skewX(-20deg); animation: cpBrillo 7s ease-in-out infinite; }
@keyframes cpHero { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

body.tema-premium .module-card { background: var(--card-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(168, 85, 247, 0.22);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s; animation: cpEntra .6s cubic-bezier(.2, .8, .2, 1) both; }
body.tema-premium .module-card:nth-child(2) { animation-delay: .07s; } body.tema-premium .module-card:nth-child(3) { animation-delay: .14s; }
body.tema-premium .module-card:nth-child(4) { animation-delay: .21s; } body.tema-premium .module-card:nth-child(5) { animation-delay: .28s; }
body.tema-premium .module-card:nth-child(6) { animation-delay: .35s; }
body.tema-premium .module-card:hover { transform: translateY(-7px) scale(1.012); border-color: rgba(192, 132, 252, 0.75);
  box-shadow: 0 22px 44px -12px rgba(168, 85, 247, 0.55), 0 0 0 1px rgba(192, 132, 252, 0.25); }
body.tema-premium .module-card.active-module { border-left: 5px solid #a855f7; }
body.tema-premium .module-card:hover .btn-module { background: linear-gradient(135deg, #7e22ce, #a855f7); color: #fff; }
@keyframes cpEntra { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

body.tema-premium ::selection { background: rgba(168, 85, 247, 0.5); color: #fff; }
body.tema-premium ::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.45); border-radius: 10px; }

@media (prefers-reduced-motion: reduce) {
  .sidebar-brand-box, .sidebar-brand-box::before, .sidebar-brand-box::after, .sidebar-brand-logo .nika-isotipo, .sidebar-brand-name, .brand-chip,
  body.tema-premium::before, body.tema-premium::after, body.tema-premium .sidebar::before, body.tema-premium .hero-banner, body.tema-premium .hero-banner::after,
  body.tema-premium .module-card { animation: none !important; }
}
@media (max-width: 768px) { body.tema-premium::after { display: none; } }

/* ---- marca compacta del menú (sin insignia de rol: ya está en el perfil) ---- */
.sidebar-brand-box, .sidebar-brand-box.brand-plus { padding: 10px 14px !important; margin: 12px 16px 10px !important; border-radius: 14px; }
.sidebar-brand-box .sidebar-brand-logo { min-height: 0 !important; margin-bottom: 2px !important; }
.sidebar-brand-box .sidebar-brand-logo .nika-isotipo { height: 34px !important; min-height: 0 !important; max-height: 36px !important; width: auto; }
.sidebar-brand-box .sidebar-brand-name { font-size: .92rem !important; margin: 0 !important; }
.sidebar-brand-box .brand-chip { display: none !important; }
