/* JBH-Sidebar Styling */
.jbh-sidebar {
  position: fixed;
  top: 0;
  left: -90%; /* Start further off-screen for more dramatic animation */
  width: 70%;
  height: 100vh;
  background: rgba(247, 245, 245, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy animation */
  border-right: 2px solid rgba(57, 207, 202, 0.5);
  padding-top: 6vw; /* Reduced to make room for logo */
  overflow-y: auto;
  display: none; /* Hidden by default */
}

/* Logo in Sidebar */
.jbh-sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 4vw 0;
  margin-bottom: 4vw;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.jbh-sidebar-logo img {
  width: 12vw;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  outline: 0.2vw solid rgba(57, 207, 202, 0.8);
  outline-offset: 0.5vw;
  box-shadow: 0 0 1vw rgba(57, 207, 202, 0.8),
    0 0 2vw rgba(57, 207, 202, 0.6),
    0 0 3vw rgba(57, 207, 202, 0.4);
  transition: all 0.3s ease;
}

.jbh-sidebar.open .jbh-sidebar-logo {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

/* JBH-Sidebar Navigation List - ENHANCED & CENTERED */
.jbh-sidebar ul {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  align-items: center; /* Center list items horizontally */
}

.jbh-sidebar ul li {
  list-style: none;
  margin: 4vw 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  position: relative;
  opacity: 0;
  transform: translateX(-40px); /* Start further left for more dramatic animation */
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 80%; /* Control width of list items */
  text-align: center; /* Center text inside list items */
}

.jbh-sidebar ul li a {
  font-size: 5vw;
  text-decoration: none;
  color: rgb(0, 0, 0);
  position: relative;
  display: inline-block;
  padding: 2vw;
  transition: all 0.3s ease-in-out;
  width: 100%; /* Make links take full width of li for better centering */
}

/* Enhanced hover effects for sidebar links */
.jbh-sidebar ul li a:hover {
  color: #39cfca;
  transform: scale(1.1) translateX(5px);
  text-shadow: 0 0 8px rgba(57, 207, 202, 0.4);
}

/* Enhanced item styling - New 3D effect with shadows */
.jbh-sidebar ul li {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.jbh-sidebar ul li:hover {
  box-shadow: 0 8px 15px rgba(57, 207, 202, 0.3),
              0 0 10px rgba(57, 207, 202, 0.2);
  transform: translateY(-5px) translateX(0);
  background: rgba(255, 255, 255, 0.4);
}

.jbh-sidebar ul li a::after {
  content: '';
  position: absolute;
  left: 10%;
  bottom: 0;
  width: 80%;
  height: 2px;
  background-color: #39cfca;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-in-out;
}

.jbh-sidebar ul li a:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* JBH-Sidebar Toggle Button - Simplified Version */
.jbh-sidebar-toggle {
  display: none; /* Hidden by default */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 1.5vw;
  z-index: 1001;
  cursor: pointer;
  width: 5vw;
  height: 4vw;
  background: transparent; /* No background */
  transition: all 0.3s ease;
}

/* Hamburger Icon - Theme Color Lines */
.jbh-hamburger {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.jbh-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #39cfca; /* Theme color */
  margin: 6px 0;
  transition: all 0.3s ease;
  box-shadow: 0 0 5px rgba(57, 207, 202, 0.5); /* Subtle glow */
}

/* Close button in top right of sidebar */
.jbh-close-btn {
  position: absolute;
  top: 2vw;
  right: 2vw;
  width: 8vw;
  height: 8vw;
  cursor: pointer;
  z-index: 2001;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.jbh-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: rotate(90deg);
}

.jbh-close-btn::before,
.jbh-close-btn::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 2px;
  background-color: #39cfca;
  box-shadow: 0 0 5px rgba(57, 207, 202, 0.8);
}

.jbh-close-btn::before {
  transform: rotate(45deg);
}

.jbh-close-btn::after {
  transform: rotate(-45deg);
}

/* Overlay for clicking outside to close */
.jbh-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Open State Styles */
.jbh-sidebar.open {
  left: 0;
  animation: jbhSidebarPulse 0.5s ease-in-out; /* Pulse animation when opening */
}

/* Enhanced pulse animation */
@keyframes jbhSidebarPulse {
  0% { box-shadow: 0 0 0 rgba(57, 207, 202, 0); }
  50% { box-shadow: 0 0 50px rgba(57, 207, 202, 0.7); }
  100% { box-shadow: 4px 0 20px rgba(57, 207, 202, 0.4); }
}

.jbh-overlay.open {
  display: block;
  opacity: 1;
}

/* Animation for list items when sidebar opens - enhanced with staggered delay */
.jbh-sidebar.open ul li {
  opacity: 1;
  transform: translateX(0);
}

/* Increased staggered delay for list items */
.jbh-sidebar.open ul li:nth-child(1) { transition-delay: 0.2s; }
.jbh-sidebar.open ul li:nth-child(2) { transition-delay: 0.3s; }
.jbh-sidebar.open ul li:nth-child(3) { transition-delay: 0.4s; }
.jbh-sidebar.open ul li:nth-child(4) { transition-delay: 0.5s; }
.jbh-sidebar.open ul li:nth-child(5) { transition-delay: 0.6s; }

/* Animated hamburger to X transformation */
.jbh-sidebar-toggle.open .jbh-hamburger span {
  background-color: #ff6b6b; /* Change color when open */
}

.jbh-sidebar-toggle.open .jbh-hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.jbh-sidebar-toggle.open .jbh-hamburger span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.jbh-sidebar-toggle.open .jbh-hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Hover effect for toggle button */
.jbh-sidebar-toggle:hover .jbh-hamburger span {
  box-shadow: 0 0 8px rgba(57, 207, 202, 0.8);
}

.jbh-sidebar-toggle:hover .jbh-hamburger span:nth-child(1) {
  transform: translateY(-2px);
}

.jbh-sidebar-toggle:hover .jbh-hamburger span:nth-child(3) {
  transform: translateY(2px);
}

.jbh-sidebar-toggle.open:hover .jbh-hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.jbh-sidebar-toggle.open:hover .jbh-hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Media Query to show sidebar elements on mobile */
@media (max-width: 768px) {
  .jbh-sidebar, .jbh-sidebar-toggle {
    display: block; /* Show on mobile */
  }
  
  /* Make sidebar toggle more visible */
  .jbh-sidebar-toggle {
    width: 30px;
    height: 25px;
    position: absolute;
    left: 15px;
    top: 50%;
    z-index: 1500;
  }
  
  .jbh-hamburger span {
    height: 3px;
    margin: 5px 0;
    box-shadow: 0 0 8px rgba(57, 207, 202, 0.7);
  }
  
  /* Enhanced border glow animation */
  @keyframes jbhBorderGlow {
    0% { border-right-color: rgba(57, 207, 202, 0.5); }
    50% { border-right-color: rgba(57, 207, 202, 1); 
          box-shadow: 0 0 20px rgba(57, 207, 202, 0.4); }
    100% { border-right-color: rgba(57, 207, 202, 0.5); }
  }
  
  .jbh-sidebar.open {
    animation: jbhBorderGlow 3s infinite;
  }
  
  /* Enhanced logo animation in sidebar */
  @keyframes jbhLogoGlow {
    0% { box-shadow: 0 0 1vw rgba(57, 207, 202, 0.8), 
                    0 0 2vw rgba(57, 207, 202, 0.6), 
                    0 0 3vw rgba(57, 207, 202, 0.4); 
          transform: scale(1); }
    50% { box-shadow: 0 0 2vw rgba(57, 207, 202, 0.9), 
                     0 0 3vw rgba(57, 207, 202, 0.7), 
                     0 0 4vw rgba(57, 207, 202, 0.5);
          transform: scale(1.05); }
    100% { box-shadow: 0 0 1vw rgba(57, 207, 202, 0.8), 
                      0 0 2vw rgba(57, 207, 202, 0.6), 
                      0 0 3vw rgba(57, 207, 202, 0.4);
          transform: scale(1); }
  }
  
  .jbh-sidebar.open .jbh-sidebar-logo img {
    animation: jbhLogoGlow 3s infinite;
  }
  
  /* Enhanced list item animations */
  @keyframes jbhItemPulse {
    0% { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
    50% { box-shadow: 0 8px 15px rgba(57, 207, 202, 0.3),
                    0 0 10px rgba(57, 207, 202, 0.2); }
    100% { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
  }
  
  .jbh-sidebar.open ul li {
    animation: jbhItemPulse 3s infinite;
    animation-delay: calc(0.2s * var(--item-index, 1));
  }
  
  .jbh-sidebar.open ul li:nth-child(1) { --item-index: 1; }
  .jbh-sidebar.open ul li:nth-child(2) { --item-index: 2; }
  .jbh-sidebar.open ul li:nth-child(3) { --item-index: 3; }
  .jbh-sidebar.open ul li:nth-child(4) { --item-index: 4; }
  .jbh-sidebar.open ul li:nth-child(5) { --item-index: 5; }
}