/*
 * Copyright 2024 Joe Meszaros
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

.topnavbar {
  position: relative;
  width: 100%;
  height: 48px;
  background-color: #333;
  font-family: Arial, Helvetica, sans-serif;
  flex-shrink: 0;
}

.topnavbar a {
  float: left;
  font-size: 14px;
  color: white;
  text-align: center;
  padding: 12px 14px;
  text-decoration: none;
}

.mydropdown {
  float: left;
  overflow: hidden;
}

.mydropdown .dropbtn:disabled {
  color: rgb(92, 90, 90);
  cursor: not-allowed;
}

.mydropdown .dropbtn {
  cursor: pointer;
  font-size: 14px;
  border: none;
  outline: none;
  color: white;
  padding: 16px 14px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;
}

.topnavbar a:hover:not([disabled]),
.mydropdown:hover .dropbtn:not([disabled]),
.dropbtn:focus {
  background-color: #04aa6d;
}

.topnavbar .selected {
  background-color: #04aa6d;
}

.mydropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 300;
}

.mydropdown-content a {
  float: none;
  color: black;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.mydropdown .mydropdown-content img {
  padding: 0px;
  margin-right: 10px;
}

.mydropdown-show {
  display: block;
}

.mytooltip {
  position: relative;
  display: inline-block;
  z-index: 200;
}

.mytooltip .mytooltiptext {
  visibility: hidden;
  min-width: 140px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  border: 1px solid white;
  padding: 5px 5px;
  position: absolute;
  z-index: 200;
  top: 120%;
  left: 50%;
  margin-left: -70px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  /* Ensure tooltip is always on top */
  transform: translateZ(0);
  will-change: opacity, visibility;
}

/* Alternative positioning for problematic containers */
.mytooltip .mytooltiptext.fixed {
  position: fixed;
  z-index: 99999;
}

.mytooltip .mytooltiptext::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent white transparent;
}

.mytooltip:hover .mytooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Force tooltip visibility for debugging */
.mytooltip .mytooltiptext.show {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Hide tooltip when dropdown is visible */
.dropdown-open .mytooltiptext {
  visibility: hidden !important;
}
