/* -----------------------------------------------------
   NK Dynamic Menu Section - Light Theme (Black Text)
   Auto Scroll + Conditional Arrows
   Author: Natun Kicho Developer
------------------------------------------------------*/

.nk-dynamic-menu-wrapper {
  position: relative;
  padding: 60px 20px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border-top: 1px solid #e0e0e0;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* -----------------------------------------------------
   Horizontal scroll container - FIXED
------------------------------------------------------*/
.nk-dynamic-menu-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
  gap: 25px;
  padding: 10px 5px;
  width: 100%;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  scroll-padding: 0 20px; /* Better scroll snapping */
}

.nk-dynamic-menu-container::-webkit-scrollbar {
  display: none;
}

/* -----------------------------------------------------
   Category blocks - FIXED
------------------------------------------------------*/
.nk-dynamic-column {
  flex: 0 0 auto !important;
  min-width: 160px;
  width: 160px !important;
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  transition: all 0.3s ease;
  display: block;
  box-sizing: border-box;
}

.nk-dynamic-column:hover {
  background: rgba(240, 240, 240, 0.9);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* -----------------------------------------------------
   Category title
------------------------------------------------------*/
.nk-dynamic-category-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 10px;
  border-bottom: 2px solid #ddd;
  padding-bottom: 5px;
  transition: color 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.3;
}

.nk-dynamic-category-title:hover {
  color: #0073aa;
}

/* -----------------------------------------------------
   Tag list - FIXED
------------------------------------------------------*/
.nk-dynamic-tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: normal;
}

.nk-dynamic-tag-list li {
  margin: 5px 0;
  white-space: normal;
}

.nk-dynamic-tag-list a {
  text-decoration: none;
  color: #000;
  font-size: 0.95rem;
  transition: color 0.3s ease, transform 0.3s ease, background 0.3s ease;
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: normal;
  word-break: break-word;
  width: 100%;
  line-height: 1.3;
}

.nk-dynamic-tag-list a:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #000;
  transform: translateX(4px);
}

/* -----------------------------------------------------
   "More" link
------------------------------------------------------*/
.nk-more a {
  color: #0073aa;
  font-weight: 500;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-block;
}

.nk-more a:hover {
  background: rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: #000;
}

/* -----------------------------------------------------
   Scroll arrows (show only when needed)
------------------------------------------------------*/
.nk-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  color: #000;
  font-size: 22px;
  text-align: center;
  line-height: 40px;
  cursor: pointer;
  z-index: 999;
  transition: all 0.3s ease;
  display: none;
  border: none;
  outline: none;
}

.nk-scroll-arrow.left {
  left: 10px;
}

.nk-scroll-arrow.right {
  right: 10px;
}

.nk-scroll-arrow:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.05);
}

/* -----------------------------------------------------
   Enhanced Mobile Responsive Design
------------------------------------------------------*/
@media (max-width: 768px) {
  .nk-dynamic-menu-wrapper {
    padding: 30px 15px;
  }
  
  .nk-dynamic-menu-container {
    gap: 15px;
    padding: 8px 5px;
    scroll-padding: 0 15px;
  }
  
  .nk-dynamic-column {
    min-width: 140px;
    width: 140px !important;
    padding: 12px 8px;
  }

  .nk-dynamic-category-title {
    font-size: 1rem;
    margin-bottom: 8px;
    padding-bottom: 4px;
  }

  .nk-dynamic-tag-list a {
    font-size: 0.9rem;
    padding: 6px 8px; /* Larger touch targets */
    margin: 2px 0;
  }

  .nk-dynamic-tag-list li {
    margin: 4px 0;
  }

  /* Hide arrows on mobile - touch scrolling is better */
  .nk-scroll-arrow {
    display: none !important;
  }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .nk-dynamic-menu-wrapper {
    padding: 20px 10px;
  }
  
  .nk-dynamic-menu-container {
    gap: 12px;
    padding: 5px 5px;
  }
  
  .nk-dynamic-column {
    min-width: 130px;
    width: 130px !important;
    padding: 10px 6px;
  }

  .nk-dynamic-category-title {
    font-size: 0.95rem;
  }

  .nk-dynamic-tag-list a {
    font-size: 0.85rem;
    padding: 5px 6px;
  }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .nk-dynamic-menu-wrapper {
    padding: 20px 15px;
  }
  
  .nk-dynamic-column {
    min-width: 120px;
    width: 120px !important;
  }
}

/* Prevent text selection during scroll on mobile */
.nk-dynamic-menu-container {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.nk-dynamic-tag-list a {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}