/* ========================================================================
   SISTEMA DE NAVEGACIÓN RESPONSIVE - Compatible con styles.css
   ======================================================================== */

/* Variables adicionales para navegación - MOBILE EXPERT - EM/REM */
:root {
  --header-height: 4rem;
  --bottom-nav-height: 4rem;
  --z-header: 1000;
  --z-bottom-nav: 999;
  --z-overlay: 1100;
  --z-mobile-nav: 1200;
  --drawer-width: 85%;
  --drawer-max-width: 22.5rem;
}

/* Utilidades responsive */
.hide-mobile {
  display: block;
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none;
  }
}

.hide-desktop {
  display: none;
}

@media (max-width: 767px) {
  .hide-desktop {
    display: block;
  }
}

/* ========================================================================
   HEADER PRINCIPAL - MOBILE OPTIMIZED PRO
   ======================================================================== */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--bg-primary);
  border-bottom: 0.0625rem solid var(--border);
  backdrop-filter: blur(1.25rem);
  -webkit-backdrop-filter: blur(1.25rem);
  z-index: var(--z-header);
  transition: transform 0.3s ease;
  will-change: transform;
}

/* Header shadow on scroll */
.main-header.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  height: var(--header-height);
  max-width: 1400px;
  margin: 0 auto;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .header-container {
    padding: 0 1rem;
    gap: 0.75rem;
  }
}

@media (min-width: 768px) {
  .header-container {
    padding: 0 1.5rem;
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .header-container {
    padding: 0 2rem;
  }
}

/* NO padding-top en body - el contenido debe empezar debajo del navbar fixed */
body {
  padding-top: 0;
}

@media (max-width: 1023px) {
  body {
    padding-bottom: var(--bottom-nav-height);
  }
}

/* ========================================================================
   BRAND - MOBILE FIRST OPTIMIZED
   ======================================================================== */
.header-brand {
  flex-shrink: 0;
  min-width: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.9375rem;
  white-space: nowrap;
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  transition: all 0.3s ease;
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

@media (min-width: 640px) {
  .brand-link {
    gap: 0.625rem;
    font-size: 1.125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
  }
}

@media (min-width: 768px) {
  .brand-link {
    gap: 0.75rem;
    font-size: 1.25rem;
    padding: 0.5rem 1rem;
  }
}

.brand-link:hover {
  background: rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.3));
}

@media (min-width: 640px) {
  .brand-icon {
    width: 32px;
    height: 32px;
  }
}

@media (min-width: 768px) {
  .brand-icon {
    width: 36px;
    height: 36px;
  }
}

.brand-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  font-weight: 800;
}

/* Hide brand text on very small screens */
@media (max-width: 360px) {
  .brand-text {
    display: none;
  }
}

/* ========================================================================
   NAVEGACIÓN DESKTOP
   ======================================================================== */
.desktop-nav {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
    justify-content: center;
  }
}

@media (min-width: 1200px) {
  .desktop-nav {
    gap: 1.5rem;
  }
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1200px) {
  .nav-group {
    gap: 1rem;
  }
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1200px) {
  .nav-primary {
    gap: 1rem;
  }
}

.nav-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1200px) {
  .nav-secondary {
    gap: 1rem;
  }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .nav-item {
    padding: 0.5rem 1rem;
  }
}

.nav-item:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.nav-item.active {
  color: var(--primary);
  background: var(--bg-secondary);
}

.nav-item i,
.nav-item svg {
  width: 18px;
  height: 18px;
}

/* ========================================================================
   DROPDOWN NAVIGATION - MODERN
   ======================================================================== */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  cursor: pointer;
  background: none;
  border: none;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .nav-dropdown-toggle {
    padding: 0.5rem 1rem;
  }
}

.nav-dropdown-toggle:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.nav-dropdown-toggle i,
.nav-dropdown-toggle svg {
  width: 18px;
  height: 18px;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  min-width: 220px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem;
  backdrop-filter: blur(10px);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.active .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  font-size: 0.875rem;
  border-radius: 8px;
  font-weight: 500;
}

.nav-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.nav-dropdown-item i,
.nav-dropdown-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
  margin: 0.5rem 0;
}

/* ========================================================================
   HEADER ACTIONS & USER INFO - MOBILE FIRST
   ======================================================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
  min-width: 0;
}

@media (min-width: 640px) {
  .header-actions {
    gap: 0.5rem;
  }
}

@media (min-width: 768px) {
  .header-actions {
    gap: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .header-actions {
    gap: 1rem;
  }
}

/* Desktop User Info Simple - Clickeable */
/* User Dropdown Container */
.user-dropdown {
  position: relative;
  display: none;
}

@media (min-width: 1024px) {
  .user-dropdown {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.desktop-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 9999px;
  min-width: 0;
  max-width: 220px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
}

.desktop-user-info:hover,
.user-dropdown.active .desktop-user-info {
  background: var(--bg-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

@media (min-width: 1200px) {
  .desktop-user-info {
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    max-width: 240px;
  }
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-gradient);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0;
}

.user-role {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-on-primary);
  align-self: flex-start;
}

.user-role.admin {
  background: var(--danger);
}

.user-role.docente {
  background: var(--primary);
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Dropdown Menu */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  min-width: 280px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0.5rem;
  backdrop-filter: blur(10px);
}

.user-dropdown:hover .user-dropdown-menu,
.user-dropdown.active .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.user-avatar-large {
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.user-info-detailed {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.user-info-detailed strong {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info-detailed small {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge {
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-on-primary);
  align-self: flex-start;
  margin-top: 0.125rem;
}

.user-badge.admin {
  background: var(--danger);
}

.user-badge.docente {
  background: var(--primary);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  font-size: 0.875rem;
  border-radius: 8px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

.user-dropdown-item.logout {
  color: var(--danger);
}

.user-dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.user-dropdown-item i,
.user-dropdown-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

/* Desktop Logout Button Simple - Ya no se usa */
.desktop-logout {
  display: none;
}

.desktop-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--danger);
  border-radius: 9999px;
  color: var(--danger);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.desktop-logout-btn:hover {
  background: var(--danger);
  color: var(--text-on-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.desktop-logout-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.desktop-logout-btn i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.logout-text {
  font-weight: 500;
}

@media (max-width: 1200px) {
  .logout-text {
    display: none;
  }
}

/* ========================================================================
   GUEST AUTH BUTTONS - RESPONSIVE (FALLBACK + NEW SYSTEM)
   ======================================================================== */

/* FALLBACK: Para HTML antiguo (botones sin clases desktop/mobile) */
@media (max-width: 767px) {
  /* Reducir gap entre elementos en header-actions */
  .header-actions {
    gap: 0.25rem !important;
  }

  /* Ocultar texto de botones en móvil */
  .header-actions .btn span {
    display: none !important;
  }

  /* Hacer botones compactos solo ícono */
  .header-actions .btn {
    padding: 0.5rem !important;
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    gap: 0 !important;
    border-radius: 8px !important;
  }

  .header-actions .btn svg,
  .header-actions .btn i {
    width: 18px !important;
    height: 18px !important;
    margin: 0 !important;
  }

  /* Theme toggle más compacto */
  .theme-toggle {
    width: 36px !important;
    height: 36px !important;
    padding: 0.5rem !important;
  }

  .theme-toggle svg,
  .theme-toggle i {
    width: 18px !important;
    height: 18px !important;
  }

  /* Mobile menu button */
  .mobile-menu-btn {
    width: 36px !important;
    height: 36px !important;
  }
}

@media (max-width: 360px) {
  .header-actions {
    gap: 0.125rem !important;
  }

  .header-actions .btn {
    padding: 0.375rem !important;
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
  }

  .header-actions .btn svg,
  .header-actions .btn i {
    width: 16px !important;
    height: 16px !important;
  }

  .theme-toggle {
    width: 32px !important;
    height: 32px !important;
    padding: 0.375rem !important;
  }

  .theme-toggle svg,
  .theme-toggle i {
    width: 16px !important;
    height: 16px !important;
  }

  .mobile-menu-btn {
    width: 32px !important;
    height: 32px !important;
  }
}

/* SISTEMA NUEVO: Botones desktop/mobile separados */
/* Desktop: Botones completos con texto */
.guest-auth-buttons-desktop {
  display: none;
  gap: 0.5rem;
  align-items: center;
}

@media (min-width: 768px) {
  .guest-auth-buttons-desktop {
    display: flex;
  }
}

.guest-auth-buttons-desktop .btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.guest-auth-buttons-desktop .btn i {
  width: 18px;
  height: 18px;
}

.guest-auth-buttons-desktop .btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.guest-auth-buttons-desktop .btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.guest-auth-buttons-desktop .btn-primary {
  background: var(--primary-gradient);
  border: none;
  color: var(--text-on-primary);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.guest-auth-buttons-desktop .btn-primary:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

/* Mobile: Solo iconos compactos */
.guest-auth-buttons-mobile {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

@media (min-width: 768px) {
  .guest-auth-buttons-mobile {
    display: none;
  }
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}

@media (max-width: 360px) {
  .btn-icon {
    width: 32px;
    height: 32px;
  }
}

.btn-icon i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 360px) {
  .btn-icon i {
    width: 16px;
    height: 16px;
  }
}

.btn-icon-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.btn-icon-outline:hover,
.btn-icon-outline:active {
  background: var(--bg-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon-primary {
  background: var(--primary-gradient);
  border: none;
  color: var(--text-on-primary);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.btn-icon-primary:hover,
.btn-icon-primary:active {
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
  transform: translateY(-1px);
}

/* ========================================================================
   MOBILE MENU BUTTON - COMPACT
   ======================================================================== */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 3px;
  padding: 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    gap: 3.5px;
  }
}

@media (min-width: 768px) {
  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    gap: 4px;
  }
}

/* Ocultar botón hamburguesa en desktop */
@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Ocultar botón hamburguesa en móvil cuando bottom tabs están visibles */
@media (max-width: 1023px) {
  .mobile-menu-btn {
    display: none !important;
  }
}

.burger-line {
  width: 18px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  border-radius: 1px;
}

@media (min-width: 640px) {
  .burger-line {
    width: 20px;
  }
}

.mobile-nav-open .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-nav-open .burger-line:nth-child(2) {
  opacity: 0;
}

.mobile-nav-open .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ========================================================================
   MOBILE NAVIGATION - DRAWER PROFESIONAL
   ======================================================================== */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--drawer-width);
  max-width: var(--drawer-max-width);
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height para iOS */
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-mobile-nav);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none;
  }
}

.mobile-nav-open .mobile-nav {
  transform: translateX(0);
}

/* Prevent body scroll when nav is open */
body.mobile-nav-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Header del drawer con botón cerrar */
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.mobile-nav-header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon-mobile {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
}

.brand-icon-mobile i {
  width: 28px;
  height: 28px;
}

.mobile-nav-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-on-primary);
}

.mobile-nav-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--text-on-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.mobile-nav-close i {
  width: 24px;
  height: 24px;
}

.mobile-nav-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  padding-bottom: max(env(safe-area-inset-bottom, 16px), 1.25rem);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  gap: 1rem;
}

/* Hide scrollbar but keep functionality */
.mobile-nav-content::-webkit-scrollbar {
  width: 4px;
}

.mobile-nav-content::-webkit-scrollbar-track {
  background: transparent;
}

.mobile-nav-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.mobile-nav-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.mobile-user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
  text-decoration: none;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
}

.mobile-user-profile:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
}

.mobile-user-profile .profile-chevron {
  margin-left: auto;
  width: 20px;
  height: 20px;
  color: var(--text-on-primary);
  opacity: 0.6;
}

.user-details h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-on-primary);
}

.user-details p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.mobile-menu-section {
  flex-shrink: 0;
}

.mobile-menu-section h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-on-primary);
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
  background: transparent;
  border: 1px solid transparent;
}

.mobile-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.mobile-nav-item.featured {
  background: var(--primary-gradient);
  color: var(--text-on-primary);
}

.mobile-nav-item.scanner {
  background: var(--secondary-gradient);
  color: var(--text-on-primary);
}

.mobile-nav-item.admin {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: var(--text-on-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-nav-item.admin:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateX(4px);
}

.mobile-nav-item.logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: var(--danger);
}

.mobile-nav-item.logout:hover {
  background: #ef4444;
  border-color: #dc2626;
  color: var(--text-on-primary);
  transform: translateX(4px);
}

.mobile-nav-item i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Mobile Overlay - Cubre navbar también */
.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: var(--z-overlay);
  pointer-events: none;
}

.mobile-nav-open .mobile-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ========================================================================
   HIGHLIGHT STYLES (Navbar)
   ======================================================================== */
.nav-item.scanner-highlight {
  background: linear-gradient(135deg, #0ea5e9, #0891b2);
  color: var(--text-on-primary);
  font-weight: 600;
}

.nav-item.scanner-highlight:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.nav-item.admin-highlight {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: var(--text-on-primary);
  font-weight: 600;
}

.nav-item.admin-highlight:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ========================================================================
   BOTTOM TAB NAVIGATION (Mobile) - PROFESSIONAL & COMPACT
   ======================================================================== */
.bottom-tab-nav {
  display: none;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-top: 0.0625rem solid var(--border);
  padding: 0.25rem 0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 0.25rem);
  z-index: var(--z-bottom-nav);
  box-shadow: 0 -0.125rem 1rem rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(1.25rem);
  -webkit-backdrop-filter: blur(1.25rem);
  margin-top: auto;
}

@media (max-width: 1023px) {
  .bottom-tab-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 0;
  }
}

.bottom-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  padding: 0.375rem 0.125rem;
  text-decoration: none;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
  min-width: 48px;
  flex: 1;
  max-width: 76px;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (min-width: 640px) {
  .bottom-tab-item {
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    min-width: 56px;
    max-width: 84px;
    border-radius: 12px;
  }
}

.bottom-tab-item i {
  width: 22px;
  height: 22px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .bottom-tab-item i {
    width: 24px;
    height: 24px;
  }
}

.bottom-tab-item span {
  font-size: 0.625rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (min-width: 640px) {
  .bottom-tab-item span {
    font-size: 0.6875rem;
  }
}

.bottom-tab-item:hover {
  color: var(--primary);
  background: var(--bg-secondary);
}

.bottom-tab-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.bottom-tab-item.active i {
  transform: scale(1.1);
}

/* Scanner Tab Highlight */
.bottom-tab-item.scanner-tab {
  background: linear-gradient(135deg, #0ea5e9, #0891b2);
  color: var(--text-on-primary);
  font-weight: 600;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.bottom-tab-item.scanner-tab:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  transform: scale(1.08);
}

.bottom-tab-item.scanner-tab i {
  width: 24px;
  height: 24px;
}

.bottom-tab-item.scanner-tab::before {
  display: none;
}

/* Menu Tab Button */
.bottom-tab-item.menu-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.bottom-tab-item.menu-tab:hover {
  background: var(--bg-secondary);
}

.bottom-tab-item.menu-tab.active {
  color: var(--primary);
}

/* Content spacing adjustments */
@media (max-width: 1023px) {
  .dashboard-container,
  .content-wrapper,
  main {
    padding-bottom: 1.5rem;
  }
}

/* ========================================================================
   RESPONSIVE ADJUSTMENTS - MOBILE FIRST
   ======================================================================== */

/* Very small screens - Ultra compact */
@media (max-width: 360px) {
  .header-container {
    padding: 0 0.5rem !important;
    gap: 0.25rem !important;
  }

  .header-actions {
    gap: 0.125rem !important;
  }

  .guest-auth-buttons-mobile {
    gap: 0.125rem !important;
  }

  /* Brand más compacto */
  .brand-link {
    padding: 0.25rem 0.375rem !important;
    gap: 0.375rem !important;
  }

  .brand-icon {
    width: 24px !important;
    height: 24px !important;
  }

  /* Ocultar texto del brand en pantallas muy pequeñas */
  .brand-text {
    display: none !important;
  }

  .bottom-tab-item {
    min-width: 42px;
    max-width: 64px;
    padding: 0.25rem 0.125rem;
  }

  .bottom-tab-item i {
    width: 20px;
    height: 20px;
  }

  .bottom-tab-item span {
    font-size: 0.5625rem;
  }

  .bottom-tab-item.scanner-tab i {
    width: 20px;
    height: 20px;
  }
}

/* Small phones - Compact */
@media (min-width: 361px) and (max-width: 480px) {
  .header-container {
    padding: 0 0.625rem !important;
    gap: 0.375rem !important;
  }

  .header-actions {
    gap: 0.25rem !important;
  }

  .brand-link {
    padding: 0.25rem 0.5rem !important;
  }

  .bottom-tab-item {
    min-width: 46px;
    max-width: 72px;
  }

  .bottom-tab-item i {
    width: 21px;
    height: 21px;
  }

  .bottom-tab-item.scanner-tab i {
    width: 21px;
    height: 21px;
  }
}

/* Standard mobile phones */
@media (min-width: 481px) and (max-width: 767px) {
  .header-container {
    padding: 0 0.75rem !important;
    gap: 0.5rem !important;
  }

  .header-actions {
    gap: 0.375rem !important;
  }
}

/* Medium screens - Mostrar botones compactos si hace falta */
@media (min-width: 480px) and (max-width: 767px) {
  .guest-auth-buttons-mobile .btn-icon {
    width: 40px;
    height: 40px;
  }

  .guest-auth-buttons-mobile .btn-icon i {
    width: 20px;
    height: 20px;
  }
}

/* Tablets in mobile mode */
@media (min-width: 768px) and (max-width: 1023px) {
  .bottom-tab-item {
    padding: 0.625rem 0.75rem;
    gap: 0.375rem;
  }

  .bottom-tab-item i {
    width: 24px;
    height: 24px;
  }

  .bottom-tab-item span {
    font-size: 0.75rem;
  }

  .guest-auth-buttons-desktop .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
  }
}

@media (min-width: 1440px) {
  .header-container {
    padding: 0 3rem;
  }

  .desktop-nav {
    max-width: 800px;
    gap: 3rem;
  }
}