/* ===== HEADER ===== */
.header {
  background:
    linear-gradient(180deg, rgba(34, 197, 94, 0.015), rgba(15, 15, 15, 0.98)),
    rgba(15, 15, 15, 0.95);
  border-bottom: 1px solid rgba(34, 197, 94, 0.08);
  padding: 0.35rem 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-logo-img {
  height: 50px;
  width: auto;
  transition: transform 0.3s ease;
}

.header-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(135deg, #39FF14, #00FFA3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.header-logo:hover .header-logo-img {
  transform: scale(1.05);
}

.header-logo:hover .header-logo-text {
  background: linear-gradient(135deg, #4dff28, #14ffb7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: brightness(1.1);
}

/* Navegación */
.header-nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.header-nav a {
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 4px 13px;
  border-radius: 6px;
  font-size: 0.9rem;
  position: relative;
}

.header-nav a:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.03);
}

.header-nav a.active {
  color: var(--success);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
  border: 1px solid rgba(34, 197, 94, 0.15);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.08);
}

/* Acciones derecha */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  color: var(--secondary);
  transition: all 0.3s ease;
  position: relative;
}

.header-icon:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
  color: var(--primary);
}

/* Botón de ayuda activo */
.header-icon.help-active {
  background: rgba(57, 255, 20, 0.12);
  border-color: rgba(57, 255, 20, 0.4);
  color: #39FF14;
  box-shadow:
    0 0 16px rgba(57, 255, 20, 0.3),
    0 0 32px rgba(57, 255, 20, 0.15),
    inset 0 0 12px rgba(57, 255, 20, 0.08);
  animation: helpGlow 2s ease-in-out infinite;
}

.header-icon.help-active:hover {
  background: rgba(57, 255, 20, 0.18);
  border-color: rgba(57, 255, 20, 0.6);
  box-shadow:
    0 0 20px rgba(57, 255, 20, 0.4),
    0 0 40px rgba(57, 255, 20, 0.2),
    inset 0 0 16px rgba(57, 255, 20, 0.1);
}

@keyframes helpGlow {
  0%, 100% {
    box-shadow:
      0 0 16px rgba(57, 255, 20, 0.3),
      0 0 32px rgba(57, 255, 20, 0.15),
      inset 0 0 12px rgba(57, 255, 20, 0.08);
  }
  50% {
    box-shadow:
      0 0 20px rgba(57, 255, 20, 0.4),
      0 0 40px rgba(57, 255, 20, 0.25),
      inset 0 0 16px rgba(57, 255, 20, 0.12);
  }
}

.header-icon img {
  width: 28px;
  height: 28px;
  object-fit: cover;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0.4rem 0.2rem 0.4rem;
  border-radius: 12px;
  background: rgba(20, 24, 33, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.header-user:hover {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.2);
}

.header-user::after {
  content: '▼';
  font-size: 0.65rem;
  color: var(--secondary);
  margin-left: 0.5rem;
}

.header-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--success);
  /*background-image: url('/static/img/avatar.png');*/
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
  flex-shrink: 0;
}

.header-user-name {
  font-size: 0.95rem;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
}

/* Botón móvil */
.header-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0.5rem;
}

.header-menu-btn span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  transition: 0.3s;
  display: block;
}

/* Language Selector */
.header-lang-selector {
  position: relative;
}

.header-lang-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.015), rgba(15, 15, 15, 0.98)), rgba(15, 15, 15, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}

.header-lang-dropdown.show {
  display: block;
}

.header-lang-form {
  margin: 0;
}

.header-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: #9aa4b2;
  font-weight: 400;
}

.header-lang-option.active {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
  border-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-weight: 600;
}

.header-lang-option:hover:not(.active) {
  background: rgba(34, 197, 94, 0.05);
  color: #22c55e;
}

.header-lang-flag {
  font-size: 20px;
}

.header-lang-name {
  font-size: 14px;
}

/* Mobile Language Selector */
.mobile-lang-section {
  padding: 0 16px;
}

.mobile-lang-title {
  font-size: 12px;
  color: var(--secondary);
  margin-bottom: 8px;
}

.mobile-lang-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--primary);
}

.mobile-lang-btn.active {
  background: rgba(57, 255, 20, 0.15);
  border-color: rgba(57, 255, 20, 0.3);
}

.mobile-lang-flag {
  font-size: 20px;
}