/**
 * mod_menusidebar Fixed Layout Styles
 * Two-column layout with hover submenus
 */

/* Overlay container - full screen with bubble reveal */
#overlay,
.menusidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #4a5458;
  z-index: 99999;
  font-size: 16px !important;
  line-height: 1.5 !important;
  /* Bubble reveal: hidden state */
  visibility: hidden;
  clip-path: circle(0% at 65px 65px);
  transition:
    clip-path 0.65s cubic-bezier(0.65, 0, 0.35, 1),
    visibility 0s linear 0.65s;
  pointer-events: none;
}

#sidebar-menu > li > a {
  font-family: "tablet-gothic-compressed", sans-serif;
}

/* Show overlay - bubble expands from hamburger position */
#overlay.show,
.menusidebar-overlay.show {
  visibility: visible;
  clip-path: circle(150% at 65px 65px);
  transition:
    clip-path 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 0s;
  pointer-events: auto;
}

/* Staggered content reveal */
#overlay nav {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

#overlay.show nav {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.25s;
}

#overlay #social {
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

#overlay.show #social {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.35s;
}

/* Staggered menu items */
#sidebar-menu > li {
  opacity: 0;
  transform: translateX(-20px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
}

#overlay.show #sidebar-menu > li {
  opacity: 1;
  transform: translateX(0);
}

#overlay.show #sidebar-menu > li:nth-child(1) {
  transition-delay: 0.2s;
}
#overlay.show #sidebar-menu > li:nth-child(2) {
  transition-delay: 0.25s;
}
#overlay.show #sidebar-menu > li:nth-child(3) {
  transition-delay: 0.3s;
}
#overlay.show #sidebar-menu > li:nth-child(4) {
  transition-delay: 0.35s;
}
#overlay.show #sidebar-menu > li:nth-child(5) {
  transition-delay: 0.4s;
}
#overlay.show #sidebar-menu > li:nth-child(6) {
  transition-delay: 0.45s;
}
#overlay.show #sidebar-menu > li:nth-child(7) {
  transition-delay: 0.5s;
}
#overlay.show #sidebar-menu > li:nth-child(8) {
  transition-delay: 0.55s;
}

/* Close button - top left corner */
.close-overlay,
.toggle-off {
  position: fixed !important;
  top: 30px !important;
  left: 30px !important;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 999999;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #fff;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    opacity 0.3s ease;
  opacity: 0;
}

#overlay.show .close-overlay,
#overlay.show .toggle-off {
  opacity: 1;
  transition-delay: 0.4s;
}

.close-overlay:before,
.close-overlay:after,
.toggle-off:before,
.toggle-off:after {
  content: "";
  position: absolute;
  width: 25px;
  height: 3px;
  background: #fff;
  transition: background 0.3s ease;
}

.close-overlay:before,
.toggle-off:before {
  transform: rotate(45deg);
}
#overlay.show nav {
  margin: 0;
}
.close-overlay:after,
.toggle-off:after {
  transform: rotate(-45deg);
}

.close-overlay:hover,
.toggle-off:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.close-overlay:hover:before,
.close-overlay:hover:after,
.toggle-off:hover:before,
.toggle-off:hover:after {
  background: #333;
}

/* Navigation container */
#overlay nav {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Left column for main menu */
.menu-left-column {
  flex: 0 0 40%;
  margin: 5vh 0;
  padding: 15vh 0%;
  padding-left: 8%;
  overflow-y: auto;
}

/* Right column for submenus */
.menu-right-column {
  flex: 0 0 60%;
  padding: 0 5%;
  position: relative;
  overflow-y: auto;
  display: flex;
  align-items: center;
}

/* Main menu styles */
#sidebar-menu {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}

#sidebar-menu > li {
  position: relative;
  list-style: none !important;
}

#sidebar-menu > li > a {
  font-size: 3rem !important; /* Changed from 3em to 2.5rem for more consistent sizing */
  font-weight: 300 !important;
  color: #87A5A7!important;
  text-decoration: none !important;
  display: block !important;
  padding: 15px 0 !important;
  transition: all 0.3s ease !important;
  max-width: 100% !important; /* Prevent overflow */
}

#sidebar-menu > li > a:hover {
  color: #aaa491 !important;
}

#sidebar-menu > li.active > a,
#sidebar-menu > li.current > a {
  color: #4a9eff;
  font-weight: 700;
}

/* Hide original submenu in left column */
#sidebar-menu .nav-child {
  display: none !important; /* Always hidden in left column */
}

/* Active menu item styling */
#sidebar-menu > li.active-menu-item > a {
  color: #aaa491 !important;
}

/* Locked menu item (clicked to stay open) */
#sidebar-menu > li.menu-locked > a {
  color: #333 !important;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

#sidebar-menu > li.menu-locked > a:after {
  content: "•" !important;
  position: absolute !important;
  right: 20px !important;
  color: #333 !important;
  font-size: 1.5rem !important;
}

#submenu-container .nav-child,
#submenu-container .right-column-submenu {
  display: block !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  position: static !important;
  width: 100% !important;
}

/* Submenu items in right column */
#submenu-container .nav-child li,
#submenu-container .right-column-submenu li {
  margin-bottom: 20px !important;
  list-style: none !important;
}

#submenu-container .nav-child a,
#submenu-container .right-column-submenu a {
  font-size: 1.5rem !important;
  color: #D4CFC1 !important;
  text-decoration: none !important;
  display: block !important;
  padding: 10px 0 !important;
  transition: all 0.3s ease !important;
  font-weight: 500 !important;
  position: relative !important;
}

#submenu-container .nav-child a:hover,
#submenu-container .right-column-submenu a:hover {
  color: #FFF !important;
  font-weight: 700;
}

#submenu-container .nav-child a:hover:before,
#submenu-container .right-column-submenu a:hover:before {
  opacity: 1 !important;
  left: 0 !important;
}

/* Social section - fixed at bottom right */
#social {
  position: fixed !important;
  bottom: 50px !important;
  right: 50px !important;
  text-align: right !important;
  z-index: 999999 !important;
}

#social span {
  color: #fff !important;
  display: block !important;
  margin-bottom: 20px !important;
  font-size: 2.5rem !important; /* Consistent with menu items */
  font-weight: 700 !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2) !important;
}

#social #contact-infos a {
  color: #fff !important;
  text-decoration: none !important;
  font-size: 1.2em !important;
  display: inline-block !important;
  margin-bottom: 10px !important;
  transition: all 0.3s ease !important;
  font-weight: 500 !important;
}

#social #contact-infos a:hover {
  color: #333 !important;
  transform: scale(1.05) !important;
}

#social svg {
  width: 40px !important;
  height: 40px !important;
  fill: #fff !important;
  vertical-align: middle !important;
  margin-left: 15px !important;
  transition: all 0.3s ease !important;
}

#social a:hover svg {
  fill: #333 !important;
  transform: scale(0.9) !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  /* Nav: stack vertically instead of side by side */
  #overlay nav {
    flex-direction: column !important;
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
  }

  /* Left column: full width, less top padding */
  .menu-left-column {
    flex: 0 0 auto !important;
    width: 100% !important;
    padding: 100px 30px 20px 30px !important;
    overflow-y: visible !important;
  }

  /* Right column: hide on mobile (submenus shown inline) */
  .menu-right-column {
    display: none !important;
  }

  /* Show submenus inline below their parent on mobile */
  #sidebar-menu .nav-child {
    display: none !important;
    position: static !important;
    width: 100% !important;
    padding-left: 20px !important;
    margin-top: 5px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
  }

  /* Show nav-child when parent is active/hovered */
  #sidebar-menu > li.active-menu-item .nav-child,
  #sidebar-menu > li.menu-locked .nav-child {
    display: block !important;
  }

  /* Menu items: smaller font for mobile */
  #sidebar-menu > li > a {
    font-size: 1.8rem !important;
    padding: 10px 0 !important;
  }

  /* Submenu items */
  #sidebar-menu .nav-child li {
    margin-bottom: 5px !important;
  }

  #sidebar-menu .nav-child a,
  #sidebar-menu .nav-child li a {
    font-size: 1.1rem !important;
    color: #fff !important;
    padding: 8px 15px !important;
  }

  /* Social section: relative flow, below menu, centered */
  #social {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    width: 100% !important;
    text-align: center !important;
    padding: 30px !important;
  }

  /* Override Bootstrap text-end on social icons */
  #social .social_platform_icons,
  #social .text-end {
    text-align: center !important;
  }

  #social span {
    font-size: 1.5rem !important;
  }

  #social svg {
    width: 30px !important;
    height: 30px !important;
    margin: 0 auto !important;
    float: none !important;
    display: block !important;
  }

  /* Social links: center the icons */
  #social .social_platform_icons a {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 15px !important;
  }

  /* Hide scrollbar but keep scrolling */
  #overlay,
  #overlay nav {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
  }
  #overlay::-webkit-scrollbar,
  #overlay nav::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
  }

  /* Close button */
  .close-overlay,
  .toggle-off {
    top: 20px !important;
    left: 20px !important;
    width: 44px;
    height: 44px;
  }
}

/* Ensure structural visibility of menu elements (opacity handled by stagger animations) */
#overlay.show #sidebar-menu,
#overlay.show .menu-left-column,
#overlay.show .menu-right-column {
  visibility: visible !important;
}
