/**
 * NiftyTheme Menu Manager - Base CSS
 * Namespaced with "nm-" prefix to avoid conflicts
 * This file contains all custom styles for the admin module
 */

/* ========================================
   Hidden / Visibility States
   ======================================== */
.nm-item-hidden {
  opacity: 0.4;
  filter: grayscale(1);
}

/* ========================================
   Icon Picker
   ======================================== */
.nm-icon-picker-dropdown {
  display: none;
  min-width: 380px;
  max-height: 300px;
  overflow-y: auto;
}

.nm-icon-picker-dropdown.active {
  display: block;
}

.nm-icon-option {
  border: 2px solid black;
  height: 3rem;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.1s;
  background: white;
  border-radius: 8px;
}

.nm-icon-option:hover {
  background: #88aaee;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
}

.nm-icon-option i {
  font-size: 1.25rem;
}

/* ========================================
   Custom Scrollbar
   ======================================== */
.nm-custom-scrollbar::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.nm-custom-scrollbar::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track {
  background: #000;
}

.nm-custom-scrollbar::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #fff;
  border: 2px solid #000;
}

/* ========================================
   Modal Overlay
   ======================================== */
.nm-modal-backdrop {
  z-index: 9999;
}

.nm-modal-backdrop.active,
.nm-modal-backdrop.flex {
  display: flex;
}

.nm-modal-backdrop.hidden {
  display: none;
}

/* ========================================
   Sortable Placeholder
   ======================================== */
.nm-sortable-placeholder {
  border: 2px dashed #000;
  background: #fffbe6;
  border-radius: 9999px;
  min-height: 48px;
  margin-bottom: 0.75rem;
}

/* ========================================
   Notification Area
   ======================================== */
.nm-notification-area {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  max-width: 400px;
}

.nm-alert {
  padding: 12px 20px;
  border: 3px solid #000;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  box-shadow: 4px 4px 0px 0px rgba(0,0,0,1);
  animation: nm-slide-in 0.3s ease;
}

.nm-alert-success {
  background: #a3e635;
  color: #000;
}

.nm-alert-error {
  background: #ff608c;
  color: #000;
}

.nm-alert-info {
  background: #88aaee;
  color: #000;
}

@keyframes nm-slide-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   Navbar dropdown menu item
   ======================================== */

/* item-content */
.dd-item-content {
  display: flex;
  align-items: flex-start;
  width: 100%;
}

/* dropdown-text */
.dd-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* dropdown-menu-item-label & dropdown-menu-item-description */
.item-label {
  font-weight: 500;
  font-size: 15px;
  display: block;
  white-space: nowrap;
}
.item-description {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.8;
  margin-top: 2px;
  font-weight: 400;
  max-width: 280px;
  min-width: 180px;
  width: 100%;
  white-space: normal !important;
  overflow-wrap: break-word;
}

/* dropdown-menu-item-icon */
.nm-dd-item-icon {
  margin-inline-end: 8px;
  margin-block-start: 6px;
  font-size: 16px;
}

/* dropdown-menu-item-badge */
.nm-dd-item-badge {
  display: inline-block;
  vertical-align: middle;
  align-self: flex-start;
  height: fit-content;
  margin-inline-start: 8px;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 2px;
  margin-block-start: 4px;
  text-transform: uppercase;
}

/* ========================================
   Mega Menu Styles
   ======================================== */

/* Parent link — relative so dropdown positions from here */
.mega-menu-parent {
  position: relative !important;
}

/* Fallback dropdown rules for non-Azurea themes (Bootstrap .dropdown-menu) */
.mega-menu-parent .dropdown-menu {
  width: fit-content !important;
  min-width: 24rem !important;
  inset-inline-start: 0 !important;
  inset-inline-end: auto !important;
  padding: 24px 0 !important;
  gap: 0 !important;
}

/* Column wrapper created by JS restructuring */
.nm-mega-col {
  min-width: 16rem;
  padding: 0 1.2rem;
}
.nm-mega-col:not(:last-child) {
  border-right: 1px solid rgba(0,0,0,0.08);
}
.nm-mega-col .dropdown-item {
  white-space: normal !important;
}

/* Hide regular dropdown children inside Azurea mega menu (footer HTML takes over) */
.mega-menu-custom .ddm-item,
.mega-menu-custom .ddm-divider,
.mega-menu-custom .ddm-group-header {
  display: none !important;
}

/* Make column headers non-clickable titles */
.nm-mega-header > a,
.nm-mega-header > span {
  display: block;
  pointer-events: none !important;
  cursor: default !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  text-transform: uppercase !important;
  color: #888 !important;
  letter-spacing: 0.05em !important;
  padding-top: 8px !important;
  padding-bottom: 6px !important;
  padding-inline: 16px;
}

/* Override Azurea theme.css fixed positioning for mega-menu-custom */
.navbar-links .mega-menu-custom {
  position: absolute !important;
  top: 4.8rem !important;
  left: auto !important;
  inset-inline-start: 0 !important;
  min-width: auto !important;
  width: fit-content !important;
}

/* Mega menu container & layout */
.mega-container {
  padding: 20px;
}

.mega-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
}

.mega-col {
  min-width: 24rem;
  padding: 0 15px;
}

.mega-group-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 5px;
  border-bottom: 2px solid #f0f0f0;
}

.mega-item {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  color: #555 !important;
  text-decoration: none !important;
  transition: all 0.2s;
}

.mega-item:hover {
  color: #000 !important;
}

.mega-item i {
  margin-bottom: 4px;
  font-size: 18px;
  color: #4f46e5;
}

.mega-item-title {
  font-weight: 700;
  font-size: 14px;
}

.mega-item-desc {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Responsive constraints for Mega Menu */
@media (max-width: 991px) {
  .mega-menu-parent .dropdown-menu,
  .navbar-links .mega-menu-custom {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    box-shadow: none !important;
    padding: 10px 0 !important;
    flex-direction: column !important;
  }
  
  .mega-row {
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  .mega-col, .nm-mega-col {
    width: 100% !important;
    min-width: 100% !important;
    padding: 0 10px !important;
  }
  
  .nm-mega-col:not(:last-child) {
    border-right: none !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
    padding-bottom: 15px !important;
    margin-bottom: 5px !important;
  }
  
  .mega-container {
    padding: 10px !important;
  }
}


/* ========================================
   Client Area - Divider Rendering
   ======================================== */
.nav-divider > a,
.nav-divider > span {
  pointer-events: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav-divider {
  border: none !important;
  margin: 4px 0 !important;
  padding: 0 !important;
  position: relative;
}

.nav-divider::after {
  content: '';
  display: block;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
  margin: 4px 12px;
}

/* Bootstrap dropdown-divider compat */
li.nav-divider {
  height: 0;
  overflow: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  list-style: none;
}
.dropdown-menu .dropdown-divider:last-child {
  display: none !important;
}
