/* =============================================================================
   CORE component — Navbar Module - default theme
   ============================================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a2e;
  color: #fff;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  flex-wrap: nowrap;
  overflow: visible;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
  margin-right: 12px;
  cursor: pointer;
}
.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  cursor: pointer;
}

.navbar .nav-link,
.navbar a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  user-select: none;
}
.navbar .nav-link:hover,
.navbar a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav-right {
  display: flex;
  align-items: center;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-inner {
    flex-wrap: nowrap;
    overflow-x: clip;
    height: auto;
    min-height: 52px;
    padding: 8px 0;
    gap: 4px;
    align-items: center;
  }

  .nav-left {
    flex-wrap: nowrap;
    gap: 2px;
    flex-shrink: 0;
  }

  .navbar .nav-link,
  .navbar a {
    padding: 6px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-right {
    flex-shrink: 0;
    margin-left: auto;
  }

  .nav-logo {
    font-size: 1rem;
    margin-right: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-logo-img { height: 28px; }

  .lang-switcher { flex-shrink: 0; }

  .lang-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

/* ── Topic 110: auth widget — nav-right içinde, dil seçiciden önce ────────── */
.navbar-auth {
    display:      flex;
    align-items:  center;
    flex-shrink:  0;
    margin-left:  .75rem;
    margin-right: .75rem;   /* v0.110.2.0: gap to the language switcher */
}

.navbar-auth-inner {
    display:     flex;
    align-items: center;
    gap:         .4rem;
    cursor:      pointer;
}

.navbar-auth-icon {
    width:      1.25rem;
    height:     1.25rem;
    object-fit: contain;
    display:    block;
    /* v0.110.3.0: same tint method as .lang-icon-img (language switcher) —
       dark source SVGs become visible on the dark bar. */
    filter: brightness(0) invert(0.75);
    transition: filter 0.2s;
}
.navbar-auth-inner:hover .navbar-auth-icon { filter: brightness(0) invert(1); }

.navbar-auth-label {
    font-size: .875rem;
}

.navbar-auth-username {
    font-size:   .875rem;
    font-weight: 600;
}

/* v0.110.3.0: logout icon shares the filter tint above — the old
   opacity-based hover is superseded by the .navbar-auth-inner:hover rule. */

/* ── Topic 131 Phase B — sister-site (federation) switcher ────────────────── */
/* Paired with the language switcher (F-P-C): same "meta widget" look, sits
   immediately to its right in .nav-right. */
.navbar-federation {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.federation-switcher-navbar {
  position: relative;            /* .federation-dropdown is absolute against this */
}
.federation-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.federation-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  /* Same treatment as .lang-icon-img / .navbar-auth-icon: strip the source
     colour so the icon matches every other nav icon's themed grey. */
  filter: brightness(0) invert(0.75);
  transition: filter 0.2s;
}
.federation-trigger:hover .federation-icon,
.federation-trigger[aria-expanded="true"] .federation-icon {
  filter: brightness(0) invert(1);
}
.federation-trigger::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.65;
}
.federation-trigger:hover,
.federation-trigger[aria-expanded="true"] {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
}

.federation-dropdown {
  /* position/top/right/z-index are set by FederationSwitcher::toggleDropdown()
     as position:fixed against the trigger's live rect — see that method. */
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 320px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.federation-dropdown .federation-row {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  white-space: normal;
  transition: background 0.15s, color 0.15s;
}
.federation-dropdown a.federation-row:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.federation-dropdown .federation-row-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}
.federation-dropdown a.federation-row:hover .federation-row-desc {
  color: rgba(255,255,255,0.65);
}
.federation-dropdown .federation-row-active {
  color: rgba(255,255,255,0.45);
  cursor: default;
}
.federation-dropdown .federation-row-active::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #4ade80;          /* "you are here" */
  vertical-align: middle;
}

@media (max-width: 640px) {
  .navbar-federation { margin-left: 0.25rem; }
  .federation-trigger { padding: 4px 7px; font-size: 0.74rem; }
  .federation-dropdown { min-width: 180px; }
}

/* ── Topic 141: the user menu — one button (who is here), entries below ───── */
.navbar-user { position: relative; display: flex; align-items: center; }
.navbar-user-btn { user-select: none; padding: .25rem .4rem; border-radius: 6px; }
.navbar-user-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.navbar-user-btn::after {
    content: "";
    width: 0; height: 0; margin-left: .15rem;
    border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid currentColor; opacity: .6;
}
.navbar-user.open .navbar-user-btn::after { transform: rotate(180deg); }
.navbar-user-menu {
    display: none;
    position: fixed; z-index: 9999;   /* placed under the button by the script: the bar clips its overflow */
    min-width: 11rem; max-width: 18rem;
    flex-direction: column; gap: 2px; padding: 4px;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.navbar-user.open .navbar-user-menu { display: flex; }
.navbar-user-item {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    padding: 7px 12px; border-radius: 5px;
    font-size: .85rem; white-space: nowrap; cursor: pointer;
    color: rgba(255,255,255,0.75);
}
.navbar-user-item:hover, .navbar-user-item:focus-visible { background: rgba(255,255,255,0.1); color: #fff; outline: none; }
.navbar-user-item:hover .navbar-auth-icon { filter: brightness(0) invert(1); }
/* Leaving is set apart from what one can do here. */
.navbar-user-logout { margin-top: 2px; border-top: 1px solid rgba(255,255,255,0.12); border-radius: 0 0 5px 5px; padding-top: 9px; }
.navbar-user-logout:first-child { margin-top: 0; border-top: none; padding-top: 7px; border-radius: 5px; }
.navbar-user-delete { color: #fca5a5; }
.navbar-user-delete:hover, .navbar-user-delete:focus-visible { background: rgba(239,68,68,0.18); color: #fca5a5; }
/* A narrow screen: the icon says "user" by itself. */
@media (max-width: 640px) {
    .navbar-user-btn.has-icon .navbar-user-label { display: none; }
    .navbar-user-btn .navbar-auth-username { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ── Topic 141: a confirmation card over a dimmed page (closing an account) ─ */
.ffs-confirm-overlay {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    background: rgba(0,0,0,0.55);
}
.ffs-confirm {
    width: 100%; max-width: 28rem;
    display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem 1.4rem;
    background: #1e293b; border: 1px solid rgba(255,255,255,0.15); border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.ffs-confirm-title { display: block; font-size: 1.05rem; font-weight: 700; color: #f1f5f9; }
.ffs-confirm-text  { display: block; font-size: .9rem; line-height: 1.5; color: rgba(255,255,255,0.75); white-space: normal; }
.ffs-confirm-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; margin-top: .3rem; }
.ffs-confirm-buttons button {
    padding: .5rem 1rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.15);
    font-size: .875rem; cursor: pointer; background: rgba(255,255,255,0.12); color: #f1f5f9;
}
.ffs-confirm-buttons button:focus-visible { outline: 2px solid #f1f5f9; outline-offset: 2px; }
.ffs-confirm-buttons .ffs-confirm-danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.ffs-confirm-buttons .ffs-confirm-danger:hover { background: #b91c1c; }
