/* Sidebar Search Styling */
.sidebar-search {
  padding: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-search .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar-search .form-control {
  background: rgba(248, 249, 255, 0.9);
  border: 1px solid rgba(78, 115, 223, 0.2);
  border-radius: 8px;
  padding: 0.5rem 2.5rem 0.5rem 2.5rem;
  font-size: 0.875rem;
}

.sidebar-search .form-control:focus {
  background: white;
  border-color: rgba(78, 115, 223, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.1);
}

.sidebar-search .search-icon {
  position: absolute;
  left: 0.75rem;
  color: rgba(78, 115, 223, 0.6);
  font-size: 0.875rem;
  z-index: 2;
}

.sidebar-search .search-shortcut {
  position: absolute;
  right: 0.75rem;
  font-size: 0.7rem;
  color: rgba(78, 115, 223, 0.5);
  background: rgba(78, 115, 223, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  z-index: 2;
}

/* Enhanced Mobile TOC Fix */
@media (max-width: 767.98px) {
  #mobileTocBtn {
    display: none; /* Hide TOC toggle on mobile */
  }

  /* Ensure TOC is properly positioned and visible */
  .docs-toc {
    position: fixed;
    top: 0;
    right: -100%;
    width: 90%;
    max-width: 320px;
    height: 100vh;
    z-index: 1050;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
    background: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }

  .docs-toc.show {
    right: 0;
  }

  /* Ensure sidebar is also properly positioned */
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 90%;
    max-width: 320px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
    overflow-y: auto;
    background: white;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
  }

  .docs-sidebar.show {
    left: 0;
  }

  /* Mobile overlay improvements */
  .mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    display: none;
    backdrop-filter: blur(2px);
  }

  .mobile-overlay.show {
    display: block;
  }

  /* Mobile close button positioning */
  .mobile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    z-index: 1051;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .mobile-close-btn:hover {
    background: white;
    color: #495057;
    transform: scale(1.05);
  }

  /* Adjust content for mobile */
  .docs-content {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  /* Hide desktop elements on mobile */
  .content-actions {
    display: none !important;
  }
}
