:root{ 
  --eva-primary:#7C4DFF; 
  --eva-secondary:#00E5FF;
  --eva-accent:#69F0AE;
  --eva-warning:#FFD54F;
  --eva-bg1:#0f1021;
  --eva-bg2:#1b1e3b;
  --eva-gradient: radial-gradient(60% 100% at 20% 0%, rgba(124,77,255,.35), transparent),
                 radial-gradient(60% 100% at 80% 0%, rgba(0,229,255,.25), transparent),
                 linear-gradient(180deg, #0f1021, #1b1e3b);
}

html, body{ font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol'; }
body{ color:#1f2937; font-weight: 400; }
*{ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.bg-gradient{ background: var(--eva-gradient); min-height: 100vh; }

/* Enhanced Navbar */
.eva-navbar {
  background: linear-gradient(135deg, rgba(124,77,255,0.95) 0%, rgba(106,60,255,0.95) 100%) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(124,77,255,0.3);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 1030;
  padding: 0.75rem 0;
}

.navbar-logo-wrapper {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.navbar-logo-wrapper:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(-5deg) scale(1.05);
}

.navbar-logo {
  height: 28px;
  width: auto;
}

.navbar-brand-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Quick Actions in Navbar */
.navbar-quick-actions {
  display: flex;
  gap: 0.5rem;
}

.nav-quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
}

.nav-quick-link:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.nav-quick-link i {
  font-size: 1.1rem;
}

/* User Button */
.btn-nav-user {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.4rem 0.75rem;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-nav-user:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.3);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
  color: #7C4DFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: white;
}

.user-role {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.2;
}

/* Mobile Toggle */
.btn-nav-toggle {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-nav-toggle:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.btn-nav-toggle i {
  font-size: 1.5rem;
}

/* Enhanced Dropdown Menu */
.dropdown-menu-modern {
  border: none;
  border-radius: 12px;
  padding: 0.5rem;
  min-width: 260px;
  margin-top: 0.5rem !important;
  background: white;
}

.dropdown-menu-modern .dropdown-header {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(124,77,255,0.1) 0%, rgba(106,60,255,0.05) 100%);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.dropdown-menu-modern .dropdown-item {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin: 0.125rem 0;
  font-weight: 500;
  transition: all 0.15s ease;
}

.dropdown-menu-modern .dropdown-item:hover {
  background: rgba(124,77,255,0.08);
  color: #7C4DFF;
  transform: translateX(4px);
}

.dropdown-menu-modern .dropdown-item i {
  width: 20px;
  text-align: center;
}

.dropdown-menu-modern .dropdown-item.text-danger:hover {
  background: rgba(220,53,69,0.1);
  color: #dc3545;
}
.btn-primary{ background: #7C4DFF; border-color: #7C4DFF; box-shadow: 0 8px 20px rgba(124,77,255,.35); }
.btn-primary:hover{ background:#6a3cff; border-color:#6a3cff; transform: translateY(-1px); }

/* Modern buttons */
.btn{ border-radius: .7rem; font-weight: 600; transition: transform .08s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease; }
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: linear-gradient(135deg,#7C4DFF,#6a3cff); border: none; box-shadow: 0 8px 18px rgba(124,77,255,.25); }
.btn-primary:hover{ background: linear-gradient(135deg,#6f43ff,#5f35ec); }
.btn-outline-primary{ color:#6a3cff; border-color:#6a3cff; }
.btn-outline-primary:hover{ background:#6a3cff; color:#fff; }
.btn-warning{ background: linear-gradient(135deg,#FFD54F,#FFB300); border: none; color:#202124 }
.btn-danger{ background: linear-gradient(135deg,#ef5350,#e53935); border: none; }

/* Inputs */
.form-control,.form-select{ border-radius: .7rem; border:1px solid #e5e7eb; }
.form-control:focus,.form-select:focus{ border-color:#7C4DFF; box-shadow: 0 0 0 .2rem rgba(124,77,255,.15); }

/* Tables */
.table{ --tw-bg:#ffffff; background: var(--tw-bg); border-radius: 1rem; overflow: hidden; }
.table thead th{ background:#f3f4f6; color:#111827; font-weight:700; border-bottom: none !important; }
.table td,.table th{ padding: .9rem 1rem; vertical-align: middle; }
.table-hover tbody tr{ transition: background-color .15s ease; }
.table-hover tbody tr:hover{ background-color: #f9fafb; }

/* Cards */
.card{ border: 0; border-radius: 1rem; box-shadow: 0 10px 25px rgba(2,6,23,.06); transition: box-shadow .2s ease, transform .15s ease; }
.card:hover{ box-shadow: 0 12px 28px rgba(2,6,23,.09); }
.card-header{ font-weight: 800; }

/* Layout helpers */
.section{ margin-bottom: 1.25rem; }
.table-wrap{ background:#fff; border-radius: 1rem; box-shadow: 0 6px 18px rgba(2,6,23,.06); overflow: hidden; }

.animate-pop{ animation: pop .4s ease both; }
@keyframes pop{0%{transform: scale(.98); opacity:.0}100%{transform: scale(1); opacity:1}}
.animate-fadein{ animation: fadein .25s ease; }
@keyframes fadein{0%{opacity:0; transform: translateY(4px)}100%{opacity:1; transform: none}}

.tag{ display:inline-block; padding:.25rem .5rem; background: rgba(124,77,255,.2); border:1px solid rgba(124,77,255,.4); color:#fff; border-radius:999px; font-size:.75rem; }

.badge{ border-radius:999px; }

/* Perfect circular icon containers */
.icon-circle {
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-circle i {
  font-size: 1.5rem;
}

.icon-circle-sm {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-circle-sm i {
  font-size: 1.1rem;
}

.icon-circle-lg {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.icon-circle-lg i {
  font-size: 1.75rem;
}

.toast{ background: rgba(20,20,40,.95); }

/* App shell layout */
.app-shell{ display: block; }
@media (min-width: 992px){
  .app-shell{ display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem; align-items: start; }
  .app-shell.no-sidebar{ display: block; }
}
.sidebar-lg{ position: sticky; top: 1rem; align-self: start; }

/* Custom sidebar navigation */
.nav-sidebar,
.nav-sidebar-mobile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-sidebar-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #374151;
  transition: all 0.2s ease;
  position: relative;
}

.nav-sidebar-item:hover {
  background: rgba(124, 77, 255, 0.08);
  color: #374151;
  transform: translateX(2px);
}

.nav-sidebar-item.active {
  background: linear-gradient(90deg, rgba(124, 77, 255, 0.15) 0%, rgba(124, 77, 255, 0.05) 100%);
  color: #1f2937;
  font-weight: 600;
  box-shadow: inset 3px 0 0 0 var(--eva-primary);
}

.nav-sidebar-item .rounded-circle {
  transition: all 0.2s ease;
}

.nav-sidebar-item:hover .rounded-circle {
  transform: scale(1.1);
}

.nav-sidebar-item.active .rounded-circle {
  background: rgba(124, 77, 255, 0.2) !important;
}
.content-area{ min-width: 0; }

/* Headings normalization */
h1{ font-weight: 900; font-size: 2rem; letter-spacing: .2px; }
h2{ font-weight: 800; font-size: 1.5rem; letter-spacing: .15px; margin-top:.5rem; margin-bottom: 1rem; }
h3{ font-weight: 700; font-size: 1.25rem; }

/* Prominent page title style applied to main view headings */
.page-title{
  font-weight: 900;
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.2rem);
  letter-spacing: .2px;
  margin-top: .25rem;
  margin-bottom: 1rem;
  line-height: 1.15;
}

/* Smooth UI touches */
a{ transition: color .15s ease, opacity .15s ease; }
.offcanvas{ transition: transform .2s ease-in-out; }
.navbar .dropdown-menu{ z-index: 1040; }
.form-control, .form-select{ transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.list-group-item{ transition: background-color .15s ease, color .15s ease; }

/* Iconos en menú lateral */
.list-group-item i {
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.list-group-item:hover i {
  opacity: 1;
  transform: translateX(3px);
}

.list-group-item-action:active {
  background-color: #7C4DFF;
  color: white;
}

.list-group-item-action:active i {
  opacity: 1;
}

/* Apply fade-in to content area */
.content-area{ animation: fadein .25s ease; }

/* Ensure modals overlay correctly above app content */
.modal{ z-index: 1055; }
.modal-backdrop{ z-index: 1050; }

/* ====== MEJORAS MODERNAS ====== */

/* Modal con scroll interno */
.modal-dialog-scrollable .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Cards limpios y modernos */
.card {
  border: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  font-weight: 700;
  border-radius: 1rem 1rem 0 0 !important;
  color: #495057;
}

/* Botones de creación destacados */
.btn-create {
  background: linear-gradient(135deg, #7C4DFF, #6a3cff);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(124, 77, 255, 0.3);
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 0.8rem;
  transition: all 0.2s ease;
}

.btn-create:hover {
  background: linear-gradient(135deg, #6f43ff, #5f35ec);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 77, 255, 0.4);
  color: white;
}

.btn-create i {
  margin-right: 0.5rem;
}

/* Títulos consistentes con línea decorativa */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, #7C4DFF, #00E5FF) 1;
}

.page-header h2 {
  margin: 0;
  font-weight: 800;
  background: linear-gradient(135deg, #7C4DFF, #00E5FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Tablas mejoradas */
.table {
  border-radius: 0.8rem;
  overflow: hidden;
}

.table thead th {
  background: #f8f9fa;
  font-weight: 700;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: #495057;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Badges modernos */
.badge {
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

/* Forms mejorados */
.form-control:focus,
.form-select:focus {
  border-color: #7C4DFF;
  box-shadow: 0 0 0 0.2rem rgba(124, 77, 255, 0.15);
}

.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

/* Animaciones sutiles */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Ranking estilo Kahoot! - Colores vibrantes y animaciones */
.podio {
  perspective: 1000px;
}

.podio-card {
  border-radius: 1.5rem;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: slideUp 0.6s ease-out backwards;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.podio-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

/* Oro - Amarillo vibrante Kahoot! */
.podio-card.oro {
  background: linear-gradient(145deg, #FFD700 0%, #FFED4E 50%, #FFC700 100%);
  animation-delay: 0.2s;
}

.podio-card.oro::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  animation: rotate 4s linear infinite;
}

/* Plata - Azul claro Kahoot! */
.podio-card.plata {
  background: linear-gradient(145deg, #46CDCF 0%, #67E3E5 50%, #3DBBC0 100%);
  animation-delay: 0.4s;
}

.podio-card.plata::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  animation: rotate 5s linear infinite;
}

/* Bronce - Naranja vibrante Kahoot! */
.podio-card.bronce {
  background: linear-gradient(145deg, #FF9500 0%, #FFB84D 50%, #FF8500 100%);
  animation-delay: 0.6s;
}

.podio-card.bronce::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  animation: rotate 6s linear infinite;
}

/* Contenido del podio */
.podio-card .medalla {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: bounce 1s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

.podio-card .pos {
  font-size: 1.5rem;
  font-weight: 900;
  color: #1a1a1a;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
}

.podio-card .nombre {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0.75rem 0;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
}

.podio-card .score {
  font-size: 2rem;
  font-weight: 900;
  color: #1a1a1a;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.7);
  position: relative;
  z-index: 1;
}

/* Animaciones Kahoot! */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Tabla de ranking con hover animado */
#rankingTable tbody tr {
  transition: all 0.3s ease;
  cursor: pointer;
}

#rankingTable tbody tr:hover {
  background: linear-gradient(90deg, rgba(124, 77, 255, 0.1) 0%, rgba(0, 229, 255, 0.1) 100%);
  transform: translateX(5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Hover lift effect for cards */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Modern Toast Notifications */
.toast-modern {
  min-width: 350px;
  border-radius: 12px;
  animation: slideInRight 0.3s ease-out;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.toast-success {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(56, 142, 60, 0.95) 100%);
  border-left: 4px solid #4CAF50;
  color: white;
}

.toast-danger {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(211, 47, 47, 0.95) 100%);
  border-left: 4px solid #F44336;
  color: white;
}

.toast-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.95) 0%, rgba(255, 160, 0, 0.95) 100%);
  border-left: 4px solid #FFC107;
  color: #1a1a1a;
}

.toast-info {
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.95) 0%, rgba(25, 118, 210, 0.95) 100%);
  border-left: 4px solid #2196F3;
  color: white;
}

.toast-icon {
  font-size: 24px;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.toast-modern .toast-body {
  padding: 16px 12px;
  font-size: 14px;
}

.toast-modern .btn-close {
  opacity: 0.8;
}

.toast-warning .btn-close {
  filter: brightness(0);
}

.toast-modern .btn-close:hover {
  opacity: 1;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scroll suave en toda la app */
* {
  scroll-behavior: smooth;
}

/* Mejorar legibilidad */
p, li, td, th {
  line-height: 1.6;
}
