/* ===== SIDEBAR NAVIGATION REVAMP ===== */

/* Base nav link styling */
.sidenav .nav-link {
  margin: 0 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.sidenav .nav-link:hover {
  background: rgba(124, 154, 130, 0.08);
}

/* Consistent icon styling - all sage green */
.sidenav .nav-link .icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: rgba(124, 154, 130, 0.12);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidenav .nav-link .icon i {
  color: #7c9a82 !important;
  font-size: 0.875rem;
}

/* Active state - highlighted with filled icon */
.sidenav .nav-link.active {
  background: linear-gradient(90deg, rgba(124,154,130,0.18) 0%, rgba(124,154,130,0.06) 100%) !important;
  border-left: 3px solid #7c9a82 !important;
  margin-left: calc(0.5rem - 3px);
}

.sidenav .nav-link.active .nav-link-text {
  color: #4a6b4f !important;
  font-weight: 700 !important;
}

.sidenav .nav-link.active .icon {
  background: #7c9a82 !important;
}

.sidenav .nav-link.active .icon i {
  color: #ffffff !important;
}

/* Submenu styles */
.sidenav .nav-link[aria-expanded="true"] .submenu-arrow {
  transform: rotate(180deg);
}

#myRecipesSubmenu .nav-link {
  padding: 0.4rem 0.75rem;
  margin: 0.15rem 0;
  color: #67748e;
}

#myRecipesSubmenu .nav-link:hover {
  background: rgba(124, 154, 130, 0.08);
  color: #5f7d64;
}

#myRecipesSubmenu .nav-link.active {
  background: rgba(124, 154, 130, 0.15);
  color: #4a6b4f;
  font-weight: 600;
  border-left: none;
  margin-left: 0;
}

/* Hide Argon's default collapse caret - we use our own submenu-arrow */
.sidenav .nav-link[data-bs-toggle="collapse"]::after {
  display: none !important;
}

/* Auth visibility - use !important to override Bootstrap d-flex */
.auth-hidden {
  display: none !important;
}

/* Sidebar footer base styles */
.sidenav-footer {
  margin-top: auto;
  border-top: 1px solid #f0f0f0;
  padding-top: 1rem;
}

/* ===== MOBILE NAVIGATION ===== */

/* Mobile hamburger button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1050;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: #f8f9fa;
}

.mobile-menu-btn i {
  font-size: 1.25rem;
  color: #344767;
}

/* Mobile backdrop overlay */
.sidenav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1039;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidenav-backdrop.show {
  display: block;
  opacity: 1;
}

/* Mobile responsive styles */
@media (max-width: 991.98px) {
  .mobile-menu-btn {
    display: flex !important;
  }

  /* Hide sidebar by default on mobile - override Argon dashboard */
  .sidenav,
  .sidenav.navbar-vertical,
  aside.sidenav {
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    z-index: 1040 !important;
    margin-left: 0 !important;
    left: 0 !important;
    position: fixed !important;
    width: 280px !important;
    max-width: 85vw !important;
  }

  /* Show sidebar when active - must override above */
  .sidenav.mobile-open,
  .sidenav.navbar-vertical.mobile-open,
  aside.sidenav.mobile-open {
    transform: translateX(0) !important;
  }

  /* Adjust main content to full width on mobile */
  .main-content {
    margin-left: 0 !important;
  }

  /* Adjust breadcrumb area for hamburger button */
  .navbar-main .container-fluid {
    padding-left: 60px !important;
  }

  /* Ensure sidenav has full height on mobile with proper scrolling */
  .sidenav,
  .sidenav.navbar-vertical,
  aside.sidenav {
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Force the collapse to always show on mobile when menu is open */
  .sidenav.mobile-open .navbar-collapse,
  .sidenav.mobile-open #sidenav-collapse-main {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    overflow-y: auto !important;
    height: auto !important;
  }

  /* Larger touch targets for mobile */
  .sidenav .nav-link {
    padding: 0.85rem 1rem !important;
    min-height: 48px;
  }

  /* Better spacing for nav items */
  .sidenav .navbar-nav {
    padding-bottom: 1rem;
  }

  /* Fix Experiments Lab button - always at bottom */
  .sidenav-footer {
    background: white !important;
    padding: 12px 16px 20px !important;
    border-top: 1px solid #e9ecef !important;
    flex-shrink: 0 !important;
  }
}

/* ===== AUTH MODAL ===== */

.auth-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.auth-modal-overlay.show {
  display: flex;
}
.auth-modal {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
}
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.auth-modal h3 {
  color: #344767;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}
.auth-modal p {
  color: #67748e;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
.auth-modal .btn-primary {
  background: #7c9a82;
  border-color: #7c9a82;
  padding: 0.75rem 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  width: 100%;
}
.auth-modal .btn-primary:hover {
  background: #6a8770;
  border-color: #6a8770;
}
.auth-modal .btn-outline-primary {
  color: #7c9a82;
  border-color: #7c9a82;
  padding: 0.75rem 2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  width: 100%;
}
.auth-modal .btn-outline-primary:hover {
  background: #7c9a82;
  color: white;
}
.auth-modal .btn-link {
  color: #67748e;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.5rem;
  border: none;
  background: none;
  cursor: pointer;
}
.auth-modal .btn-link:hover {
  color: #344767;
}
