/* Dropdown Styles for Navigation - Based on ledtruckmedia-v3 */

/* Base dropdown styles */
.nav-dropdown-list {
  background-color: var(--color-surface-tertiary);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  border: 1px solid var(--color-border-primary);
}

/* Desktop dropdown behavior with hover delay */
@media (min-width: 1024px) {
  .nav-dropdown-list {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 32rem;
    max-width: 32rem;
    margin-top: 0.75rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
  }
  
  /* Add hover delay to prevent premature closing */
  .nav-dropdown.group {
    position: relative;
  }
  
  .nav-dropdown.group:hover .nav-dropdown-list,
  .nav-dropdown-list:hover {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0s;
  }
  
  /* Keep dropdown open when hovering over it */
  .nav-dropdown.group .nav-dropdown-list::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
  }
}

/* Menu items container */
.nav-dropdown-list .menu-items {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Category label */
.nav-dropdown-list .category-label {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
  padding: 0.2rem 1rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Individual menu item */
.nav-dropdown-list .menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  min-height: 4rem;
  margin-bottom: 0.5rem;
}

.nav-dropdown-list .menu-item:last-child {
  margin-bottom: 0;
}

.nav-dropdown-list .menu-item:hover:not([class*="bg-primary"]) {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.nav-dropdown-list .menu-item[class*="bg-primary"] {
  margin-right: 0.25rem;
  margin-left: 0.25rem;
}

/* Icon styles */
.nav-dropdown-list .menu-item .icon {
  width: 2.5rem !important;
  height: 2.5rem !important;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 0.25rem;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
  align-self: center;
}

.nav-dropdown-list .menu-item img.icon {
  max-width: 2.5rem !important;
  max-height: 2.5rem !important;
  width: 2.5rem !important;
  height: 2.5rem !important;
}

.nav-dropdown-list .menu-item:hover .icon {
  color: var(--color-text-primary);
}

/* Content area */
.nav-dropdown-list .menu-item .content {
  flex-grow: 1;
  max-width: calc(100% - 3.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
}

.nav-dropdown-list .menu-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.nav-dropdown-list .menu-item p {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0;
}

/* Make entire item clickable */
.nav-dropdown-list .menu-item a {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Active state for nav links - Rounded border style like v3 */
.nav-link.active {
  color: var(--color-primary) !important;
  font-weight: 500;
  position: relative;
  border: 1px solid var(--color-primary);
  border-radius: 9999px;
  background-color: transparent;
  padding: 0.5rem 1.25rem !important;
}

/* Button-like effect for active links */
.nav-link.active:hover {
  box-shadow: 0 0 10px rgba(255, 33, 79, 0.2);
}

/* Hover effect for nav links */
.nav-link:hover {
  color: var(--color-primary-light) !important;
}

/* All nav links have consistent padding and transparent border by default */
.nav-link {
  padding: 0.5rem 1.25rem !important;
  border: 1px solid transparent;
  border-radius: 9999px;
  transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.nav-dropdown-link {
  transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Dropdown arrow animation */
.nav-dropdown .group-hover\:-rotate-180 {
  transition: transform 0.5s ease;
}

/* Mobile styles */
@media (max-width: 1023px) {
  .nav-dropdown-list {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    transform: none !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 0;
    box-shadow: none;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  .nav-dropdown-list .menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .nav-dropdown-list .menu-item .icon,
  .nav-dropdown-list .menu-item img.icon {
    width: 2rem !important;
    height: 2rem !important;
    max-width: 2rem !important;
    max-height: 2rem !important;
  }
  
  .nav-link.active {
    background-color: transparent;
    border-radius: 9999px;
    border: 1px solid var(--color-primary);
    margin: 0.25rem 0;
    padding: 0.5rem 1.25rem !important;
  }
}
