/* Docs Navigation Styles - Nav Only */

/* Navigation Container */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--white);
  border-bottom: 1.5px solid var(--line);
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 2;
}

.nav-container .logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

/* TOC Toggle */
.toc-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s ease;
  font-family: var(--font);
  flex-shrink: 0;
}

.toc-toggle:hover {
  border-color: var(--purple);
  background: var(--lavender);
}

.toc-toggle i {
  font-size: 16px;
  color: var(--purple);
}

.toc-toggle span {
  display: inline;
}

/* Account Dropdown */
.account-dropdown-container {
  position: relative;
  flex-shrink: 0;
}

.account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: all 0.2s ease;
  font-size: 20px;
}

.account-btn:hover {
  border-color: var(--purple);
  background: var(--lavender);
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.account-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content {
  padding: 8px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
  text-decoration: none;
}

.dropdown-item:hover {
  background: var(--lavender);
}

.dropdown-item i {
  width: 18px;
  color: var(--muted);
  font-size: 15px;
}

.dropdown-item.signup-cta {
  color: var(--purple);
}

.dropdown-item.signup-cta i {
  color: var(--purple);
}

.dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 12px;
}

/* Nav Background Effect */
.nav-bg-effect {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--purple), #a78bfa, var(--purple));
  background-size: 200% 100%;
  animation: shimmer 3s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Header Spacer */
.header-spacer {
  height: 64px;
}

/* Sidebar */
.docs-sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 280px;
  background: var(--white);
  border-right: 1.5px solid var(--line);
  overflow-y: auto;
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--line);
}

.sidebar-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}

.close-sidebar {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  padding: 4px;
}

.sidebar-overlay {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-content {
  padding: 12px 0;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav > li {
  margin: 0;
}

.sidebar-nav > li > a {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
}

.sidebar-nav > li > a:hover {
  background: var(--lavender);
  border-left-color: var(--purple);
}

.sidebar-nav > li > a.active {
  background: var(--lavender);
  border-left-color: var(--purple);
  color: var(--purple);
}

/* Directory Items */
.directory-item {
  margin: 0;
}

.dir-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
  cursor: pointer;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.dir-link:hover {
  background: var(--lavender);
  border-left-color: var(--purple);
}

.dir-link.active {
  background: var(--lavender);
  border-left-color: var(--purple);
  color: var(--purple);
}

.dir-text {
  flex: 1;
}

.dir-arrow {
  font-size: 16px;
  color: var(--muted);
  transition: transform 0.25s ease;
  display: inline-block;
}

.dir-link.expanded .dir-arrow {
  transform: rotate(90deg);
}

.dir-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.dir-content.expanded {
  max-height: 2000px;
}

.dir-pages {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dir-pages li {
  margin: 0;
}

.dir-pages a {
  display: block;
  padding: 6px 20px 6px 36px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.dir-pages a:hover {
  color: var(--ink);
  background: var(--lavender);
  border-left-color: var(--purple);
}

.dir-pages a.active {
  color: var(--purple);
  background: var(--lavender);
  border-left-color: var(--purple);
  font-weight: 500;
}

/* Nested Directories */
.nested-directory-item {
  margin: 0;
}

.nested-dir-link {
  padding: 6px 20px 6px 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.nested-dir-link:hover {
  background: var(--lavender);
  border-left-color: var(--purple);
}

.nested-dir-link.active {
  background: var(--lavender);
  border-left-color: var(--purple);
  color: var(--purple);
}

.nested-dir-link .dir-arrow {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.25s ease;
}

.nested-dir-link.expanded .dir-arrow {
  transform: rotate(90deg);
}

.nested-dir-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.nested-dir-content.expanded {
  max-height: 2000px;
}

.nested-dir-content .dir-pages a {
  padding: 5px 20px 5px 48px;
  font-size: 12px;
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0 8px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--purple);
  font-weight: 500;
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: #7c3aed;
  text-decoration: underline;
}

.breadcrumb .separator {
  color: var(--line);
  font-size: 14px;
}

/* Mobile Responsive */
@media (min-width: 769px) {
  .docs-sidebar {
    position: sticky;
    top: 64px;
    transform: none;
    width: 260px;
    height: calc(100vh - 64px);
    border-right: 1.5px solid var(--line);
    flex-shrink: 0;
    overflow-y: auto;
  }

  .docs-sidebar.active {
    transform: none;
  }

  .sidebar-overlay {
    display: none;
  }

  .close-sidebar {
    display: none !important;
  }

  .sidebar-header {
    display: none;
  }

  .toc-toggle span {
    display: inline;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 16px;
  }

  .toc-toggle span {
    display: none;
  }

  .toc-toggle {
    padding: 8px 12px;
  }

  .docs-sidebar {
    width: 280px;
    top: 64px;
    height: calc(100vh - 64px);
    transform: translateX(-100%);
  }

  .docs-sidebar.active {
    transform: translateX(0);
  }

  .close-sidebar {
    display: block !important;
  }

  .sidebar-overlay.active {
    display: block;
  }
}

@media (max-width: 480px) {
  .nav-container .logo {
    height: 26px;
  }

  .account-btn {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .account-dropdown {
    min-width: 180px;
    right: -8px;
  }

  .dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
  }

  .docs-sidebar {
    width: 260px;
  }
}
