body, html {
    overflow: hidden;
    height: 100vh;
  }
  

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
  }

/* SIDE BAR MENU */
.sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    margin-top: clamp(70px, 6vh, 200px) - 100vh;
    left: -25vw;
    width: 25vw;
    height: calc(100% - clamp(70px, 6vh, 200px));
    background-color: white;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.2);
    padding: 0px;
    z-index: 9999;
}
@media (max-width: 1000px) {
    .sidebar {
        width: 300px;
        left: -300px;
    }
}
@media (max-width: 768px) {
    .sidebar {
        width: 100vw;
        left: -100vw;
    }
}

.sidebar-title{
    background-color: #f0e9da;
    border-left: 3.5px solid #ad9c70;
    box-shadow: inset 0px -1px 3px rgba(0, 0, 0, 0.15), inset 0px 1px 3px rgba(0, 0, 0, 0.15);
}


.sidebar-title h3{
    font-size:1.5rem;
}
.igrf-link{
    font-size:0.9rem;
}

/* FONTSIZES */
@media (max-width: 1400px) { 
    .sidebar h4, 
    .sidebar label b, 
    .sidebar button span,
    .sidebar select, 
    .sidebar input,
    .sidebar .form-check-label {
        font-size: 0.85rem;
    }

    .sidebar-title h3{
        font-size:1.1rem;
    }

    .igrf-link{
        font-size:0.85rem;
    }
}

@media (max-width: 768px) {
    .sidebar h4, 
    .sidebar label b, 
    .sidebar button span,
    .sidebar select, 
    .sidebar input,
    .sidebar .form-check-label {
        font-size: 0.8rem;
    }

    .igrf-link{
        font-size:0.8rem;
    }

    .sidebar-title h3{
        font-size:0.9rem;
    }
}


.sidebar.active {
    position: fixed;
    left: 0;
}
.sidebar:not(.active) {
    position: absolute;
}

.sidebar-body {
    flex-grow: 1;
    overflow-y: auto;
}
.sidebar-footer{
    position:sticky;
    width:100%;
    bottom:0;
    padding:10px;
}
.sidebar-group{
    background-color: white;
}

/* MENU */
.menu-btn {
    cursor: pointer;
}
.main-nav{
    height:clamp(70px, 6vh, 200px);
    z-index:9999
}

#menuToggle {
    background-image: url('/data_service/models_compass/utils/menu.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    padding: 10px;
    height:35px;
    width:35px;
}

#menuToggle.active {
    background-image: url('/data_service/models_compass/utils/menu_open.svg');
    height:35px;
    width:35px;
}

/* UTILS */
.igrf-map{
    height: calc(100vh - clamp(70px, 6vh, 200px));
}

.main{
    overflow-y: hidden!important;
}

/* When the popup should come from below, add .popup-below to its container */
.leaflet-popup.popup-below {
    top: 30px !important;
    margin-top: 0 !important; /* Ensure no additional margins */
  }
  
  .leaflet-popup.popup-below-large {
    top: 9px !important;
    margin-top: 0 !important; /* Ensure no additional margins */
  }
    
  /* Position the tip container so that its arrow aligns properly */
  .leaflet-popup.popup-below .leaflet-popup-tip-container,
  .leaflet-popup.popup-below-large .leaflet-popup-tip-container {
    bottom: auto !important;
    top: 3px !important;
    overflow: hidden !important; 
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    height: 20px !important;
    width: 40px !important; /* Set explicit width */
    margin: 0 auto !important; /* Center the tip container */
  }
  
  /* Adjust the arrow itself so that it points upward */
  .leaflet-popup.popup-below .leaflet-popup-tip,
  .leaflet-popup.popup-below-large .leaflet-popup-tip {
    margin: -10px auto 0 !important;
    -webkit-transform: rotate(225deg) !important;
    -moz-transform: rotate(225deg) !important;
    -ms-transform: rotate(225deg) !important;
    -o-transform: rotate(225deg) !important;
    transform: rotate(225deg) !important;
    box-shadow: none !important;
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    width: 17px !important; /* Set explicit width */
    height: 17px !important; /* Set explicit height */
  }
  
  /* Fix for Safari specifically */
  @supports (-webkit-hyphens:none) {
    .leaflet-popup.popup-below .leaflet-popup-tip,
    .leaflet-popup.popup-below-large .leaflet-popup-tip {
      margin-top: -10px !important;
    }
  }


.prim-bg-color{
    background-color: hsl(197, 100%, 13%);
    color: #fff;
}

.igrf-mobile-display {
    transform: translateX(-50%);
    z-index: 9998;
    bottom: 40px;
    left: 50%;
    font-size: 1rem;
    font-weight: bold;
}

.igrf-mobile-inner {
    padding: 20px 10px!important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    font-size: 1rem;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.55);
}
