.fixed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    height: var(--expanded-header-height);
    width: 100%;
    background-color: var(--header-background-color);
    z-index: 1000;
    padding: 0px;
    box-shadow: 0 1px 2px var(--shadow-color);
    transition: height 0.3s ease;
}

.fixed-header.scrolled {
    height: var(--main-header-height);
}

#logo-and-menu {
    display: flex; 
    align-items: center;
    width: 100%;
    justify-content: center;
    padding-right: 20px;
}

.fixed-header img {
    height: var(--expanded-header-height);
    display: flex;
    position: block;
    left: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    position: relative;
    left: 0;
}

.fixed-header.scrolled img {
    height: var(--main-header-height);
}

.toggle-btn {
  display: none;  /* media query overrides for small screens */
  background-color: transparent;
  border: none;
  width: var(--button-width);
  height: var(--button-height);
  margin-left: 20px;
  transform: rotate(0deg) translateZ(0); 
  cursor: pointer;
  z-index: 1001; 
}

.toggle-btn span {
  display: flex;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--primary-color);
  border-radius: 1px;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.toggle-btn span:nth-child(1) {
  top: 0px;
}

.toggle-btn span:nth-child(2),.toggle-btn span:nth-child(3) {
  top: calc(var(--button-height) / 2);
}

.toggle-btn span:nth-child(4) {
  top: var(--button-height);
}

.toggle-btn.open span:nth-child(1) {
  top: calc((var(--button-height) / 2));
  width: 0%;
  left: 50%;
}

.toggle-btn.open span:nth-child(2) {
  transform: rotate(45deg);
}

.toggle-btn.open span:nth-child(3) {
  transform: rotate(-45deg);
}

.toggle-btn.open span:nth-child(4) {
  top: calc((var(--button-height) / 2));
  width: 0%;
  left: 50%;
}

.toggle-btn:hover span {
    background-color: var(--hamburger-hover-color);
}

/* common menu styles for sidebar and header menu */

#headerMenu ul,
.sidebar ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

#headerMenu a,
.sidebar a  {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    display: inline-block;
    border: 0px solid transparent;
    transition: color 0.2s ease;
}

#headerMenu a:hover,
#headerMenu a:focus,
.sidebar a:hover,
.sidebar a:focus  {
    color: var(--thermist-blue);
    text-decoration: none;
    outline: none;
    background-color: transparent;
}

/* Menu for large screens */
#headerMenu {
    display: flex;  /* media query overrides for small screens */
    height: 100%;
    margin-left: -10px; 
}

#headerMenu ul {
    height: 100%;
    flex-direction: row;
    align-items: center;
}

#headerMenu li {
    margin: 0 6px; 
    display: flex;
    align-items: center;
}

#headerMenu a {
    padding: 5px 10px;
}

.right-header-links {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header-about-link {
    color: #808080;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
}

.header-about-link:hover {
    background-color: var(--sidebar-background-color);
    text-decoration: none;
}

/* free calculators dropdown */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    padding: 8px 10px;  /* Match the padding of other menu items */
    margin-bottom: -2px;
    display: inline-block;
    line-height: normal;  /* Reset line height */
    vertical-align: middle;  /* Align with other items */
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--neutral-color);
    min-width: 200px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    visibility: hidden;
    opacity: 0;
    transition: all 0.2s ease;
    transform: translateY(-10px);
    padding: 0 0;
    border-radius: 5px;
    overflow: hidden;
}

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

.dropdown-content ul {
    display: flex;
    flex-direction: column !important; /* Force vertical layout */
    align-items: stretch;
    height: auto;
    width: 100%;
    margin: 0;
    padding: 0;
}

.dropdown-content li {
    width: 100%;
    display: block;
    margin: 0 !important; /* Override the horizontal menu margins */
}

.dropdown-content a {
    padding: 8px 15px;
    display: block;
    width: 100%;
    white-space: nowrap;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    box-sizing: border-box;
}

.dropdown-content a:hover {
    background-color: var(--sidebar-background-color);
}

/* Shorter divider lines between items */
.dropdown-content li:not(:last-child) {
    position: relative;
}

.dropdown-content li:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5px;
    right: 5px;
    height: 1px;
    background-color: var(--sidebar-background-color);
}

.menu-item {
    transition: all 0.3s ease; /* Match header transition timing */
}

.menu-item a {
    transition: all 0.3s ease; /* Match header transition timing */
    display: flex;
    align-items: center;
    height: 100%;
}

/* to center logo in header for small screens */ 
.spacer {
    display: none;  /* media query overrides for small screens */
    width: var(--button-width);
    margin-right: 20px;
}

.sidebar {
    background-color: var(--neutral-color);
    position: fixed;
    top: var(--main-header-height);
    left: 0;
    height: 100%;
    width: var(--sidebar-width);
    display: none;
    flex-direction: column;
    justify-content: top;
    align-items: left;
    padding: 10px 0em;
    box-shadow: 2px 2px 8px var(--shadow-color);
    z-index: 101;
}

.sidebar.collapsed {
    width: 0;
    justify-content: center; 
    align-items: flex-start;
    overflow: hidden;
    padding: 0em 0em;
}

.sidebar .menu-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar .menu-item.section-header {
    color: var(--select-color);
    font-weight: 500;
    padding: 12px 15px;
    background-color: var(--neutral-color);
    border-bottom: 1px solid var(--sidebar-background-color);
}

.sidebar .menu-item.section-item {
    padding-left: 25px;
    border-left: 3px solid transparent;
}

.sidebar .menu-item.section-item:hover {
    border-left: 3px solid var(--thermist-blue);
    background-color: transparent;
    color: var(--thermist-blue);
}

.sidebar ul {
    flex-direction: column;
}

.sidebar li {
  margin: 0*var(--sidebar-up-down-padding) 0;
}

.sidebar a {
    padding: var(--sidebar-up-down-padding) var(--main-margins);
}



/* Sidebar dropdown styles */
.sidebar .dropdown-section {
    cursor: pointer;
}

.sidebar-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sidebar-up-down-padding) var(--main-margins);
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-dropdown-content {
    max-height: 0;
    overflow: hidden;
    list-style: none;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s ease-out;
}

.sidebar .dropdown-section.active .sidebar-dropdown-content {
    max-height: 200px; /* Adjust this value based on your content height */
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.sidebar .dropdown-section.active .dropdown-arrow {
    transform: rotate(180deg);
}

.overlay {
    display: none;
    background: rgba(0, 0, 0, 0.5); 
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

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

/* when screen width is too small to show header menu */
@media screen and (max-width: 773px) {
    .toggle-btn {
        display: flex;
    }

    #headerMenu {
        display: none;
    }

    .spacer {
        display: block;
    }

    .right-header-links {
        display: none;
    }
}

/* Footer styles */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--neutral-color);
    padding: 10px var(--offset-distance);
    font-size: 0.8rem;
    color: var(--select-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--select-and-input-border-color);
    z-index: 999;
    height: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.footer.visible {
    transform: translateY(0);
}

.footer-left {
    margin-right: auto;
}

/* Add these new styles for the footer links */
.footer-left a {
    text-decoration: none;
    color: inherit;
}

.footer-left a:hover {
    text-decoration: underline;
}

.footer-right a {
    color: var(--thermist-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.footer-right a:hover {
    opacity: 0.8;
}

.linkedin-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: brightness(0) saturate(100%) invert(50%) sepia(0%) saturate(0%) hue-rotate(153deg) brightness(96%) contrast(92%); /* This will make it #808080 */
}
