/* ==========================================================================
   ACADEMICA BADGE — Premium Co-Branding Signature
   "Powered by Academica"
   Clean, modern, glassmorphic pill badge with subtle shimmer & glowing dot
   Compatible with light and dark dashboard surfaces
   ========================================================================== */

/* Ensure sidebars with flex column layout accommodate bottom badge */
@media (min-width: 993px) {
  .sidebar {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    height: 100vh !important;
  }
}

/* Sidebar logo layout avec co-branding intégré en haut */
.sidebar .logo {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  padding: 0 20px 18px !important;
  margin-bottom: 22px !important;
  border-bottom: 1px solid var(--gray-medium) !important;
  gap: 10px !important;
}

.sidebar .logo .logo-main-row {
  display: flex;
  align-items: center;
}

/* Sidebar header container (dans le logo, bien au-dessus de Inicio/Dashboard) */
.academica-sidebar-header-badge {
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.academica-sidebar-header-badge .academica-badge {
  width: 100%;
  justify-content: center;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%);
  border: 1px solid rgba(203, 213, 225, 0.7);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

/* Sidebar footer container */
.academica-sidebar-footer {
  margin-top: auto;
  padding: 12px 10px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

/* Login page footer container */
.academica-login-footer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Master Badge */
.academica-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
  border: 1px solid rgba(203, 213, 225, 0.85);
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  max-width: fit-content;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.25s ease;
}

/* Dynamic Glossy Shimmer */
.academica-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-20deg);
  animation: academicaShimmer 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes academicaShimmer {
  0%, 70% { left: -120%; }
  100% { left: 160%; }
}

/* Hover & Active States */
.academica-badge:hover {
  transform: translateY(-1.5px);
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 6px 18px -2px rgba(22, 163, 74, 0.16), 0 2px 6px rgba(0, 0, 0, 0.04);
}

.academica-badge:active {
  transform: translateY(0);
}

/* Pulsing Emerald Indicator Dot */
.academica-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2), 0 0 8px rgba(34, 197, 94, 0.7);
  flex-shrink: 0;
  animation: academicaDotPulse 2.4s ease-in-out infinite;
}

@keyframes academicaDotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2), 0 0 6px rgba(34, 197, 94, 0.6);
  }
  50% {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1), 0 0 12px rgba(34, 197, 94, 0.9);
  }
}

/* Badge Typography */
.academica-badge-text {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: #475569;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3.5px;
  line-height: 1;
}

.academica-brand-name {
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.academica-badge:hover .academica-brand-name {
  color: #16a34a;
}

/* Subtle Arrow Icon */
.academica-badge-arrow {
  color: #94a3b8;
  flex-shrink: 0;
  opacity: 0.7;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.academica-badge:hover .academica-badge-arrow {
  opacity: 1;
  color: #16a34a;
  transform: translate(1px, -1px);
}

/* Dark Theme Support */
[data-theme="dark"] .academica-badge,
.theme-dark .academica-badge,
.dark .academica-badge,
body.dark-mode .academica-badge {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.92) 0%, rgba(15, 23, 42, 0.92) 100%);
  border-color: rgba(71, 85, 105, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .academica-badge:hover,
.theme-dark .academica-badge:hover,
.dark .academica-badge:hover,
body.dark-mode .academica-badge:hover {
  background: linear-gradient(135deg, rgba(30, 41, 59, 1) 0%, rgba(20, 83, 45, 0.4) 100%);
  border-color: rgba(34, 197, 94, 0.6);
}

[data-theme="dark"] .academica-badge-text,
.theme-dark .academica-badge-text,
.dark .academica-badge-text,
body.dark-mode .academica-badge-text {
  color: #94a3b8;
}

[data-theme="dark"] .academica-brand-name,
.theme-dark .academica-brand-name,
.dark .academica-brand-name,
body.dark-mode .academica-brand-name {
  color: #f8fafc;
}

[data-theme="dark"] .academica-badge:hover .academica-brand-name,
.theme-dark .academica-badge:hover .academica-brand-name,
.dark .academica-badge:hover .academica-brand-name,
body.dark-mode .academica-badge:hover .academica-brand-name {
  color: #4ade80;
}

/* Responsive adjustment (preserve visibility on tablet / mobile) */
@media (max-width: 1024px) {
  .academica-sidebar-footer {
    padding: 8px 6px;
  }
  .academica-badge {
    padding: 5px 12px;
  }
  .academica-badge-text {
    font-size: 0.68rem;
  }
}
