/* ======================================= */
/* HEADER – NAVIGATIE MET DROPDOWNS        */
/* ======================================= */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 20px;
  height: 60px;
  background: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
}

/* ── Logo ── */
.logo.logo-animated {
  flex-shrink: 0;
  margin-right: 12px;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  gap: 0;
}

.logo.logo-animated .letter {
  display: inline-block;
  animation: float-header 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

#logoNormalHeader {
  color: var(--text-primary);
}

#logoAccentHeader {
  color: var(--accent-purple);
}

.logo.logo-animated .letter:hover {
  transform: scale(1.2) translateY(-3px) !important;
  color: var(--link-color);
}

.logo.logo-animated .accent .letter {
  animation: glow-header 2s ease-in-out infinite;
}

@keyframes float-header {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-6px); }
}

@keyframes glow-header {
  0%, 100% {
    text-shadow: 0 0 10px rgba(147, 51, 234, 0.5);
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px rgba(147, 51, 234, 0.8), 0 0 30px rgba(147, 51, 234, 0.4);
    transform: scale(1.05);
  }
}

/* ── Coffee (direct naast logo) ── */
.header-coffee-link {
  display: flex;
  align-items: center;
  margin-right: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.header-coffee-link:hover {
  transform: scale(1.05);
}

.header-coffee-logo {
  height: 30px;
  width: auto;
  border-radius: 5px;
}

/* ── Spacer (duwt nav + actions naar rechts) ── */
.header-spacer {
  flex: 1;
}

/* ── Hoofdnav ── */
.main-nav {
  flex: none;
  margin-right: 8px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Nav item ── */
.nav-item {
  position: relative;
}

/* ── Nav link / toggle knop ── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
  line-height: 1;
}

.nav-link:hover,
.nav-link.active,
.nav-item.open > .nav-link {
  background: color-mix(in srgb, var(--link-color) 12%, transparent);
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--link-color);
}

.nav-icon {
  font-size: 1rem;
}

/* Pijltje rotatie bij open dropdown */
.nav-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
  margin-left: 1px;
}

.nav-item.open > .nav-link .nav-arrow,
.nav-dropdown-toggle[aria-expanded="true"] .nav-arrow {
  transform: rotate(180deg);
}

/* ── Dropdown menu ── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  padding-top: 8px;
  left: 0;
  min-width: 190px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px;
  list-style: none;
  margin: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 999;
  animation: dropdownFadeIn 0.15s ease;
}

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

.nav-item.open .nav-dropdown,
.nav-item:hover .nav-dropdown {
  display: block;
}

/* Onzichtbare brug tussen nav-link en dropdown zodat hover niet wegvalt */
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}

.nav-item:hover > .nav-link .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown li a:hover,
.nav-dropdown li a.active {
  background: color-mix(in srgb, var(--link-color) 12%, transparent);
  color: var(--text-primary);
}

.nav-dropdown li a.active {
  color: var(--link-color);
}

.nav-dropdown .icon {
  font-size: 1rem;
}

/* ── Header rechts ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Taal dropdown ── */
.lang-dropdown-item {
  position: relative;
}

.lang-toggle {
  min-width: 80px;
  justify-content: center;
}

.lang-dropdown {
  right: 0;
  left: auto;
  min-width: 150px;
}

.lang-dropdown li a {
  gap: 10px;
  font-size: 0.88rem;
}

.lang-dropdown li a.active {
  color: var(--link-color);
  background: color-mix(in srgb, var(--link-color) 10%, transparent);
}

/* ── Theme toggle ── */
.theme-toggle {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--card-bg);
  border-color: var(--link-color);
  transform: scale(1.05);
}

.theme-icon {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

/* ── Mobiele hamburger ── */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 7px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}

.mobile-nav-toggle .line {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-nav-toggle.active .line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-nav-toggle.active .line:nth-child(2) { opacity: 0; }
.mobile-nav-toggle.active .line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobiel overlay ── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
}

.mobile-nav-overlay.active {
  display: block;
}

/* ── Particle effect ── */
.particle-header {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-purple);
  pointer-events: none;
  z-index: 9999;
  animation: particleBurst 1s ease-out forwards;
}

@keyframes particleBurst {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

/* ======================================= */
/* LIGHT MODE                              */
/* ======================================= */
:root.light-mode .nav-dropdown {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ======================================= */
/* RESPONSIVE – TABLET / MOBIEL            */
/* ======================================= */
@media (max-width: 900px) {
  .main-nav {
    display: none;
  }

  .header-spacer {
    flex: 1;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .header-coffee-logo {
    height: 26px;
  }

  /* Mobiel: nav als slide-in paneel */
  .main-nav.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    width: 260px;
    height: calc(100vh - 60px);
    background: var(--secondary-bg);
    border-right: 1px solid var(--border-color);
    z-index: 999;
    overflow-y: auto;
    padding: 12px 8px;
    animation: slideInLeft 0.22s ease;
  }

  @keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
  }

  .main-nav.mobile-open .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .main-nav.mobile-open .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .main-nav.mobile-open .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: color-mix(in srgb, var(--primary-bg) 60%, transparent);
    border-radius: 8px;
    margin: 2px 0 4px 8px;
    padding: 4px;
    animation: none;
  }

  .main-nav.mobile-open .nav-item.open .nav-dropdown {
    display: block;
  }

  .main-nav.mobile-open .nav-dropdown li a {
    padding: 9px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  .theme-icon {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  .header-coffee-link {
    display: none;
  }
}
