/* 1. GLOBAL BACKGROUND */
body {
  background: linear-gradient(135deg, #f0f4ff 0%, #faf5ff 50%, #f0f9ff 100%) !important;
  background-attachment: fixed !important;
  min-height: 100vh;
  color: #1e293b !important;
}

/* Floating Blobs */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: fixed !important;
  border-radius: 50% !important;
  filter: blur(80px) !important;
  opacity: 0.4 !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

.blob:nth-child(1) {
  width: 500px;
  height: 500px;
  background: rgba(99, 102, 241, 0.12) !important;
  top: -100px;
  left: -100px;
  animation: float1 20s infinite alternate !important;
}

.blob:nth-child(2) {
  width: 400px;
  height: 400px;
  background: rgba(168, 85, 247, 0.1) !important;
  bottom: -50px;
  right: 200px;
  animation: float2 25s infinite alternate !important;
}

.blob:nth-child(3) {
  width: 350px;
  height: 350px;
  background: rgba(59, 130, 246, 0.1) !important;
  top: 40%;
  right: -50px;
  animation: float1 18s infinite alternate-reverse !important;
}

@keyframes float1 {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(60px, 40px) scale(1.1);
  }
}

@keyframes float2 {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(-40px, 60px) scale(0.95);
  }
}

/* Make sure content is above blobs */
.sidebar,
.main-content,
main,
.content {
  position: relative !important;
  z-index: 1 !important;
}

/* 2. GLASSMORPHISM SIDEBAR */
aside,
.sidebar,
#sidebar,
nav.sidebar {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-right: 1px solid rgba(99, 102, 241, 0.15) !important;
  box-shadow: 4px 0 24px rgba(99, 102, 241, 0.08) !important;
}

aside *,
.sidebar *,
#sidebar *,
nav.sidebar * {
  color: #1e293b !important;
}

/* SIDEBAR NAV BUTTONS - UIverse animation */
.sidebar a, .sidebar nav a, aside a, nav.sidebar a, #sidebar a {
  --color: #6366f1;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  margin: 4px 8px !important;
  position: relative !important;
  cursor: pointer !important;
  overflow: hidden !important;
  border: 1px solid transparent !important;
  transition: color 0.5s !important;
  z-index: 1 !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  text-decoration: none !important;
  background: transparent !important;
}

.sidebar a:before, aside a:before, #sidebar a:before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  background: var(--color) !important;
  height: 200px !important;
  width: 250px !important;
  border-radius: 50% !important;
  top: 100% !important;
  left: 100% !important;
  transition: all 0.7s !important;
}

.sidebar a:hover, aside a:hover, #sidebar a:hover {
  color: #fff !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  background: transparent !important;
}

.sidebar a:hover:before, aside a:hover:before, #sidebar a:hover:before {
  top: -50px !important;
  left: -50px !important;
}

.sidebar a:active:before, aside a:active:before, #sidebar a:active:before {
  background: #4f46e5 !important;
  transition: background 0s !important;
}

/* Active link */
.sidebar a.active, aside a.active, #sidebar a.active, .sidebar .active, aside .active {
  color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.08) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
}

.sidebar a.active:before, aside a.active:before, #sidebar a.active:before, .sidebar .active:before, aside .active:before {
  display: none !important;
}

.sidebar a.active:hover, aside a.active:hover, #sidebar a.active:hover, .sidebar .active:hover, aside .active:hover {
  color: #fff !important;
}

.sidebar a.active:hover:before, aside a.active:hover:before, #sidebar a.active:hover:before, .sidebar .active:hover:before, aside .active:hover:before {
  display: block !important;
  top: -50px !important;
  left: -50px !important;
}

/* Nav section titles (admin two-section sidebar) */
aside .nav-section-title,
.sidebar .nav-section-title,
#sidebar .nav-section-title {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  padding: 0.85rem 1rem 0.2rem !important;
  margin: 0 !important;
  display: block !important;
  pointer-events: none !important;
}

/* 3. GLASSMORPHISM CARDS */
.card,
.stat-card,
.metric-card,
.profile-header,
.info-section,
.chat-container,
.tutor-sidebar,
.exam-container,
.settings-card,
.lesson-card,
[class*="card"],
.students-table-container,
.recent-activity,
.chart-container,
.dashboard-card {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(99, 102, 241, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  color: #1e293b !important;
}

/* Add colored top border to stat cards */
.stat-card:nth-child(1),
.metric-card:nth-child(1) {
  border-top: 2px solid #6366f1 !important;
}

.stat-card:nth-child(2),
.metric-card:nth-child(2) {
  border-top: 2px solid #22c55e !important;
}

.stat-card:nth-child(3),
.metric-card:nth-child(3) {
  border-top: 2px solid #f59e0b !important;
}

.stat-card:nth-child(4),
.metric-card:nth-child(4) {
  border-top: 2px solid #a855f7 !important;
}

.card:hover,
.stat-card:hover,
.metric-card:hover,
.lesson-card:hover,
[class*="card"]:hover {
  transform: translateY(-4px) !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 16px 48px rgba(99, 102, 241, 0.12),
    0 0 0 1px rgba(99, 102, 241, 0.1) !important;
  transition: all 0.3s ease !important;
}

.card h1,
.card h2,
.card h3,
.card h4,
.stat-card h3,
.metric-card h3 {
  color: #1e293b !important;
}

.card p,
.card label,
.stat-card p,
.metric-card p,
.card div {
  color: #475569 !important;
}

/* 4. GRADIENT BUTTONS */
button,
.btn,
.btn-primary,
button[class*="btn-primary"],
button.primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
  border: none !important;
  border-radius: 10px !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5) !important;
  transition: all 0.3s ease !important;
  cursor: pointer;
}

button:hover,
.btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6) !important;
}

.btn-danger,
.btn-logout,
[onclick*="delete"],
[onclick*="logout"],
.delete-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4) !important;
  color: white !important;
}

.btn-success,
[onclick*="save"],
[onclick*="submit"],
[type="submit"],
[onclick*="pay"] {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4) !important;
  color: white !important;
}

/* 5. GLASSMORPHISM TABLES */
.table-container,
table {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(99, 102, 241, 0.12) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  color: #1e293b !important;
  width: 100%;
}

table th,
th {
  color: #64748b !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  border-bottom: 1px solid rgba(99, 102, 241, 0.1) !important;
  background: transparent !important;
}

table tr,
tr {
  border-bottom: 1px solid rgba(99, 102, 241, 0.05) !important;
}

table tr:hover,
tr:hover,
tbody tr:hover {
  background: rgba(99, 102, 241, 0.04) !important;
}

table td,
td {
  color: #1e293b !important;
  border-bottom: none !important;
  border-color: rgba(99, 102, 241, 0.08) !important;
  background: transparent !important;
}

/* 6. GLASSMORPHISM MODALS */
.modal,
.modal-content,
[class*="modal"] {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(99, 102, 241, 0.15) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 64px rgba(99, 102, 241, 0.15) !important;
  color: #1e293b !important;
}

.modal-overlay,
.modal-backdrop {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(8px) !important;
}

/* 7. FORM INPUTS */
input,
select,
textarea {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(99, 102, 241, 0.2) !important;
  border-radius: 10px !important;
  color: #1e293b !important;
  backdrop-filter: blur(8px) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  outline: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8 !important;
}

option {
  background: #ffffff !important;
  color: #1e293b !important;
}

/* 8. STATUS BADGES */
.badge-active,
.badge-pagado,
.status-active,
.status-paid,
.badge:contains('Activo'),
.badge:contains('Pagado') {
  background: rgba(34, 197, 94, 0.1) !important;
  color: #15803d !important;
  border: 1px solid rgba(34, 197, 94, 0.2) !important;
}

.badge-risk,
.badge-vencido,
.status-risk,
.status-overdue,
.badge:contains('En Riesgo'),
.badge:contains('Vencido') {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #b91c1c !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

.badge-inactive,
.status-inactive,
.badge:contains('Inactivo') {
  background: rgba(148, 163, 184, 0.1) !important;
  color: #475569 !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.badge-pendiente,
.status-pending,
.badge:contains('Pendiente') {
  background: rgba(251, 191, 36, 0.1) !important;
  color: #b45309 !important;
  border: 1px solid rgba(251, 191, 36, 0.2) !important;
}

/* 9. LOGIN PAGE REDESIGN */
.auth-container {
  background: transparent !important;
  box-shadow: none !important;
}

.auth-left {
  background: transparent !important;
}

.auth-left h1,
.auth-left p,
.auth-left li {
  color: white !important;
}

.auth-right {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(99, 102, 241, 0.15) !important;
  border-radius: 24px !important;
}

.role-card {
  background: rgba(255, 255, 255, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(99, 102, 241, 0.15) !important;
  transition: all 0.3s ease !important;
  color: #1e293b !important;
}

.role-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.1) !important;
  background: rgba(255, 255, 255, 1) !important;
}

.role-card.active {
  border: 2px solid #6366f1 !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2) !important;
}

/* 10. SCROLLBAR STYLING */
::-webkit-scrollbar {
  width: 6px !important;
}

::-webkit-scrollbar-track {
  background: rgba(99, 102, 241, 0.05) !important;
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3) !important;
  border-radius: 3px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5) !important;
}

/* Text colors overrides globally */
h1,
h2,
h3,
h4,
h5,
h6,
strong {
  color: #1e293b !important;
}

.text-muted,
.text-gray-500,
[style*="color: #64748b"],
[style*="color: rgb(100, 116, 139)"] {
  color: #64748b !important;
}

/* Remove specific inline colors */
[style*="background: white"],
[style*="background: #ffffff"],
[style*="background-color: white"] {
  background: transparent !important;
}

[style*="background-color: var(--card-bg)"],
[style*="background: var(--card-bg)"] {
  background: transparent !important;
}

[style*="color: #1e293b"] {
  color: #1e293b !important;
}
/* LOGOUT BUTTON UIVERSE */
.Btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 45px !important;
  height: 45px !important;
  border: none !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
  transition-duration: .3s !important;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199) !important;
  background-color: rgb(255, 65, 65) !important;
  margin: 16px auto !important;
  padding: 0 !important;
}

.sign {
  width: 100% !important;
  transition-duration: .3s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sign svg {
  width: 17px !important;
  fill: white !important;
}

.text {
  position: absolute !important;
  right: 0% !important;
  width: 0% !important;
  opacity: 0 !important;
  color: white !important;
  font-size: 1em !important;
  font-weight: 600 !important;
  transition-duration: .3s !important;
  white-space: nowrap !important;
}

.Btn:hover {
  width: 130px !important;
  border-radius: 40px !important;
  transition-duration: .3s !important;
}

.Btn:hover .sign {
  width: 30% !important;
  padding-left: 12px !important;
  transition-duration: .3s !important;
}

.Btn:hover .text {
  opacity: 1 !important;
  width: 70% !important;
  padding-right: 12px !important;
  transition-duration: .3s !important;
}

.Btn:active {
  transform: translate(2px, 2px) !important;
}


/* PENCIL LOADING ANIMATION */
.pencil {
  display: block;
  width: 10em;
  height: 10em;
}

.pencil__body1,
.pencil__body2,
.pencil__body3,
.pencil__eraser,
.pencil__eraser-skew,
.pencil__point,
.pencil__stroke {
  animation-duration: 3s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.pencil__body1,
.pencil__body2,
.pencil__body3 { transform: rotate(-90deg); }

.pencil__body1 { animation-name: pencilBody1; }
.pencil__body2 { animation-name: pencilBody2; }
.pencil__body3 { animation-name: pencilBody3; }
.pencil__eraser { animation-name: pencilEraser; transform: rotate(-90deg) translate(49px,0); }
.pencil__eraser-skew { animation-name: pencilEraserSkew; animation-timing-function: ease-in-out; }
.pencil__point { animation-name: pencilPoint; transform: rotate(-90deg) translate(49px,-30px); }
.pencil__stroke { animation-name: pencilStroke; transform: translate(100px,100px) rotate(-113deg); }

@keyframes pencilBody1 {
  from, to { stroke-dashoffset: 351.86; transform: rotate(-90deg); }
  50% { stroke-dashoffset: 150.8; transform: rotate(-225deg); }
}
@keyframes pencilBody2 {
  from, to { stroke-dashoffset: 406.84; transform: rotate(-90deg); }
  50% { stroke-dashoffset: 174.36; transform: rotate(-225deg); }
}
@keyframes pencilBody3 {
  from, to { stroke-dashoffset: 296.88; transform: rotate(-90deg); }
  50% { stroke-dashoffset: 127.23; transform: rotate(-225deg); }
}
@keyframes pencilEraser {
  from, to { transform: rotate(-45deg) translate(49px,0); }
  50% { transform: rotate(0deg) translate(49px,0); }
}
@keyframes pencilEraserSkew {
  from, 32.5%, 67.5%, to { transform: skewX(0); }
  35%, 65% { transform: skewX(-4deg); }
  37.5%, 62.5% { transform: skewX(8deg); }
  40%, 45%, 50%, 55%, 60% { transform: skewX(-15deg); }
  42.5%, 47.5%, 52.5%, 57.5% { transform: skewX(15deg); }
}
@keyframes pencilPoint {
  from, to { transform: rotate(-90deg) translate(49px,-30px); }
  50% { transform: rotate(-225deg) translate(49px,-30px); }
}
@keyframes pencilStroke {
  from { stroke-dashoffset: 439.82; transform: translate(100px,100px) rotate(-113deg); }
  50% { stroke-dashoffset: 164.93; transform: translate(100px,100px) rotate(-113deg); }
  75%, to { stroke-dashoffset: 439.82; transform: translate(100px,100px) rotate(112deg); }
}

/* LOADING OVERLAY */
.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.loading-overlay p {
  margin-top: 1rem;
  color: #6366f1;
  font-weight: 600;
  font-size: 1rem;
}

/* ===== MOBILE NAVIGATION ===== */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  color: #6366f1;
  flex-shrink: 0;
  z-index: 150;
}
.hamburger-btn:hover {
  background: rgba(99, 102, 241, 0.2);
}
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 190;
  backdrop-filter: blur(2px);
}
.mobile-nav-overlay.active {
  display: block;
}
@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex !important;
  }
  aside {
    transform: translateX(-100%) !important;
    display: flex !important;
    transition: transform 0.3s ease !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    z-index: 200 !important;
  }
  aside.mobile-open {
    transform: translateX(0) !important;
  }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.625rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: auto;
  max-width: 380px;
}
.toast.show {
  opacity: 1;
  transform: translateX(0);
}
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.info    { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.toast.warning { background: #f59e0b; color: #1a1a1a; }

/* ===== USER AVATAR ===== */
.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0;
  margin-bottom: 0.25rem;
}
.sidebar-avatar.admin   { background: linear-gradient(135deg, #7c3aed, #6366f1); }
.sidebar-avatar.teacher { background: linear-gradient(135deg, #059669, #10b981); }
.sidebar-avatar.student { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
}
.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}
.sidebar-user-role {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: capitalize;
}

/* ===== FOCUS RINGS (accessibility) ===== */
a:focus-visible,
button:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35) !important;
  border-radius: 0.25rem;
}
input:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35) !important;
}
