/* Enhanced Mobile Responsiveness for Single Blog Page */

/* Ensure TOC visibility on all devices */
.desktop-toc {
  display: block !important;
}

.mobile-toc {
  display: none !important;
}

/* Table of Contents Styles */
.rightBarSection {
  margin-bottom: 30px;
  background-color: var(--bgSoft);
  border-radius: 10px;
  padding: 15px;
}

.rightBarTitle {
  margin-bottom: 15px;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--bg);
  padding-bottom: 10px;
}

.tableOfContents {
  max-height: 400px;
  overflow-y: auto;
}

.tableOfContents ul {
  list-style: none;
  padding-left: 0;
}

.tableOfContents ul ul {
  padding-left: 15px;
}

.tableOfContents li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.tableOfContents a {
  color: var(--textSoft);
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.9rem;
}

.tableOfContents a:hover {
  color: var(--text);
}

/* Share buttons styles */
.shareButtons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shareButton {
  background-color: var(--bg);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

.shareButton:hover {
  transform: translateY(-2px);
}

/* Mobile Responsiveness for Single Blog Page */
@media (max-width: 1024px) {
  .singleBottom {
    flex-direction: column;
  }
  
  .desktop-toc {
    display: none !important;
  }
  
  .mobile-toc {
    display: block !important;
    margin-bottom: 30px;
  }
  
  .singleContent {
    width: 100%;
    overflow-x: hidden;
  }
  
  .singleContent img {
    max-width: 100%;
    height: auto;
  }
  
  .singleContent pre {
    max-width: 100%;
    overflow-x: auto;
  }
  
  /* Ensure code blocks don't cause horizontal scrolling */
  .singleContent pre code {
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  
  /* Improve table display on mobile */
  .singleContent table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Enhance search container on all devices */
.search-container {
  width: 100%;
  max-width: 600px;
  background-color: var(--bg);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.search-header {
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--bgSoft);
  position: relative;
  width: 100%;
}

.search-header input {
  width: 100%;
  padding: 10px 40px 10px 10px;
  font-size: 1.1rem;
  border: none;
  background: none;
  color: var(--text);
  outline: none;
  flex: 1;
}

/* Mobile styles for search */
@media (max-width: 768px) {
  .search-container {
    margin: 0 10px;
    max-height: 90vh;
    width: 90%;
  }

  .search-header {
    padding: 15px;
    position: relative;
    width: 100%;
  }

  .search-header input {
    padding: 10px;
    padding-right: 45px;
    width: 100%;
    flex: 1;
  }

  .close-search {
    width: 30px;
    height: 30px;
    right: 15px;
    padding: 0;
    background-color: var(--bgSoft);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  .close-search svg {
    width: 16px;
    height: 16px;
  }
}
