:root {
  --accent: #00bcd4;
  --bg-dark: #121212;
  --bg-card: #1b1b1b;
  --text: #e0e0e0;
}

/* === RESET GENERAL === */
* {
  box-sizing: border-box;
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  outline: none;
}

body {
  background-color: #121212;
  color: var(--text);
  margin: 0;
  display: flex;
  min-height: 100vh;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* === ICONOS SVG === */
.nav-icon {
  width: 22px;
  height: 22px;
  filter: invert(85%) sepia(30%) saturate(200%) hue-rotate(160deg);
  /* tono cian claro */
  opacity: 0.9;
  margin-right: 10px;
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.nav-icon[src$="redeem.svg"] {
  transform: scale(1.15);
}

.nav-link:hover .nav-icon,
.logout-link:hover .nav-icon {
  filter: invert(95%) sepia(40%) saturate(400%) hue-rotate(170deg);
  opacity: 1;
  transform: scale(1.1);
}

.nav-link.active .nav-icon {
  filter: invert(78%) sepia(92%) saturate(1146%) hue-rotate(154deg);
  opacity: 1;
}

/* === SIDEBAR === */
.neo-sidebar {
  width: 240px;
  background: #141414;
  border-right: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  transition: width 0.3s ease;
}

/* === LOGO === */
.neo-sidebar .logo {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 18vh;
  background-color: #0b0b0b;
}

.logo>img {
  display: none;
}

/* === NAVEGACIÓN === */
.neo-sidebar nav {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Indicador dinámico */
.neo-sidebar nav .indicator {
  position: absolute;
  left: 0;
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: top 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  opacity: 0.9;
}

/* === ENLACES === */
.nav-link,
.logout-link button {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  color: #c8c8c8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  /* min-height: 44px; */
  transition: background 0.25s ease, color 0.25s ease;
}

.nav-link:hover,
.logout-link button:hover {
  background: #1e1e1e;
  color: #ffffff;
}

.nav-link.active {
  background: #1e1e1e;
  color: var(--accent);
  font-weight: 600;
}

/* === USUARIO === */

.neo-sidebar .user-info img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: contain;
  border: 1px solid #2a2a2a;
}

.neo-sidebar .username {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.neo-sidebar .puntos {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

/* === MAIN === */
main {
  margin-left: 240px;
  max-width: calc(100vw - 240px);
  /* padding: 0px 30px; */
  flex: 1;

}

/* === BOTÓN SALIR === */
.nav-item {
  display: block;
  width: 100%;
}

.logout-link {
  all: unset;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 26px;
  color: #b5b5b5;
  font-size: 0.95rem;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.25s ease;
}

.logout-link:hover {
  background: #1e1e1e;
  color: var(--accent);
}

.nav-item form {
  margin: 0;
  padding: 0;
  width: 100%;
  display: block;
}

/* === ENCABEZADOS GLOBALES === */
h2,
h3,
h4 {
  color: #dcdcdc;
  font-weight: 600;
}

h2 {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin: 40px 0 30px;
  position: relative;
  color: #cfcfcf;
}

h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, #00bcd4, #61dafb);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(97, 218, 251, 0.6);
}

/* --- FIX: messages pegados al viewport, esquina inferior izquierda --- */
.messages {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  z-index: 2147483646 !important;
  /* debajo del modal, encima de las cards */
  display: flex !important;
  flex-direction: column-reverse;
  gap: 12px;
  pointer-events: none;
  /* clics pasan salvo en el contenido del msg */
}

.msg {
  position: relative !important;
  /* <-- Quita el absolute del estilo anterior */
  bottom: auto !important;
  right: auto !important;
  left: auto !important;

  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;

  /* Estilo tipo toast */
  background: rgba(18, 18, 18, 0.96) !important;
  border: 1px solid #2a2a2a !important;
  border-left: 4px solid var(--accent) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .6) !important;
}

/* Colores por tipo (si usas tags de Django) */
.msg-success {
  border-left-color: #1abc9c !important;
  background: rgba(8, 38, 34, .96) !important;
}

.msg-error {
  border-left-color: #ff5555 !important;
  background: rgba(50, 8, 8, .96) !important;
}

.msg-warning {
  border-left-color: #f0ad4e !important;
  background: rgba(48, 36, 8, .96) !important;
}

.msg-info {
  border-left-color: #61dafb !important;
  background: rgba(0, 60, 90, .92) !important;
}


a.nav-link:nth-child(2)>.nav-icon {
  filter: none !important;
  width: 50px;
  height: 50px;
  /* border-radius: 50%; */
  object-fit: cover;
  /* border: 1px solid #00bcd4; */
}

.btn-tema {
  background: transparent;
  border: none;
  color: #00bcd4;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-tema:hover {
  transform: scale(1.2);
}

.puntos img.coin {
  width: 30px;
  height: 30px;
}

/* MODAL CANJEAR CODIGO */
.modal-codigo {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-codigo.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(120deg, #0d1b2a, #1b263b);
  border: 1px solid rgba(97, 218, 251, 0.2);
  border-radius: 14px;
  padding: 30px 32px;
  color: #e0e0e0;
  width: 340px;
  text-align: center;
  position: relative;
  box-shadow: 0 0 25px rgba(0, 188, 212, 0.3);
  animation: modalFadeIn 0.25s ease-in-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #61dafb;
  margin-bottom: 18px;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #111;
  color: #eee;
  font-family: 'Fira Code', monospace;
}

.modal-content input:focus {
  outline: none;
  border-color: #61dafb;
  box-shadow: 0 0 8px rgba(97, 218, 251, 0.4);
}

.modal-content button {
  margin-top: 16px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #61dafb, #3ea8c4);
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.15s ease;
}

.modal-content button:hover {
  background: linear-gradient(90deg, #3ea8c4, #61dafb);
  transform: translateY(-1px);
}

.cerrar-modal {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.25s;
}

.cerrar-modal:hover {
  color: #fff;
}

.mensaje {
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* === TOAST FIJO Y SOBRE TODO === */
#toast-container {
  position: fixed !important;
  bottom: max(24px, env(safe-area-inset-bottom));
  right: max(24px, env(safe-area-inset-left));
  z-index: 2147483647 !important;
  /* top layer */
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(18, 18, 18, 0.96);
  border-left: 4px solid var(--accent);
  color: #f5f5f5;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .6);
  min-width: 320px;
  max-width: 420px;
  opacity: 0;
  transform: translateY(40px);
  transition: all .35s ease;
  position: relative;
  z-index: 2147483647;
  /* por si hay pseudo-elementos locos */
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(20px); }
}

.toast.show {
  animation: toastSlideIn 0.4s ease forwards;
}

.toast.fade-out {
  animation: toastSlideOut 0.3s ease forwards;
}

/* Extra: cuando hay animaciones o pseudo elementos debajo */
.event-card,
.event-page,
.event-card::before,
.event-card::after {
  z-index: 0 !important;
}


.toast.toast-info {
  background: rgba(0, 60, 90, 0.9);
  border-left-color: #61dafb;
}

.toast-success { border-left-color: #00e676; }
.toast-error   { border-left-color: #ff5555; }
.toast-warning { border-left-color: #ffb74d; }
.toast-info    { border-left-color: #61dafb; }

.toast strong {
  color: #fff;
  font-size: 1rem;
}

.toast p {
  margin: 4px 0;
  color: #ddd;
  font-size: 0.9rem;
}

.toast .fecha {
  font-size: 0.75rem;
  opacity: 0.7;
}

.toast-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  margin-left: 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: 0.2s;
  position: absolute;
  top: .5rem;
  right: .8rem;
}

.toast-close:hover {
  opacity: 1;
  color: #61dafb;
}

.feedback-btn {
  position: fixed;
  bottom: 25px;
  left: 25px;
  background: #00bcd4;
  color: white;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transition: transform 0.2s ease;
}

#feedback-btn>svg {
  width: 1.5rem;
  height: 1.5rem;
}

.feedback-btn:hover {
  transform: scale(1.1);
}

/* === Modal === */
.feedback-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.feedback-modal.active {
  display: flex;
}

.feedback-content {
  background: #1f1f1f;
  color: #eee;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  position: relative;
}

.feedback-content h3 {
  margin-top: 0;
  text-align: center;
}

.feedback-content label {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
  color: #ccc;
}

.feedback-content input,
.feedback-content textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: none;
  border-radius: 6px;
  background: #2a2a2a;
  color: #fff;
  font-size: 0.95rem;
}

.feedback-content textarea {
  min-height: 100px;
  resize: vertical;
}

.feedback-content button {
  background: #00bcd4;
  color: white;
  border: none;
  padding: 10px 15px;
  margin-top: 15px;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.feedback-close {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
}

#feedback-status {
  margin-top: 10px;
  text-align: center;
}



.card.mostrando::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(circle at center, var(--accent) 0%, transparent 60%);
  opacity: 0.15;
  filter: blur(10px);
  animation: glowFlash 0.6s ease-out;
  pointer-events: none;
}

@keyframes glowFlash {
  0% {
    opacity: 0.3;
    transform: scale(0.9);
  }

  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

.user-info.enhanced {
  display: flex;
  gap: 12px;
  padding: 24px 18px;
  background: #0b0b0b;
  /* border-top: 1px solid #1f1f1f; */
  align-items: center;
}

.avatar-wrapper {
  position: relative;
}

.user-avatar-neo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #00bcd4;
  box-shadow: 0 0 15px rgba(0, 188, 212, .4);
  transition: 0.25s ease;
}

.user-avatar-neo:hover {
  transform: scale(1.07);
  box-shadow: 0 0 25px rgba(0, 188, 212, 0.8);
}

.status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: #1abc9c;
  border-radius: 50%;
  border: 2px solid #0f0f0f;
}

.avatar-wrapper > .rank-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: #00bcd4;
  color: #000;
  padding: 3px 6px;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 188, 212, .7);
}

.user-meta .user-name {
  font-weight: 600;
  color: #fff;
  font-size: .95rem;
}

.user-points {
  /* display: none; */
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
}

.xp-bar {
  margin-top: 4px;
  background: #222;
  height: 5px;
  width: 100%;
  border-radius: 4px;
}

.xp-bar>div {
  height: 100%;
  background: linear-gradient(90deg, #00bcd4, #61dafb);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(0, 188, 212, .7);
}

/* === TEAM EMBLEM NEO === */
.team-banner {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  background: linear-gradient(182deg, #0b0b0b, #151515);
  /* border-top: 1px solid #1f1f1f; */
  padding: 16px 22px;
  position: relative;
  text-decoration: none;
  color: #e0e0e0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.team-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: conic-gradient(from 180deg at 50% 50%, #00bcd4, #61dafb, #00bcd4);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  pointer-events: none;
}

.team-banner:hover::before {
  opacity: 0.12;
}

/* === ESCUDO === */
.team-banner>.team-shield {
  position: relative;
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #101010, #1a1a1a);
  border: 1.5px solid #00bcd4;
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  overflow: visible;
  /* ✅ permite que el badge sobresalga */
  z-index: 2;
  /* eleva el escudo sobre fondos con gradientes */
}

.team-shield:hover {
  transform: rotate(3deg) scale(1.05);
  box-shadow: 0 0 25px rgba(0, 188, 212, 0.8);
}

.team-shield-img {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
}

.team-shield-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0d0d0d, #1a1a1a 80%);
}

.team-shield-placeholder svg {
  width: 42px;
  height: 42px;
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(0, 188, 212, 0.6));
}

/* === INSIGNIA DE RANGO === */
.team-rank-badge {
  position: absolute;
  bottom: -6px;
  right: -8px;
  padding: 4px 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, #00bcd4, #61dafb);
  color: #000;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.8);
  text-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  z-index: 3;
  animation: rankPulse 3s infinite ease-in-out;
}

@keyframes rankPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.team-banner-points {
  height: 2.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .3rem;
  font-weight: 900;
  font-size: 1.3rem;
}

.team-banner-points>svg {
  height: 2.5rem;
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .neo-sidebar {
    width: 80px;
  }

  .neo-sidebar .logo span,
  .nav-link span,
  .user-details {
    display: none;
  }

  .nav-link,
  .logout-link button {
    justify-content: center;
    padding: 12px 0;
  }

  body main {
    margin-left: 80px;
    max-width: calc(100vw - 80px);
  }

  .user-info {
    flex-direction: column;
    text-align: center;
    padding: 14px 0;
  }

  .user-details {
    display: none;
  }

  .user-meta,
  .team-banner-info {
    display: none;
  }

  .neo-sidebar .user-info img {
    width: 75px;
    height: 75px;
  }

  .team-banner {
    padding: 16px 4px;
  }
}

@media(max-width: 600px) {

  body main {
    position: absolute;
    margin-left: 0px !important;
    width: 100vw;
    max-width: 100vw;
  }

  .desafios-container {
    justify-content: center;
    margin-bottom: 7rem;
  }

  .desafios-container .card {
    width: 150px;
  }

  .neo-sidebar {
    position: fixed;
    bottom: 0;
    border-top: 1px solid #1f1f1f;
    height: 5rem;
    top: unset;
    width: 100vw;
  }

  .neo-sidebar .user-info,
  .neo-sidebar .logo {
    display: none;
  }

  .neo-sidebar nav {

    display: flex;
    width: 100vw;
    flex-direction: row;

    justify-content: center;

    padding-top: 0;
  }



  .nav-item,
  .nav-link {
    width: 20vw;
    /* border: 1px red solid !important; */
    height: 5rem;
  }

  .team-banner {
    min-width: fit-content;
    width: fit-content;
    padding: 0px 10px;
  }

  .feedback-btn {
    top: 25px;
  }
}

