/* ========== NAVBAR / HEADER – TISZTA VERZIÓ ========== */

/* HEADER ALAP (minden méret) */
#topHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #111827;
  color: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 16px;
  box-sizing: border-box;
}

/* bal oldal: logó + név + (hamburger + nav a HTML-ben) */
.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.brand-logo {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-weight: 600;
  font-size: 14px;
}

/* NAV linkek */
.nav-link {
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: #e5e7eb;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: #1f2937;
}

.nav-link-active {
  background: #2563eb;
  color: #fff;
}

/* JOBB OLDAL (profil + kilépés) */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.header-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}

.header-username {
  font-weight: 600;
}

.header-role {
  opacity: 0.7;
  font-size: 11px;
}

.header-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 999px;
  background: #374151;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.logout-btn {
  background: #dc2626;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}


/* ========== HAMBURGER GOMB (id="navToggle") ========== */

#navToggle {
  display: none;              /* mobilon media query-ben kapcsoljuk be */
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* 3 csík a gombban */
#navToggle .burger-line {
  display: block;
  width: 16px;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* kis távolság a csíkok között */
#navToggle .burger-line:nth-child(2) {
  margin: 4px 0;
}

/* ===== HAMBURGER → X ANIMÁCIÓ, amikor nyitva a menü ===== */

#topHeader.nav-open #navToggle .burger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#topHeader.nav-open #navToggle .burger-line:nth-child(2) {
  opacity: 0;
}

#topHeader.nav-open #navToggle .burger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ========== DESKTOP (>= 769px) – NAV A HEADERBEN, HAMBURGER OFF ========== */
@media (min-width: 769px) {

  /* nav a headerben, vízszintesen */
  #topHeader nav {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-left: 16px;
    font-size: 13px;
    white-space: nowrap;
    overflow-x: auto;
    max-width: 50vw;
    position: static;
  }

  /* hamburger ne látszódjon */
  #navToggle {
    display: none !important;
  }
}

/* ========== MOBIL (<= 768px) ========== */
@media (max-width: 768px) {
  /* header: egy sor, bal: logo+hamburger, jobb: szerep+kilépés */
  #topHeader {
    padding: 0 10px;
    justify-content: space-between;
    gap: 10px;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  /* hamburger itt látszik */
  #navToggle {
    display: flex;
  }

  /* NAV mobilon – alapból rejtve, lenyílva a header ALATT */
  #topHeader nav {
    display: none !important;         /* alap: rejtett */
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: #111827;
    padding: 8px 16px 10px;
    flex-direction: column;
    gap: 4px;
    max-width: none;
    overflow-x: visible;
    z-index: 9998;
  }

  /* amikor a header kap egy .nav-open-t, akkor nyílik le */
  #topHeader.nav-open nav {
    display: flex !important;
  }

  #topHeader nav .nav-link {
    display: block;
    width: 100%;
  }

  /* Jobb oldal – szerep + Kilépés egy sorban, jobb szélre húzva */
  .header-right {
    margin-left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
  }

  /* mobilon a név + avatar felesleges, csak szerep látszik */
  .header-username,
  .header-avatar {
    display: none;
  }

  .header-role {
    font-size: 11px;
    opacity: 0.9;
    white-space: nowrap;
  }

  .logout-btn {
    padding: 4px 10px;
    white-space: nowrap;
  }
}

/* Kapcsolat modal */
.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.contact-modal-backdrop.is-open {
  display: flex;
}

.contact-modal {
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  position: relative;
}

.contact-modal h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.contact-modal p {
  margin: 4px 0;
  font-size: 14px;
}

.contact-modal a {
  color: #60a5fa;
  text-decoration: none;
}

.contact-modal a:hover {
  text-decoration: underline;
}

.contact-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.contact-modal-close:hover {
  background: #1f2937;
}
/* Kapcsolat modal – szebb háttérrel */

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  /* sima fekete helyett enyhe kékes gradient + átlátszóság */
  background:
    radial-gradient(circle at top, rgba(59,130,246,0.18), transparent 55%),
    rgba(15,23,42,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  /* kicsi blur a mögötte lévő tartalomra */
  backdrop-filter: blur(4px);
}

/* amikor nyitva van */
.contact-modal-backdrop.is-open {
  display: flex;
}

.contact-modal {
  background: rgba(15,23,42,0.95);            /* nagyon sötét kék, nem tök fekete */
  color: #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 18px 40px rgba(15,23,42,0.9);
  position: relative;
  border: 1px solid rgba(96,165,250,0.35);    /* finom kék keret */
}

.contact-modal h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.contact-modal p {
  margin: 4px 0;
  font-size: 14px;
}

.contact-modal a {
  color: #60a5fa;
  text-decoration: none;
}

.contact-modal a:hover {
  text-decoration: underline;
}

.contact-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  cursor: pointer;
}

.contact-modal-close:hover {
  background: #1f2937;
}
/* Kapcsolat modal – szebb háttérrel */

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  /* sima fekete helyett enyhe kékes gradient + átlátszóság */
  background:
    radial-gradient(circle at top, rgba(59,130,246,0.18), transparent 55%),
    rgba(15,23,42,0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;

  /* kicsi blur a mögötte lévő tartalomra */
  backdrop-filter: blur(4px);
}

/* amikor nyitva van */
.contact-modal-backdrop.is-open {
  display: flex;
}

.contact-modal {
  background: rgba(15,23,42,0.95);            /* nagyon sötét kék, nem tök fekete */
  color: #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 18px 40px rgba(15,23,42,0.9);
  position: relative;
  border: 1px solid rgba(96,165,250,0.35);    /* finom kék keret */
}

.contact-modal h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.contact-modal p {
  margin: 4px 0;
  font-size: 14px;
}

.contact-modal a {
  color: #60a5fa;
  text-decoration: none;
}

.contact-modal a:hover {
  text-decoration: underline;
}

.contact-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: rgba(15,23,42,0.9);
  color: #e5e7eb;
  cursor: pointer;
}

.contact-modal-close:hover {
  background: #1f2937;
}
.user-quick-actions {
  max-width: 1100px;
  margin: 8px auto 16px;
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.user-quick-actions .button {
  font-size: 13px;
}
.user-device-list {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 12px 16px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.user-device-list ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.user-device-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}

.user-device-list a {
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 600;
}
.user-device-list a:hover {
  text-decoration: underline;
}

.user-device-list .tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  font-size: 11px;
}

.status-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.status-tag.online {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.status-tag.offline {
  background: rgba(248,113,113,0.15);
  color: #fca5a5;
}

.text-success {
  color: #22c55e !important;  /* szép zöld */
  font-weight: bold;
}

.user-section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.user-legend {
  max-width: 1100px;
  margin: 16px auto 0;
  padding: 10px 16px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  font-size: 13px;
}
.user-legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.user-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.dot-ok {
  background: #22c55e;
}
.dot-warn {
  background: #eab308;
}
.dot-alert {
  background: #ef4444;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

/* Globális háttér MINDEN oldalnak */
body {
  padding-top: 56px; /* navbar miatt marad */
  background: radial-gradient(
    circle at top left,
    #111827 0,
    #020617 55%,
    #020617 100%
  ) !important;             /* bármi más body background-ot lever */
  background-attachment: fixed;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* ===== Globális modal alapstílus (Bootstrap nélkül is jó) ===== */

.modal {
  display: none;                 /* alap: rejtve */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.6); /* halvány sötét háttér */
  overflow: auto;
}

.modal.show {
  display: block;                /* ha megkapja a .show-t (Bootstrap) */
}

.modal-dialog {
  margin: 40px auto;
  max-width: 500px;
  width: 90%;
}

.modal-content {
  background: #111827;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

/* ======= LOGIN / AUTH LAYOUT ======= */

/* háttér ugyanaz a hangulat, mint a dashboardon */
.app-bg {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, #111827 0, #020617 55%, #020617 100%);
  color: #e5e7eb;
  display: flex;
  flex-direction: column;
}

/* a tartalom a header alatt középre */
.auth-layout {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 40px;
}

/* kártya a formnak */
.auth-card {
  width: 100%;
  max-width: 420px;
  background: radial-gradient(circle at top, #0f172a 0, #020617 60%);
  border-radius: 18px;
  padding: 28px 26px 24px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(148, 163, 184, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

/* cím, alcím */
.auth-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  text-align: center;
  color: #f9fafb;
}

.auth-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  text-align: center;
  color: #9ca3af;
}

/* form mezők */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.auth-field label {
  color: #cbd5f5;
}

.auth-field input {
  border-radius: 10px;
  border: 1px solid #374151;
  background: #020617;
  padding: 9px 11px;
  font-size: 14px;
  color: #e5e7eb;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-field input::placeholder {
  color: #6b7280;
}

.auth-field input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.5);
  background: #020617;
}

/* jelszó mező + szem ikon */
.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrapper input {
  width: 100%;
  padding-right: 36px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
}

/* hibaüzenet */
.auth-error {
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.12);
  border-radius: 8px;
  padding: 6px 8px;
}

/* gomb */
.auth-submit {
  margin-top: 8px;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

.auth-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.65);
}

.auth-submit:active {
  transform: translateY(1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

/* linkek a form alatt */
.auth-links,
.auth-footer-text {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
  color: #9ca3af;
}

.auth-links a,
.auth-footer-text a {
  color: #60a5fa;
  text-decoration: none;
}

.auth-links a:hover,
.auth-footer-text a:hover {
  text-decoration: underline;
}

/* mobilon kicsit szorosabb */
@media (max-width: 640px) {
  .auth-card {
    padding: 22px 18px 20px;
  }

  .auth-title {
    font-size: 22px;
  }
}

.toggle-switch,
.toggle-switch .slider {
  z-index: 1 !important;
}
