/* =============== VARIABLES ACTUALIZADAS =============== */
:root {
  --primary-glow: #6366f1;
  --secondary-glow: #8b5cf6;
  --glass-bg-light: rgba(255, 255, 255, 0.9);
  --glass-border-light: rgba(0, 0, 0, 0.08);
  --glass-bg-dark: rgba(15, 23, 42, 0.95);
  --glass-border-dark: rgba(99, 102, 241, 0.2);
  --text-light: #374151;
  --text-dark: #f8fafc;
}

/* =============== HEADER PROTECTOR ACTUALIZADO =============== */


/* =============== HEADER GENERAL =============== */

.header {
  position: fixed;
  top: 0.5rem;          
  left: 0;
  right: 0;
  z-index: 1100;
  margin-left: 0.9rem;
  margin-right: 0.6rem;
  padding-right: var(--gap);

  transition: padding-left .25s ease;
}

.header__container {
  height: 4.5rem;
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--glass-border-light);
 
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============== BOTÓN HAMBURGUESA =============== */
.header__toggle {
  font-size: 1.4rem;
  color: var(--text-light);
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid transparent;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.header__toggle:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--primary-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* =============== LOGO =============== */
.header__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.header__logo:hover {
  transform: scale(1.02);
}

.header__logo img {
  height: 60px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(1.1);
}

.logo--desktop { display: block; }
.logo--mobile  { display: none; }

/* =============== ACCIONES DE USUARIO =============== */
.header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

/* =============== BOTONES DE ACCIÓN =============== */
.header__button,
.header__user-toggle,
.header__notif-btn {
  font-size: 1.3rem;
  color: var(--text-light);
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid transparent;
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
}

.header__button:hover,
.header__user-toggle:hover,
.header__notif-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--primary-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

/* =============== NOTIFICACIONES =============== */
.header__notif-btn {
  position: relative;
}

#unseen_count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* =============== DROPDOWNS FUTURISTAS =============== */
.header__notif-dropdown,
.header__user-dropdown {
  background: var(--glass-bg-light);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-light);
  padding: 0.5rem 0;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 8px 32px rgba(99, 102, 241, 0.1);
  position: absolute;
  right: 0;
  top: 3.5rem;
  display: none;
  flex-direction: column;
  border-radius: 16px;
  z-index: 10;
  min-width: 280px;
  animation: dropdownSlide 0.3s ease;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.show-dropdown { 
  display: flex !important; 
}

/* Encabezados */
.header__notif-header,
.header__user-info {
  font-weight: 600;
  color: var(--text-light);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--glass-border-light);
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.header__user-info {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
}

/* Lista de notificaciones */
.header__notif-list {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  max-height: 200px;
  overflow-y: auto;
}

/* Enlaces */
.header__user-dropdown a,
.header__notif-more {
  padding: 0.875rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.header__user-dropdown a:hover,
.header__notif-more:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary-glow);
  transform: translateX(4px);
}

.header__user-dropdown i,
.header__notif-more i {
  font-size: 1.2rem;
  color: var(--primary-glow);
  transition: transform 0.3s ease;
}

.header__user-dropdown a:hover i,
.header__notif-more:hover i {
  transform: scale(1.1);
}

/* =============== DARK MODE =============== */
html.dark .header__container {
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border-dark);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html.dark .header__toggle,
html.dark .header__button,
html.dark .header__user-toggle,
html.dark .header__notif-btn {
  color: var(--text-dark);
  background: rgba(99, 102, 241, 0.1);
}

html.dark .header__toggle:hover,
html.dark .header__button:hover,
html.dark .header__user-toggle:hover,
html.dark .header__notif-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

html.dark .header__notif-dropdown,
html.dark .header__user-dropdown {
  background: var(--glass-bg-dark);
  border: 1px solid var(--glass-border-dark);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(99, 102, 241, 0.15);
}

html.dark .header__notif-header,
html.dark .header__user-info {
  color: var(--text-dark);
  border-color: var(--glass-border-dark);
}

html.dark .header__user-dropdown a,
html.dark .header__notif-more {
  color: var(--text-dark);
}

html.dark .header__user-dropdown a:hover,
html.dark .header__notif-more:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
}

html.dark .header__notif-list {
  color: #cbd5e1;
}

/* Scrollbar personalizada para dropdowns */
.header__notif-list::-webkit-scrollbar {
  width: 4px;
}

.header__notif-list::-webkit-scrollbar-track {
  background: transparent;
}

.header__notif-list::-webkit-scrollbar-thumb {
  background: var(--glass-border-light);
  border-radius: 2px;
}

.header__notif-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow);
}

html.dark .header__notif-list::-webkit-scrollbar-thumb {
  background: var(--glass-border-dark);
}

html.dark .header__notif-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow);
}

/* =============== RESPONSIVE =============== */
@media (max-width: 768px) {
  .header__container {
    padding: 0 1rem;
    height: 4rem;
  }
  
  .header__logo img {
    height: 50px;
    max-width: 140px;
  }
  
  .logo--desktop { display: none; }
  .logo--mobile  { display: block; }
  
  .header__actions {
    gap: 0.5rem;
  }
  
  .header__toggle,
  .header__button,
  .header__user-toggle,
  .header__notif-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}
/* =========================================
   FIX: DROPDOWNS CON FONDO SÓLIDO (NO GLASS)
   ========================================= */

/* Light */
.header__notif-dropdown,
.header__user-dropdown {
  /* fondo sólido blanco */
  background: #ffffff !important;

  /* sin transparencia ni glass */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;

  /* borde y sombra un poco más suaves */
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow:
    0 18px 35px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(148, 163, 184, 0.15) !important;
}

/* Dark */
html.dark .header__notif-dropdown,
html.dark .header__user-dropdown {
  /* fondo sólido oscuro */
  background: #020617 !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(30, 64, 175, 0.45) !important;
}

/* Encabezados siguen diferenciados pero sin transparencias raras */
html.dark .header__notif-header,
html.dark .header__user-info {
  background: #020617 !important;
}

/* Opciones dentro del dropdown con fondo sólido al hacer hover */
html.dark .header__user-dropdown a:hover,
html.dark .header__notif-more:hover {
  background: #111827 !important;
}
