/* =============================================
   Header FACILTECH
   Dropdown del avatar y elementos del nav.

   Sin directivas @tailwind: base/components/utilities ya vienen
   en theme.css (carga global). Este bundle solo aporta componentes
   (CSS plano, sin @layer: los selectores ft-* no compiten con utilities).
   ============================================= */

/* Avatar dropdown del header — usado en desktop y mobile */
  .ft-header-avatar-menu {
    position: relative;
  }
  .ft-header-avatar-menu__toggle {
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
  }
  .ft-header-avatar-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    z-index: 60;
    flex-direction: column;
  }
  .ft-header-avatar-menu__dropdown.is-open {
    display: flex;
  }
  .ft-header-avatar-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #1A1A1A;
    text-decoration: none;
    min-height: 48px;
    transition: background-color 150ms ease;
  }
  .ft-header-avatar-menu__item:hover {
    background: #F5F5F5;
    text-decoration: none;
    color: #1A1A1A;
  }
  .ft-header-avatar-menu__item .bi {
    font-size: 1.125rem;
    color: #6B6B6B;
    flex-shrink: 0;
  }
  .ft-header-avatar-menu__item--logout {
    color: #DC2626;
  }
  .ft-header-avatar-menu__item--logout:hover {
    background: rgba(220, 38, 38, 0.06);
    color: #DC2626;
  }
  .ft-header-avatar-menu__item--logout .bi {
    color: #DC2626;
  }
  .ft-header-avatar-menu__sep {
    border: none;
    border-top: 1px solid #E5E5E5;
    margin: 0.25rem 0.75rem;
  }

  /* Saldo de tokens: pill naranja claro con moneda naranja y monto oscuro */
  .ft-header-avatar-menu__item--tokens .ft-header-avatar-menu__tokens {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFF7ED;
    color: #1A1A1A;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
  }

  .ft-header-avatar-menu__item--tokens .bi {
    color: #FF6A00;
    font-size: 0.875rem;
  }

  /* =============================================
     Aula — submenú propio del header (Cursos / IA / Diagramas)
     ============================================= */

  .ft-aula-menu {
    position: relative;
  }

  /* Puente invisible desde el botón: cubre el hueco hacia el dropdown
     para que el hover no se pierda al mover el mouse (vive en el botón,
     que siempre está visible, no en el dropdown oculto) */
  .ft-aula-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
  }

  .ft-aula-menu__toggle::after {
    content: '';
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.55;
  }

  .ft-aula-menu__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 0.75rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    flex-direction: column;
    z-index: 60;
  }

  .ft-aula-menu:hover .ft-aula-menu__dropdown,
  .ft-aula-menu:focus-within .ft-aula-menu__dropdown {
    display: flex;
  }

  .ft-aula-menu__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1A1A1A;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
  }

  .ft-aula-menu__item:hover {
    background: #F5F5F5;
    color: #1A1A1A;
    text-decoration: none;
  }

  .ft-aula-menu__item .bi {
    font-size: 1rem;
    color: #6B6B6B;
    flex-shrink: 0;
  }

  /* Sub-enlaces de Aula en el menú móvil: apilados e indentados */
  .ft-mobile-aula-sub {
    padding-left: 2rem !important;
  }

  .ft-mobile-aula-sub .bi {
    font-size: 0.9rem;
  }

  /* Botón flotante de acceso rápido al escritorio (solo admins, frontend).
     El hover vive en CSS para no usar handlers inline (compatibilidad CSP). */
  .ft-admin-float-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 99999;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FF6A00;
    color: #1A1A1A;
    font-size: 16px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s;
  }

  .ft-admin-float-btn:hover {
    transform: scale(1.1);
  }
