/*
 * Horizontal top navigation.
 *
 * Replaces the fixed 250px sidebar: app-style.css still offsets
 * .content-wrapper and .footer by that width, so those are reset here.
 * Loaded before light-theme.css, which flips the colours for light mode.
 */

/* ---------------------------------------------------------------- layout */
.content-wrapper {
  margin-left: 0 !important;
  padding-top: 74px;
  padding-left: 22px;
  padding-right: 22px;
}

/* Sticky footer: app-style.css pins .footer absolutely, which parks it right
   under a short page instead of at the bottom of the window. Make the wrapper
   a full-height column so the content area takes the slack instead. */
#wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content-wrapper {
  flex: 1 0 auto;
  padding-bottom: 40px;
}

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
  padding: 24px 22px 20px;
}

.footer-brand {
  max-width: 330px;
}

.footer-brand img {
  height: 26px;
  width: auto;
  margin-bottom: 9px;
}

.footer-brand .logo-light {
  display: none;
}

.footer-brand p {
  margin: 0;
  line-height: 1.65;
}

/* Brand glyphs come from Simple Icons as inline paths: Lucide dropped its
   brand set, and these are solid shapes rather than stroked outlines. */
.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.66);
  transition: background .15s ease, color .15s ease;
}

.footer-social-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.footer-social-link svg {
  width: 16px;
  height: 16px;
}

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12.5px;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-dot {
  opacity: .5;
}

/* On a wide screen line the content up with the first menu item rather than
   letting it run to the edge. 104px is where that item starts: 18px bar
   padding + 63px logo + 14px brand margin + 8px flex gap.
   Kept for wide displays only — a laptop screen needs the width. */
@media (min-width: 1600px) {
  .content-wrapper {
    padding-left: 104px;
    padding-right: 104px;
  }

  .site-footer-inner,
  .site-footer-bottom {
    padding-left: 104px;
    padding-right: 104px;
  }
}

/* ---------------------------------------------------------------- the bar */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 58px;
  background: #0e1013;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.topnav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding: 0 18px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.topnav-brand img {
  height: 32px;
  width: auto;
}

.topnav-brand .logo-light {
  display: none;
}

/* --------------------------------------------------------------- the menu */
.topnav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.topnav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  background: none;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.topnav-link:hover,
.topnav-link:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

/* Both the current page and the group holding it read as selected. */
.topnav-link.active,
.topnav-group.active > .topnav-link {
  background: rgba(99, 102, 241, 0.20);
  color: #c7d2fe;
}

.topnav-link svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.topnav-caret {
  margin-left: 1px;
  opacity: .75;
}

.topnav-caret svg,
.topnav-link .topnav-caret {
  width: 14px;
  height: 14px;
}

/* ---------------------------------------------------------- the dropdowns */
.topnav-group {
  position: relative;
}

.topnav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 216px;
  padding: 6px;
  background: #16181f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 1040;
}

.topnav-group.open .topnav-dropdown {
  display: block;
}

.topnav-dropdown-right {
  left: auto;
  right: 0;
}

.topnav-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.80);
  white-space: nowrap;
}

.topnav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.topnav-dropdown a.active {
  background: rgba(99, 102, 241, 0.20);
  color: #c7d2fe;
}

.topnav-dropdown svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* -------------------------------------------------------------- the right */
.topnav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.topnav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.topnav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.topnav-icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Only one of the two glyphs shows, depending on the active theme. */
.theme-toggle-icon-light {
  display: none;
}

html.light-mode .theme-toggle-icon-dark {
  display: none;
}

html.light-mode .theme-toggle-icon-light {
  display: inline-flex;
}

.topnav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 10px;
  background: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.topnav-user-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topnav-user-btn img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.topnav-user-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.topnav-user-name strong {
  font-size: 13px;
  font-weight: 600;
}

.topnav-user-name small {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

/* ------------------------------------------------------------ mobile menu */
.topnav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.topnav-burger svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 991px) {
  .topnav-burger {
    display: inline-flex;
  }

  .topnav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    background: #16181f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .topnav-menu.open {
    display: flex;
  }

  .topnav-group .topnav-dropdown {
    position: static;
    display: block;
    min-width: 0;
    margin: 2px 0 2px 22px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
  }

  .topnav-caret {
    display: none;
  }

  .topnav-user-name {
    display: none;
  }
}

/* --------------------------------------------------------------- icon size
   Lucide renders 24px SVGs. Icons sit inline with text everywhere in this app,
   so make them follow the font size like the icon fonts they replaced. */
svg.lucide {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* fa-spin had its own keyframes; keep a spinner for the SVG version. */
@keyframes lucide-spin {
  to { transform: rotate(360deg); }
}

svg.lucide.spin,
.fa-spin > svg.lucide,
svg.lucide.fa-spin {
  animation: lucide-spin 1s linear infinite;
}
