/* ===== PlanzEE – modern, rögzített navbar (oldal tetején marad) ===== */

:root {
  --nav-height: 56px;
  /* Fehér háttér */
  --nav-bg: #ffffff;
  --nav-text: #0f172a;
  --nav-text-hover: #0f172a;
  --nav-brand: #0f172a;
  --nav-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --nav-border: #e2e8f0;
}

/* Layout: tartalom ne kerüljön a navbar alá + 20px térköz a navbar alatt */
body.has-navbar {
  padding-top: calc(var(--nav-height) + 20px);
}

.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10100;
  height: var(--nav-height);
  background: var(--nav-bg);
  box-shadow: var(--nav-shadow);
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  font-size: 0.9375rem;
}

.app-nav__inner {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 0.5rem 1rem;
}

.app-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--nav-brand);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  margin-right: 0.5rem;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.app-nav__brand:hover {
  color: var(--nav-text-hover);
  background: #f1f5f9;
  text-decoration: none;
}

.app-nav__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.app-nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.app-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--nav-text);
  text-decoration: none;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  font-variant-ligatures: none;
  font-style: normal;
}

.app-nav__link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.app-nav__link:hover .app-nav__link-icon,
.app-nav__link--active .app-nav__link-icon {
  opacity: 1;
}

.app-nav__link:hover {
  color: var(--nav-text-hover);
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.app-nav__link--active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.14), rgba(37, 99, 235, 0.12));
  color: #0f172a;
  font-weight: 600;
  border: 1px solid rgba(37, 99, 235, 0.35);
}

.app-nav__badge {
  display: inline-block;
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #fff;
  border-radius: 9999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.25rem;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.app-nav__spacer {
  flex: 1;
  min-width: 0.5rem;
}

.app-nav__user {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--nav-text);
  font-size: 0.875rem;
  padding: 0 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.app-nav__user-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: #1e40af;
  flex-shrink: 0;
}

.app-nav__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  min-width: 36px;
  min-height: 36px;
  color: #dc2626;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.app-nav__logout-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.app-nav__logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav__logout-icon svg {
  width: 18px;
  height: 18px;
}

.app-nav__logout:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

/* Brand szöveg: asztalon "Főoldal", mobilon "PlanzEE" */
.app-nav__brand-text--mobile {
  display: none;
}

/* Lenyíló menüben megjelenő elemek (csak mobilon) */
.app-nav__link--mobile-only,
.app-nav__user-in-menu {
  display: none;
}

/* ---- Mobil: hamburger menü ---- */
.app-nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0 -0.5rem 0 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s;
}

.app-nav__toggle:hover {
  background: #f1f5f9;
}

.app-nav__toggle-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

@media (max-width: 900px) {
  .app-nav {
    padding: 0 0.75rem;
  }

  .app-nav__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
  }

  .app-nav__toggle {
    display: flex;
    order: unset;
    grid-column: 1;
    justify-self: start;
  }

  .app-nav__brand {
    grid-column: 2;
    justify-self: center;
  }

  .app-nav__spacer {
    display: none;
  }

  .app-nav__inner > form {
    grid-column: 3;
    justify-self: end;
  }

  .app-nav__links {
    grid-column: 1;
    grid-row: 1;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--nav-border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }

  .app-nav__links.is-open {
    max-height: 80vh;
    opacity: 1;
    pointer-events: auto;
  }

  .app-nav__link {
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
  }

  .app-nav__brand-text--desktop {
    display: none;
  }

  .app-nav__brand-text--mobile {
    display: inline;
  }

  .app-nav__user {
    display: none;
  }

  .app-nav__logout {
    padding: 0.4rem;
    min-width: 38px;
    min-height: 38px;
  }

  .app-nav__logout-icon svg {
    width: 16px;
    height: 16px;
  }

  .app-nav__link--mobile-only {
    display: inline-flex;
  }

  .app-nav__user-in-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    color: var(--nav-text);
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--nav-border);
  }

  .app-nav__user-in-menu .app-nav__user-icon {
    width: 20px;
    height: 20px;
  }
}

@media (min-width: 901px) {
  .app-nav__link--mobile-only,
  .app-nav__user-in-menu {
    display: none;
  }

  .app-nav__links {
    margin-right: 0.5rem;
  }
}
