
body {
  position: relative;
  z-index: 0;
}


.header {
  height: 55px;
align-items: center;
  
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;

  background-color: white;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: rgb(228, 228, 228);
}
/* Dark mode for .header */
.dark .header {
  background-color: #212121;
  border-bottom-color: #333;
}

.left-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: 3px;
}

/* === LOGO CONTAINER === */
.logo-container {
  display: flex;
  align-items: center;
  position: relative;
  margin-left: -31px;
  margin-top: 8px;
  cursor: pointer;
}

/* === LOGO WRAPPER (Red Ring) === */
.logo-wrapper {
  height: 84px;
  width: 84px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.logo-wrapper:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.7);
}


/* === HAMBURGER === */
.hamburger-menu {
  height: 24px;
  margin-left: 24px;
  margin-right: 16px;
  cursor: pointer;
  color: black;
}

.dark .hamburger-menu {
  color: skyblue;
}

/* === LOGO IMAGE (GIF) === */
.skynet-logo {
  height: 100%;
  width: 100%;
  border-radius: 50%;
  margin-top: 34px;
  object-fit: contain;
  transition: transform 0.3s ease;
  filter: hue-rotate(0deg) saturate(200%) brightness(1.1) drop-shadow(0 0 5px red);
}

/* Optional: extra bounce when hovering just the image */
.skynet-logo:hover {
  animation: logo-bounce 0.6s ease-in-out;
  filter: brightness(1.1);
}

.logo-container:hover .brand-text {
  color: #ff4d4d;
  text-shadow: 0 0 5px #ff4d4d;
}


/* === BRAND TEXT === */
.brand-text {
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: skyblue;
  margin-left: 10px; /* Better spacing than margin-right on logo */
}


.play-on-load {
  animation: logo-bounce 0.8s ease-in-out;
}


@keyframes logo-bounce {
  0%   { transform: scale(1) translateY(0) rotate(0deg); }
  30%  { transform: scale(1.1) translateY(-6px) rotate(-15deg); }
  60%  { transform: scale(1.05) translateY(3px) rotate(10deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}




.dark .brand-text {
  color: #90cdf4;
}

.middle-section {
  flex: 1;
  margin-left: 70px;
  margin-right: 35px;
  max-width: 500px;
  display: flex;
  align-items: center;
}

.search-bar {
  display: none;
  flex: 1;
  max-width: 85vw; 
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  margin: 0 8px;
}


.close-search-button {
  display: none;
  background: none;
  border: none;
  color: #555;
  font-size: 18px;
  padding: 4px;
}

.toggle-search-button {
  background: none;
  border: none;
  font-size: 18px;
  padding: 4px;
}

/* Dark mode for search bar */
.dark .search-bar {
  background-color: #121212;
  color: white;
  border-color: #555;
}

.search-bar::placeholder {
  font-size: 16px;
}

/* Dark mode placeholder text */
.dark .search-bar::placeholder {
  color: #aaa;
}

.search-button {
  height: 40px;
  width: 66px;
  background-color: rgb(240, 240, 240);
  border-width: 1px;
  border-style: solid;
  border-color: rgb(192, 192, 192);
  margin-left: -1px;
  margin-right: 10px;
}

.dark .search-button {
  background-color: #333;
  border-color: #555;
}

.search-button,
.voice-search-button,
.upload-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.search-button .tooltip,
.voice-search-button .tooltip,
.upload-icon-container .tooltip {
  position: absolute;
  background-color: gray;
  color: white;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 2px;
  font-size: 12px;
  bottom: -30px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  white-space: nowrap;
}

/* Tooltip background for dark mode */
.dark .tooltip {
  background-color: #555;
}


.search-button:hover .tooltip,
.voice-search-button:hover .tooltip,
.upload-icon-container:hover .tooltip {
  opacity: 1;
}

.search-icon {
  height: 24px;
  width: 24px;
  fill: currentColor;
  color: black;
}

.dark .search-icon {
  color: skyblue;
}
.voice-search-button {
  height: 40px;
  width: 40px;
  border-radius: 20px;
  border: none;
  background-color: rgb(245, 245, 245);
}

.dark .voice-search-button {
  background-color: #2a2a2a;
}

.voice-search-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  color: black;
}

.dark .voice-search-icon {
  color: skyblue;
}


/* Make close icon skyblue in dark mode */
.dark .close-search-button .close-icon path {
  fill: skyblue;
}


.right-section {
  width: 180px;
    position: relative;
  margin-right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.theme-toggle-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
    margin-left: 4px;
  margin-right: 4px;
}

.theme-toggle-icon {
  width: 24px;
  height: 24px;
}

.upload-icon-container {
  position: relative;
  cursor: pointer;
}

.upload-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  color: black;
}

.dark .upload-icon {
  color: skyblue;
   width: 24px;
  height: 24px;

}

.upload-dialog {
  position: absolute;
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 8px 0;
  min-width: 180px;
  z-index: 1000;
  transition: opacity 0.25s ease, transform 0.25s ease;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  right: 0; /* align right under the upload icon */
  margin-top: 8px;
  top: 40px;      
  right: 20px;
}

.upload-dialog.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.upload-options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.upload-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  color: var(--text-color);
  font-weight: 500;
  user-select: none;
}

.upload-option:hover,
.upload-option:focus {
  background-color: var(--hover-bg-color);
  outline: none;
  border-radius: 6px;
}

.upload-option-icon {
  width: 20px;
  height: 20px;
  filter: var(--icon-filter);
}


.skynet-apps-icon {
   width: 24px;
  height: 24px;
  fill: currentColor;
  color: black;
    display: block;
}

.dark .skynet-apps-icon {
  color: skyblue;
   width: 24px;
  height: 24px;

}

.notifications-icon {
   width: 24px;
  height: 24px;
  fill: currentColor;
  color: black;
}

.dark .notifications-icon {
  color: skyblue;
   width: 24px;
  height: 24px;

}
.notifications-icon-container {
  position: relative;
}

/* .notifications-count {
  position: absolute;
  top: -2px;
  right: -5px;
  background-color: rgb(200, 0, 0);
  color: white;
  font-size: 11px;
  padding-left: 5px;
  padding-right: 5px;
  padding-top: 2px;
  padding-bottom: 2px;
  border-radius: 10px;
} */

.current-user-picture {
  height: 32px;
  border-radius: 16px;
}




@media (min-width: 1000px) {
  .middle-section.search-active .search-bar {
    display: inline-block;
    flex-grow: 1;
    max-width: unset;
    margin: 0;
    transform: translateX(-19px);
    width: 600px;
  }
}





/* Responsive tweaks */
@media (max-width: 991px) {
  /* Hide skynet apps icon on tablet and smaller */
  .skynet-apps-icon {
    display: none;
  }

  /* Shrink gap in right-section to keep icons closer */
  .right-section {
    gap: 6px;
    display: flex;
    align-items: center;
  }

  
}

/* Smaller screens (mobile phones) */
@media (max-width: 767px) {


    /* Shrink and tighten hamburger menu */
   /* Shrink and tighten hamburger menu */
  .hamburger-menu {
    width: 24px;
    height: 24px;
    margin-right:14px;
  }



    /* Brand text smaller on small devices */
   /* Shrink logo and shift it left */
  .skynet-logo {
    width: 40px;
    margin-left: 4px;
  }

  .brand-text {
    font-size: 16px;
    transform: translateX(-48px); /* ✅ Shift JUST the text left */

}


      /* Reduce gap and shift left-section elements tighter */
  .left-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 4px;
  }



  /* Remove the search input, keep only the icons */
.middle-section {
  flex: 0 0 auto;
  margin-left: 4px;     /* ✅ shift it tighter left */
  overflow: hidden;
}

  .search-bar {
    display: none;
  }
  /* Keep search button visible for user to click */
 .search-button {
    padding: 4px;
    width: 28px;
    height: 28px;
  }
  
  /* Optionally hide voice search icon if you want more space */
  .voice-search-button {
    display: none; 
  }


  

   /* Right section alignment and shrinking */
/* Right section — shift left more! */
.right-section {
  display: flex;
  align-items: center;
  gap: 2px;               /* ✅ tighter spacing */
  margin-left: 8px;       /* ✅ pull it left! */
  padding-right: 0px;     /* ✅ eliminate right padding */
  flex-shrink: 1;         /* ✅ allow some shrinkage */
  flex-wrap: nowrap;
}


  /* Tighten individual icons */
  .right-section > * {
    margin: 0 !important;
    padding: 0 !important;
      flex-shrink: 1;
  }
  /* Maybe shrink icons slightly on small devices */

  /* Shrink icons even more for tight screens */
  .right-section svg,
  .right-section img,
  .right-section .upload-icon,
  .notifications-icon-container,
  .current-user-picture {
    width: 22px;
    height: 22px;
  }



   /* Adjust notification bubble */
  .notifications-count {
    font-size: 10px;
    top: -2px;
    right: -2px;
  }

    /* Reduce user picture size */
  .current-user-picture {
    border-radius: 50%;
    margin-left: 0; /* no gap */
    }




  .search-button,
.theme-toggle-icon-container,
.upload-icon-container {
  padding: 0;
  margin: 0;
}


.logo-container {
  display: flex;
  align-items: center;
  gap: 6px; /* ✅ Gives spacing between logo and brand text */
}

.middle-section.search-active {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 100%;
    justify-content: flex-start;
    padding-left: 6px;
    padding-right: 6px;
     margin-left: -12px; /* Instead of -20px */
    gap: 16px;
    overflow: visible;
      transform: translateX(-30px); /* ✅ Shift the entire middle section left */
  }

  .middle-section.search-active .search-bar {
    display: inline-block;
    flex-grow: 1;
    max-width: unset;
    margin: 0;
     transform: translateX(-19px);
  }

  .middle-section.search-active .close-search-button {
    display: inline-block;
     transform: translateX(-26px); /* ✅ Shift the 'X' left */
  }

  .middle-section.search-active .search-button {
    display: flex;
    transform: translateX(-38px); /* ✅ Move 🔍 icon further left */
  }


}

@media (max-width: 420px) {
  
  .skynet-apps-icon {
    display: none;
  }

  .brand-text {
  display: none;
}

}


/* Sign-In button style adjustments */
.sign-in-btn {
  background-color: skyblue;
  border: none;
  color: white;
  padding: 10px 16px;       /* increased size */
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 28px;          /* shifted left */
  position: relative;       /* for tooltip positioning */
}

/* Light mode: on hover */
.sign-in-btn:hover {
  background-color: deepskyblue;
}

/* Dark mode overrides */
.dark .sign-in-btn {
  background-color: black;
  color: red;
}
.dark .sign-in-btn:hover {
  opacity: 0.8;
}

/* Tooltip styling */
.sign-in-btn .tooltip-text {
  visibility: hidden;
  background-color: gray;
  color: white;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-80%);
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Hover state reveals tooltip */
.sign-in-btn:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Tooltip dark mode colors */
.dark .sign-in-btn .tooltip-text {
  background-color: #333;
  color: white;
}



/* HELP tooltip only, separate from other tooltips */
.right-section {
  position: relative; /* So the tooltip can be positioned absolutely within it */
}
.help-tooltip {
  position: absolute;

  background-color: #222;
  color: #eee;
  padding: 12px;
  border-radius: 4px;
    border: 1px solid red;
  font-size: 13px;
  max-width: 360px;
  min-width: 260px;
  white-space: normal;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateX(-70%); /* or -80%, experiment with the value */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.help-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
}


.help-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.help-icon-container {
  position: relative;
  display: inline-block;
}



.help-link {
  color: skyblue;
  text-decoration: none;
  font-size: 1.1em;
}

.help-link:visited {
  color: green;
}


/* Show on hover (desktop only) */
@media (hover: hover) {
  .help-icon-container:hover .help-tooltip {
    display: block;
  }
}

/* Show when active on mobile via JS */
.help-tooltip.active {
  display: block;
}