/**
 * DAS TECH SOLUTIONS - DYNAMIC NAVIGATION & MENU MANAGER STYLES
 * Hierarchical dropdowns, multi-level submenus, mobile tree and admin menu builder
 */

/* Main Header Navigation Bar */
.main-nav-container {
  background: #ffffff;
  border-bottom: 2px solid #c8102e;
  position: relative;
  z-index: 50;
}

.main-nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-weight: 600;
  color: #1f2937;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link-item:hover,
.nav-link-item.active {
  color: #c8102e;
  background-color: #fef2f2;
}

/* Dropdown Container */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown .dropdown-toggle .arrow-down {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.nav-dropdown:hover .dropdown-toggle .arrow-down,
.nav-dropdown.open .dropdown-toggle .arrow-down {
  transform: rotate(180deg);
}

/* Dropdown Menu Box */
.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-top: 2px solid #c8102e;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 6px 6px;
  padding: 6px 0;
  z-index: 100;
}

.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown.open > .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 13.5px;
  color: #374151;
  text-decoration: none;
  transition: all 0.15s ease;
  font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item.active {
  background-color: #fef2f2;
  color: #c8102e;
  padding-left: 20px;
}

/* Nested Submenu (Level 2 Dropdown) */
.nav-sub-dropdown {
  position: relative;
}

.nav-sub-dropdown > .dropdown-submenu {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 2px solid #c8102e;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: 0 6px 6px 0;
  padding: 6px 0;
}

.nav-sub-dropdown:hover > .dropdown-submenu {
  display: block;
}

/* Mobile Navigation Accordion */
.mobile-nav-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  border-bottom: 1px solid #f1f5f9;
}

.mobile-nav-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.mobile-nav-link-row a {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  flex: 1;
}

.mobile-nav-toggle-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
}

.mobile-sub-menu {
  display: none;
  background: #f8fafc;
  padding: 6px 0 6px 18px;
  border-top: 1px solid #e2e8f0;
}

.mobile-sub-menu.open {
  display: block;
}

.mobile-sub-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 13.5px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
}

.mobile-sub-menu a:hover {
  color: #c8102e;
}

/* Admin Menu Manager Tree View */
.menu-manager-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-manager-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.15s ease;
  user-select: none;
}

.menu-manager-item:hover {
  border-color: #cbd5e1;
}

.menu-manager-item.is-child {
  margin-left: 32px;
  border-left: 3px solid #c8102e;
  background: #fdfefe;
}

.menu-manager-item.dragging {
  opacity: 0.5;
  border: 2px dashed #c8102e;
  background: #fef2f2;
}

.menu-manager-item.drag-over {
  border-top: 3px solid #c8102e;
}


/* Mobile Drawer Styles */
.mobile-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1040;
}

.mobile-drawer-overlay.show {
  display: block;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: #ffffff;
  z-index: 1050;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 16px 20px;
  background: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #c8102e;
}

.mobile-drawer-close {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
