.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
}

.sidebar-logo img {
    max-width: 80%;
    height: auto;
}

.left-buttons {
    position: relative;
}

#sidebar .sidebar-scrollbox {
    overflow-y: scroll;
    /* Force Show scrollbars */
}

#bookmarks li {
    list-style-type: disc;
}

/* Colored Tag Span. Displayed at the top of tagged pages */
.tag {
    margin: 0 5px 10px 0;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Tag Search Styles */
.tags-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-fg);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    z-index: 1000;
    min-width: 200px;
    margin-top: 5px;
}

#tag-search {
    width: 100%;
    padding: 10px 16px;
    box-sizing: border-box;
    margin-bottom: 10px;
    border: 1px solid var(--searchbar-border-color);
    border-radius: 3px;
    background-color: var(--searchbar-bg);
    color: var(--searchbar-fg);
}

.tags-list {
    box-sizing: border-box;
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-color: var(--sidebar-fg) var(--sidebar-bg);
}

.tags-list li {
    padding: 5px 0;
}

.tags-list li:hover {
    color: var(--sidebar-active);
}

.tags-list label {
    display: flex;
    align-items: flex-start;
}

.tags-list input[type="checkbox"] {
    margin-right: 5px;
    margin-top: 4px;
}

#sidebar.filtered #toc .chapter-item:has(> *:not(.selected)) {
    display: none;
}

.announcement-stripe {
    width: auto;
    background-color: #5e1118;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    padding: 10px;
    text-align: center;
    z-index: 1000;
    top: 0;
    left: 0;
}

.announcement-stripe p {
    margin: 0;
}

/* Add this new style for the sidebar */
#sidebar {
    z-index: 1001;
    /* Higher z-index than the announcement stripe */
}

/* Add padding to the page wrapper to prevent content from being hidden behind the fixed banner */


/* Footer styles */
#page-footer {
    margin-top: 1.5rem;
    padding: 1rem 0 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(20, 16, 49, 0.1); /* Based on #141031 */
    background-color: transparent;
}

#page-footer .footer-content {
    max-width: 1200px; /* Wider container to fit content */
    margin: 0 auto;
    padding: 0 15px;
}

#page-footer .footer-text-line {
    white-space: nowrap;
    margin-bottom: 0.3rem;
    line-height: 1.1;
}

#page-footer .footer-title {
    font-size: 2.2rem;
    font-weight: 300;
    color: #4339db; /* SEAL Blue from the color palette */
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

#page-footer .footer-message {
    font-size: 1.6rem;
    color: #6C757D; /* Gray from the SEAL color palette */
    margin-right: 0.5rem;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.1;
}

#page-footer .highlight {
    font-style: italic; /* Keep italic */
    /* Removed font-weight: bold */
}

#page-footer .footer-link {
    font-size: 1.4rem;
    display: inline;
    vertical-align: middle;
    margin-left: 0.3rem;
}

#page-footer .footer-link a {
    color: #4339db; /* SEAL Blue */
    text-decoration: underline;
    transition: color 0.3s ease;
}

#page-footer .footer-link a:hover {
    color: #352eb0; /* Darker SEAL Blue */
}

/* Only allow wrapping on small screens */
@media (max-width: 1200px) {
    #page-footer .footer-text-line {
        white-space: normal;
    }
    
    #page-footer .footer-title,
    #page-footer .footer-message,
    #page-footer .footer-link {
        display: inline;
    }
}

/* Stack elements on very small screens */
@media (max-width: 768px) {
    #page-footer .footer-title,
    #page-footer .footer-message,
    #page-footer .footer-link {
        display: block;
        margin: 0 0 0.2rem 0;
    }
}

#page-footer .footer-cta {
    margin-top: 0.4rem;
}

#page-footer .footer-cta a {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 500;
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border: 2px solid #4339db;
    background-color: #4339db;
    border-radius: 30px;
    transition: all 0.3s ease;
}

#page-footer .footer-cta a:hover {
    background-color: #352eb0;
    border-color: #352eb0;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 57, 219, 0.2);
}

#page-footer .footer-cta a i {
    margin-right: 5px;
}

/* Dark theme styling for the footer */
html.ayu #page-footer,
html.coal #page-footer,
html.navy #page-footer {
    border-color: rgba(255, 255, 255, 0.05);
}

html.ayu #page-footer p,
html.coal #page-footer p,
html.navy #page-footer p {
    color: #FFFFFF; /* White for dark themes */
}

html.ayu #page-footer .footer-message,
html.coal #page-footer .footer-message,
html.navy #page-footer .footer-message {
    color: #a8adb2; /* Lighter gray for dark themes */
}

html.ayu #page-footer .footer-title,
html.coal #page-footer .footer-title,
html.navy #page-footer .footer-title {
    color: #6b63e8; /* Brighter SEAL Blue for dark themes */
}

html.ayu #page-footer .footer-link a,
html.coal #page-footer .footer-link a,
html.navy #page-footer .footer-link a {
    color: #6b63e8; /* Brighter SEAL Blue for dark themes */
}

html.ayu #page-footer .footer-link a:hover,
html.coal #page-footer .footer-link a:hover,
html.navy #page-footer .footer-link a:hover {
    color: #8c85f0; /* Even brighter SEAL Blue for dark themes */
}

html.ayu #page-footer .footer-cta a,
html.coal #page-footer .footer-cta a,
html.navy #page-footer .footer-cta a {
    color: #FFFFFF; /* White text for dark themes */
    border-color: #6b63e8; /* Brighter SEAL Blue for dark themes */
    background-color: #6b63e8; /* Brighter SEAL Blue for dark themes */
}

html.ayu #page-footer .footer-cta a:hover,
html.coal #page-footer .footer-cta a:hover,
html.navy #page-footer .footer-cta a:hover {
    background-color: #8c85f0; /* Even brighter SEAL Blue for dark themes */
    border-color: #8c85f0; /* Even brighter SEAL Blue for dark themes */
    color: #1a1a1a; /* Darker background for contrast */
    box-shadow: 0 4px 8px rgba(107, 99, 232, 0.3); /* Brighter SEAL Blue shadow */
}

/* Remove previously added unnecessary styles */
.contribute-message {
    display: none;
}

/* Additional contributor styles */
.contributors-container {
  margin: 0 0 1rem 1rem;
  padding: 0.4rem;
  border: 1px solid var(--sidebar-non-existant);
  border-radius: 0.3rem;
  background-color: var(--sidebar-bg);
  opacity: 0.9;
  width: 200px;
  float: right;
  clear: right;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  margin-bottom: 1.5rem; /* Add space below */
  margin-left: 1.5rem; /* Increase left margin for better text wrapping */
}

/* Force text to wrap tightly around the contributors box */
main p {
  overflow: auto; /* Ensures wrapping around floated elements */
}

/* Ensure tags are displayed properly */
.tags {
  display: block;
  margin-top: 1rem; /* Add space above tags to separate from contributors */
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  clear: left;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  color: white;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  height: auto;
}

.contributors-title {
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--fg);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  font-weight: bold;
}

.contributors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}

.contributor {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 1rem;
  background-color: var(--theme-popup-bg);
  color: var(--fg);
  margin-bottom: 0.15rem;
}

/* Avatar styling */
.contributor.with-avatar {
  padding-left: 1.4rem;
  background-size: 1rem 1rem;
  background-repeat: no-repeat;
  background-position: 0.2rem center;
}

/* Dark theme adjustments */
html.ayu .contributors-container,
html.coal .contributors-container,
html.navy .contributors-container {
  border-color: rgba(255, 255, 255, 0.1);
}

html.ayu .contributors-title,
html.coal .contributors-title,
html.navy .contributors-title {
  border-color: rgba(255, 255, 255, 0.05);
}

/* Contributor page styling */
.contributors-page-container {
  margin: 2rem 0;
}

.contributors-description {
  max-width: 800px;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.contributors-divider {
  margin: 2rem 0;
  border: 0;
  height: 1px;
  background: #e1e4e8;
}

.contributors-group {
  margin-bottom: 3rem;
}

.contributors-group h2 {
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e1e4e8;
}

.contributors-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.contributor-card {
  background: var(--sidebar-bg);
  border: 1px solid var(--theme-popup-border);
  border-radius: 6px;
  padding: 0.75rem 0.5rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.contributor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.contributor-header {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.contributor-name {
  font-weight: 600;
  font-size: 1.5rem;
  margin-right: 0.5rem;
  word-break: break-word;
}

.contributor-badge {
  font-size: 1.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 500;
  margin-left: 0.5rem;
}

.steward-badge {
  background-color: #0366d6;
  color: white;
}

.contributor-role {
  font-size: 1.725rem;
  color: #586069;
  margin-bottom: 0.75rem;
}

.contributor-company {
  font-size: 1.725rem;
  color: var(--fg);
  margin: 0.5rem 0 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  background-color: var(--quote-bg, rgba(0,0,0,0.05));
  border: 1px solid var(--theme-popup-border);
  border-radius: 4px;
  display: inline-block;
  text-align: center;
  width: auto;
  margin-left: auto;
  margin-right: auto;
}

/* Dark theme specific adjustments */
html.ayu .contributor-company,
html.coal .contributor-company,
html.navy .contributor-company {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.contributor-description {
  font-size: 1.38rem;
  line-height: 1.5;
  color: var(--fg);
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed var(--theme-popup-border);
  padding-bottom: 1rem;
  text-align: center;
}

.contributor-social {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.social-icon {
  color: #586069;
  transition: color 0.2s;
  font-size: 1.8rem;
}

.social-icon:hover {
  color: var(--icons-hover);
}

.contributor-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
  border: 2px solid var(--theme-popup-border);
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  background-color: var(--sidebar-bg);
}

.contributor-contributions {
  font-size: 2.2rem;
  color: #586069;
  margin-bottom: 0.75rem;
}

.pages-button {
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--sidebar-active);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 0.5rem;
}

.pages-button:hover {
  background-color: var(--sidebar-active-hover);
}

.pages-container {
  margin-top: 0.5rem;
  width: 100%;
  font-size: 0.8rem;
  color: var(--fg);
  max-height: 200px;
  overflow-y: auto;
}

.pages-list {
  padding-left: 1.5rem;
  margin: 0;
}

.pages-container .page-item:before {
  content: "•";
  margin-right: 0.25rem;
  color: var(--sidebar-active);
}

.page-item {
  margin-bottom: 0.25rem;
  list-style-type: none;
}

.pages-list a {
  color: var(--fg);
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
}

.pages-list a:hover {
  text-decoration: underline;
  color: var(--sidebar-active);
}

/* Core contributors specific styling */
.core-group .contributor-card {
  border-left: 3px solid #28a745;
}

/* Stewards specific styling */
.steward-group .contributor-card {
  border-left: 3px solid #0366d6;
}

/* Featured contributors styling */
.featured-group .contributor-card {
  border-left: 3px solid #f6c32c;
}

/* Regular contributors styling */
.general-group .contributor-card {
  border-left: 3px solid #6f42c1;
}

/* Lead contributors specific styling */
.lead-group .contributor-card {
  border-left: 3px solid #e34c26;
}