/* ==========================================================================
   Documentation / Release Notes Layout
   Sidebar-content pattern for docs and release notes pages.
   Doc pages use their own nav (nav-docs.php) instead of the main navbar.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Docs Layout (sidebar + content)
   -------------------------------------------------------------------------- */
.docs-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  background-color: var(--techtv-midnight);
  border-right: 1px solid rgba(245, 241, 232, 0.08);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
}

.docs-sidebar-inner {
  height: 100%;
  overflow-y: auto;
  padding: 0 0 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 241, 232, 0.15) transparent;
}

.docs-sidebar-inner::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar-inner::-webkit-scrollbar-track {
  background: transparent;
}
.docs-sidebar-inner::-webkit-scrollbar-thumb {
  background: rgba(245, 241, 232, 0.15);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   Sidebar Header (logo + site navigation)
   -------------------------------------------------------------------------- */
.docs-sidebar-header {
  position: sticky;
  top: 0;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 40, 0.8);
  margin-bottom: 1rem;
  background: rgba(0, 0, 20, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 10;
}

.docs-sidebar-logo {
  display: block;
  margin-bottom: 0.875rem;
}

.docs-sidebar-logo img {
  display: block;
  height: 50px;
  width: auto;
  margin: 0 auto;
}

/* Site nav links inside sidebar */
.docs-sidebar-site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.docs-sidebar-site-nav .nav-link {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(245, 241, 232, 0.55);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.docs-sidebar-site-nav .nav-link:hover {
  color: var(--techtv-cream);
  background-color: rgba(245, 241, 232, 0.05);
}

.docs-sidebar-site-nav .nav-link.active {
  color: var(--techtv-orange);
  background-color: rgba(255, 149, 0, 0.08);
}

/* --------------------------------------------------------------------------
   Sidebar Section Title & Navigation Links
   -------------------------------------------------------------------------- */
.docs-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(245, 241, 232, 0.45);
  padding: 0 1.25rem;
  margin-bottom: 0.75rem;
}

.docs-sidebar-nav {
  display: flex;
  flex-direction: column;
}

/* Year grouping */
.sidebar-year-group {
  margin-bottom: 0;
}

.sidebar-year-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  background: none;
  border: none;
  color: var(--techtv-cream);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.15s ease;
  margin-top: 0.75rem;
}

.sidebar-year-toggle:first-child {
  margin-top: 0;
}

.sidebar-year-toggle:hover {
  color: var(--techtv-orange);
}

.sidebar-year-toggle.active {
  color: var(--techtv-orange);
}

.sidebar-year-label {
  flex: 1;
  text-align: left;
}

.sidebar-year-icon {
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.sidebar-year-toggle[aria-expanded="true"] .sidebar-year-icon {
  transform: rotate(0deg);
}

.sidebar-year-toggle[aria-expanded="false"] .sidebar-year-icon {
  transform: rotate(-90deg);
}

.sidebar-year-group .collapse.show {
  display: flex;
  flex-direction: column;
}

/* Documentation section grouping */
.sidebar-section-group {
  margin-bottom: 1rem;
}

/* Collapsible section toggle (similar to year toggle) */
.sidebar-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.15s ease;
  margin-top: 0.5rem;
}

.sidebar-section-toggle:first-child {
  margin-top: 0;
}

.sidebar-section-toggle:hover {
  color: var(--techtv-orange);
}

.sidebar-section-toggle.active {
  color: var(--techtv-orange);
}

.sidebar-section-label {
  flex: 1;
  text-align: left;
}

.sidebar-section-icon {
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-section-icon {
  transform: rotate(0deg);
}

.sidebar-section-toggle[aria-expanded="false"] .sidebar-section-icon {
  transform: rotate(-90deg);
}

.sidebar-section-group .collapse.show {
  display: flex;
  flex-direction: column;
}

/* Static section title (non-collapsible, for backward compatibility) */
.sidebar-section-title {
  padding: 0.5rem 1.25rem 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Static section link (non-collapsible link, like "Release Notes") */
.sidebar-section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  background: none;
  transition: color 0.15s ease;
  color: var(--techtv-cream);
}

.sidebar-section-link:hover {
  color: var(--techtv-orange);
}

.sidebar-section-link svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-section-arrow {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sidebar-section-link:hover .sidebar-section-arrow {
  opacity: 1;
  transform: translateX(2px);
  color: var(--techtv-orange);
}

.docs-sidebar-link {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  color: var(--techtv-cream);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.docs-sidebar-link:hover {
  background-color: rgba(245, 241, 232, 0.04);
  color: var(--techtv-orange);
}

.docs-sidebar-link:active {
  background-color: rgba(245, 241, 232, 0.04);
  color: var(--techtv-red);
}
.docs-sidebar-link.active {
  background-color: rgba(255, 149, 0, 0.08);
  border-left-color: var(--techtv-orange);
  color: var(--techtv-orange);
}

.docs-sidebar-build {
  font-weight: 600;
}

.docs-sidebar-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 0.75rem;
  color: rgba(245, 241, 232, 0.6);
  font-weight: 400;
}

.docs-sidebar-link.active .docs-sidebar-date {
  color: rgba(255, 149, 0, 0.5);
}

/* Latest badge */
.docs-badge-latest {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  background: var(--techtv-gradient);
  color: white;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Mobile-only Sticky Navbar (hidden on desktop via d-lg-none)
   -------------------------------------------------------------------------- */
.docs-mobile-navbar {
  position: sticky;
  top: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 241, 232, 0.08);
}

.docs-mobile-burger {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.docs-mobile-burger:hover {
  background-color: rgba(245, 241, 232, 0.08);
}

.docs-mobile-burger:active {
  background-color: rgba(245, 241, 232, 0.12);
}

.docs-mobile-logo {
  display: flex;
  align-items: center;
}

.docs-mobile-logo img {
  height: 28px;
  width: auto;
}

/* --------------------------------------------------------------------------
   Content Area
   -------------------------------------------------------------------------- */
.docs-content {
  max-width: 800px;
}

/* Flex min-width fix (not available in Bootstrap 5.3) */
.min-w-0 {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Release Article
   -------------------------------------------------------------------------- */
.release-article + .release-article,
.release-article + #dynamicReleases:has(.release-article) {
  padding-top: 1.6rem;
  margin-top: 1.6rem;
  border-top: 1px solid #37281c;
}
.release-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--techtv-font-mono);
  border-radius: 4px;
  background-color: rgba(245, 241, 232, 0.08);
  color: var(--techtv-cream);
  border: 1px solid rgba(245, 241, 232, 0.1);
}

.release-date,
.release-size,
.release-os {
  font-size: 0.75rem;
  color: rgba(245, 241, 232, 0.6);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Release Content Typography
   -------------------------------------------------------------------------- */
.release-body {
  line-height: 1.7;
}

.release-heading.release-h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--techtv-cream);
  margin: 0;
  line-height: 1.3;
}

.release-heading.release-h2 .docs-badge-latest {
  position: relative;
  top: -2px;
  margin-left: 0.5rem;
}

.release-heading.release-h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--techtv-orange);
  margin: 1.75rem 0 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.release-heading.release-h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--techtv-cream);
  margin: 1.25rem 0 0.5rem;
}

/* --------------------------------------------------------------------------
   Documentation Content Typography (mirrors release typography)
   -------------------------------------------------------------------------- */
.docs-content-body {
  line-height: 1.7;
}

.docs-heading.docs-h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--techtv-cream);
  margin: 0 0 1.5rem;
  line-height: 1.3;
}

.docs-heading.docs-h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--techtv-cream);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

.docs-heading.docs-h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--techtv-orange);
  margin: 1.75rem 0 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.docs-heading.docs-h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--techtv-cream);
  margin: 1.25rem 0 0.5rem;
}

.docs-text {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.docs-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.docs-list li {
  padding-left: 0.25rem;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.docs-list li code {
  font-size: 0.8125em;
}

.release-text {
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}

.release-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1rem;
}

.release-list li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.375rem;;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.release-list li::before {
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-size: 1rem;
  line-height: 1;
}

/* Bug fix icon */
.release-list li[data-icon="bug"]::before {
  content: "🐞";
}

/* New feature icon (rocket) */
.release-list li[data-icon="feature"]::before {
  content: "🚀";
}

/* Improvement icon */
.release-list li[data-icon="improvement"]::before {
  content: "✨";
}

/* Removed/deprecated icon */
.release-list li[data-icon="removed"]::before {
  content: "🗑️";
}

/* Security icon */
.release-list li[data-icon="security"]::before {
  content: "🔒";
}

/* Change icon */
.release-list li[data-icon="change"]::before {
  content: "🛠️";
}

/* Known issues icon */
.release-list li[data-icon="known-issue"]::before {
  content: "⚠️";
}

.release-list li code {
  font-size: 0.8125em;
}

/* Release divider — clear separator between releases */
.release-divider {
  border: none;
  border-top: 2px solid rgba(245, 241, 232, 0.7);
  margin: 2.5rem 0 2rem;
}

/* --------------------------------------------------------------------------
   Responsive: Tablet & Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  /* Sidebar becomes a slide-out drawer */
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    z-index: 1070;
    transition: left 0.25s ease;
    box-shadow: none;
  }

  .docs-sidebar.sidebar-open {
    left: 0;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.6);
  }
}

@media (max-width: 575.98px) {
  .release-heading.release-h2 {
    font-size: 1.25rem;
  }
}

/* Sidebar overlay for mobile */
.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1065;
}

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

/* --------------------------------------------------------------------------
   Search Box (in sidebar)
   -------------------------------------------------------------------------- */
.docs-search-box {
  position: relative;
  padding: 0 1.25rem;
}

.docs-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  font-size: 0.8125rem;
  color: var(--techtv-cream);
  background-color: rgba(245, 241, 232, 0.05);
  border: 1px solid rgba(245, 241, 232, 0.1);
  border-radius: 6px;
  outline: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.docs-search-input::placeholder {
  color: rgba(245, 241, 232, 0.45);
}

.docs-search-input:focus {
  background-color: rgba(245, 241, 232, 0.08);
  border-color: rgba(255, 149, 0, 0.5);
}

.docs-search-icon {
  position: absolute;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245, 241, 232, 0.35);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Search Modal
   -------------------------------------------------------------------------- */
.docs-search-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.docs-search-modal.active {
  display: flex;
}

.docs-search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.docs-search-modal-content {
  position: relative;
  width: 90%;
  max-width: 640px;
  background: var(--techtv-midnight);
  border: 1px solid rgba(245, 241, 232, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: searchModalSlideIn 0.2s ease-out;
}

@keyframes searchModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.docs-search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(245, 241, 232, 0.08);
}

.docs-search-modal-input {
  flex: 1;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  color: var(--techtv-cream);
  background: transparent;
  border: none;
  outline: none;
}

.docs-search-modal-input::placeholder {
  color: rgba(245, 241, 232, 0.5);
}

.docs-search-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: rgba(245, 241, 232, 0.7);
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.docs-search-modal-close:hover {
  background-color: rgba(245, 241, 232, 0.08);
  color: var(--techtv-cream);
}

.docs-search-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.docs-search-modal-body::-webkit-scrollbar {
  width: 6px;
}

.docs-search-modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.docs-search-modal-body::-webkit-scrollbar-thumb {
  background: rgba(245, 241, 232, 0.15);
  border-radius: 3px;
}

/* Search prompt (shown when no query) */
.docs-search-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: rgba(245, 241, 232, 0.35);
  text-align: center;
}

.docs-search-prompt svg {
  margin-bottom: 1rem;
  opacity: 0.4;
}

.docs-search-prompt p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Search loading state */
.docs-search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: rgba(245, 241, 232, 0.7);
  font-size: 0.875rem;
}

/* Search results */
.docs-search-results-header {
  padding: 0.75rem 1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(245, 241, 232, 0.6);
}

.docs-search-result {
  display: block;
  padding: 0.875rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 241, 232, 0.04);
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.docs-search-result:hover {
  background-color: rgba(245, 241, 232, 0.04);
}

.docs-search-result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.docs-search-result-build {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--techtv-orange);
}

.docs-search-result-version {
  font-size: 0.75rem;
  color: rgba(245, 241, 232, 0.6);
}

.docs-search-result-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--techtv-cream);
  margin-bottom: 0.25rem;
}

.docs-search-result-match {
  font-size: 0.8125rem;
  color: rgba(245, 241, 232, 0.7);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.docs-search-result-match mark {
  background-color: rgba(255, 149, 0, 0.2);
  color: var(--techtv-orange);
  padding: 0.1rem 0.2rem;
  border-radius: 2px;
}

.docs-search-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  color: rgba(245, 241, 232, 0.35);
  text-align: center;
}

.docs-search-no-results svg {
  margin-bottom: 1rem;
  opacity: 0.3;
}

.docs-search-no-results p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Keyboard shortcuts hint */
.docs-search-keyboard-hint {
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: rgba(245, 241, 232, 0.5);
  text-align: center;
  border-top: 1px solid rgba(245, 241, 232, 0.06);
}

.docs-search-keyboard-hint kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  font-family: var(--techtv-font-mono);
  font-size: 0.7rem;
  background-color: rgba(245, 241, 232, 0.1);
  border: 1px solid rgba(245, 241, 232, 0.2);
  border-radius: 3px;
  margin: 0 0.2rem;
}
