/* =========================
   NAVBAR GENERAL (INDEX/HOME)
========================= */

.header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  transition: all 0.25s ease;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.8rem;
  gap: 1.5rem;
}

.logo-container .logo {
  height: 56px;
  width: auto;
}

.navigation {
  display: flex;
  align-items: center;
}

/* ========= MENU PRINCIPAL ========= */

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.4rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--azul-petroleo);
  padding-block: 0.3rem;
  position: relative;
}

/* Línea animada debajo */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cian), #8ef9e5);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Botón login */
.login-btn {
  background: linear-gradient(135deg, var(--cian), #48e1cf);
  color: var(--blanco) !important;
  padding: 0.4rem 1.4rem !important;
  border-radius: 999px;
  box-shadow: 0 10px 25px rgba(52, 215, 196, 0.4);
}

/* =========================
   AVATAR / PERFIL
========================= */

/* Contenedor del item de usuario en la nav */
.nav-menu .user-menu {
  position: relative;
  margin-left: auto;             /* empuja a la derecha */
  display: flex;
  align-items: center;
  gap: 0.9rem;                   /* espacio entre user-info y acciones */
}

/* Nombre + avatar juntos */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Nombre de usuario */
.user-name {
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--azul-petroleo);
  line-height: 1;
}

/* Avatar bonito VetScanIA */
.user-avatar {
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  padding: 2px;
  background: radial-gradient(circle at 0 0, var(--cian), var(--azul-petroleo));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 12px 24px rgba(15, 23, 42, 0.25);
}

.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #ffffff;
}

.avatar-ring.avatar-initials {
  background: radial-gradient(circle at 0 0, var(--cian), #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-text {
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.avatar-status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--cian);
  border: 2px solid #ffffff;
}

/* Hover sutil */
.user-menu:hover .avatar-ring {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* =========================
   ACCIONES USUARIO / LOGOUT
========================= */

.user-actions {
  display: block;          /* en desktop, lo convertimos en bloque */
}

/* Botón Cerrar sesión rojo estilizado */
.logout-btn {
  background: linear-gradient(135deg, #EF4444, #b91c1c);
  border: none;
  border-radius: 999px;
  padding: 0.3rem 1rem;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.logout-btn:hover {
  filter: brightness(1.05);
}

/* En desktop, el link de Configuración dentro de user-actions NO se muestra (solo móvil) */
.user-config-mobile {
  display: none;
}

/* =========================
   DROPDOWN DEL AVATAR (DESKTOP)
========================= */

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.22);
  padding: 0.55rem 0;
  z-index: 2200;
  display: none;
}

.user-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-dropdown li a {
  display: block;
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--azul-petroleo);
  text-decoration: none;
  white-space: nowrap;
}

.user-dropdown li a:hover {
  background: #f1f5f9;
}

/* Clase que activa el dropdown (la pone el JS) */
.user-dropdown.open {
  display: block;
}

/* =========================
   UTILIDADES
========================= */

.hidden {
  display: none !important;
}

/* ====================================
   MENÚ MÓVIL VETSCANIA – PANEL LATERAL
==================================== */

@media (max-width: 768px) {

  .header .container {
    justify-content: space-between;
  }

  .mobile-menu-btn {
    display: block;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 2001;
  }

  /* Panel lateral */
  .nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 100px 25px 30px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s ease, opacity .25s ease;
    box-shadow: -4px 0 25px rgba(0,0,0,0.12);
    z-index: 2000;
  }

  .nav-menu.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-item {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    font-size: 1.2rem;
    padding: 10px 0;
    color: var(--azul-petroleo);
  }

  .nav-link::after {
    display: none;
  }

  /* Perfil arriba del panel lateral */
  .nav-menu .user-menu {
    order: -1;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.45);
    margin-left: 0;
    gap: 0.5rem;
  }

  .user-info {
    gap: 0.6rem;
  }

  .user-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Aquí sí mostramos el link Configuración dentro de user-actions */
  .user-config-mobile {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--azul-petroleo);
    text-decoration: none;
  }

  .user-config-mobile:hover {
    text-decoration: underline;
  }

  /* Dropdown no se usa en móvil */
  .user-dropdown {
    display: none !important;
  }
}

/* =========================
   RESET DESKTOP NAV
========================= */

@media (min-width: 769px) {

  .nav-menu {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    height: auto !important;
    width: auto !important;
    background: transparent !important;
    flex-direction: row !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .mobile-menu-btn {
    display: none !important;
  }
}

/* ==== FORZAR que el bloque de usuario se vaya a la derecha ===== */
@media (min-width: 769px) {

  .nav-menu {
    flex: 1;                    /* El menú ocupa todo el espacio disponible */
    display: flex;
    align-items: center;
  }

  .nav-menu .nav-item {
    flex-shrink: 0;             /* Los links no se comprimen */
  }

  .nav-menu .user-menu {
    margin-left: auto !important; /* SE VA HASTA LA DERECHA REAL */
    display: flex;
    align-items: center;
    gap: 1rem;
  }
}


