/* Modern Megamenu Styles */
.modern-post-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 25px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.modern-post-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.modern-post-btn .btn-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.modern-post-btn:hover .btn-arrow {
  transform: rotate(180deg);
}

/* Modern Megamenu Container */
.modern-megamenu {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border: none;
  padding: 0;
  min-width: 800px;
  max-width: 900px;
  margin-top: 10px;
  overflow: hidden;
  animation: slideDown 0.3s ease;
  right: 0 !important;
  left: auto !important;
  transform: translateX(0) !important;
  position: absolute !important;
}

/* Dropdown container positioning */
.dropdown ngh-megamenu {
  position: relative;
}

.dropdown ngh-megamenu .dropdown-menu {
  right: 0 !important;
  left: auto !important;
  transform: translateX(0) !important;
}

/* Ensure the dropdown appears on the right side */
@media (min-width: 992px) {
  .modern-megamenu {
    right: 0 !important;
    left: auto !important;
    transform: translateX(calc(100% - 280px)) !important;
  }
}

@media (max-width: 991px) {
  .modern-megamenu {
    right: 15px !important;
    left: 15px !important;
    transform: none !important;
    min-width: auto !important;
    max-width: none !important;
  }
}

/* Additional positioning fixes */
.dropdown-menu-right {
  right: 0 !important;
  left: auto !important;
}

.dropright .dropdown-menu {
  right: 0 !important;
  left: auto !important;
  top: 100% !important;
}

/* Prevent horizontal overflow */
body {
  overflow-x: hidden;
}

/* Ensure dropdown stays within viewport */
@media (min-width: 992px) {
  .modern-megamenu {
    max-width: min(900px, calc(100vw - 100px)) !important;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Megamenu Header */
.megamenu-header {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f0ff 100%);
  padding: 20px 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.megamenu-title {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.megamenu-title .title-icon {
  font-size: 24px;
  color: #667eea;
  margin-right: 12px;
}

.megamenu-title h5 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #2d3748;
}

.megamenu-search {
  margin-top: 10px;
}

.search-wrapper {
  position: relative;
  max-width: 400px;
}

.search-wrapper .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
  z-index: 2;
}

.search-wrapper .form-control {
  border-radius: 25px;
  border: 2px solid #e2e8f0;
  padding: 10px 15px 10px 45px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.search-wrapper .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

/* Megamenu Content */
.megamenu-content {
  padding: 25px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

/* Category Cards */
.category-card {
  background: white;
  border-radius: 15px;
  border: 2px solid #f1f5f9;
  padding: 20px;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.category-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.vehicles-card .category-icon {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.services-card .category-icon {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.equipment-card .category-icon {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.category-card:hover .category-icon {
  transform: scale(1.1);
}

.category-content h6 {
  font-size: 16px;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
}

.category-content p {
  font-size: 13px;
  color: #718096;
  margin-bottom: 15px;
  line-height: 1.5;
}

.category-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: #4a5568;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.2s ease;
  position: relative;
}

.quick-link:hover {
  background: #f7fafc;
  color: #667eea;
  transform: translateX(5px);
}

.quick-link.featured {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  color: #667eea;
  font-weight: 600;
}

.quick-link i {
  margin-right: 8px;
  font-size: 12px;
  transition: transform 0.2s ease;
}

.quick-link:hover i {
  transform: translateX(3px);
}

.new-badge {
  background: #48bb78;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 600;
}

/* Category Badges */
.category-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.category-badge.popular {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: white;
}

.category-badge.new {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
}

.category-badge.trending {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.quick-action-item {
  background: #f8fafc;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.quick-action-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.action-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  text-decoration: none;
  color: #2d3748;
  transition: all 0.3s ease;
}

.action-link:hover {
  color: #667eea;
}

.action-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #667eea;
  margin-right: 15px;
  transition: all 0.3s ease;
}

.action-link:hover .action-icon {
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.action-content h6 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.action-content p {
  font-size: 12px;
  color: #718096;
  margin: 0;
}

.action-arrow {
  margin-left: auto;
  font-size: 14px;
  color: #a0aec0;
  transition: all 0.3s ease;
}

.action-link:hover .action-arrow {
  color: #667eea;
  transform: translateX(5px);
}

/* Megamenu Footer */
.megamenu-footer {
  background: #f8fafc;
  padding: 15px 25px;
  border-top: 1px solid #e2e8f0;
}

.footer-text {
  font-size: 13px;
  color: #718096;
  text-align: center;
}

.footer-text a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-text a:hover {
  color: #5a6fd8;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .modern-megamenu {
    min-width: 700px;
    max-width: 750px;
  }
  
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}

@media (max-width: 992px) {
  .modern-megamenu {
    min-width: 600px;
    max-width: 650px;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .modern-megamenu {
    min-width: 95vw;
    max-width: 95vw;
    border-radius: 15px;
  }
  
  .megamenu-header {
    padding: 15px 20px;
  }
  
  .megamenu-content {
    padding: 20px;
  }
  
  .category-card {
    padding: 15px;
  }
  
  .search-wrapper {
    max-width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .modern-megamenu {
    background: #1a202c;
    color: white;
  }
  
  .megamenu-header {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  .megamenu-title h5 {
    color: white;
  }
  
  .category-card {
    background: #2d3748;
    border-color: #4a5568;
  }
  
  .category-content h6 {
    color: white;
  }
  
  .quick-action-item {
    background: #2d3748;
  }
  
  .action-link {
    color: white;
  }
  
  .megamenu-footer {
    background: #2d3748;
    border-top-color: #4a5568;
  }
}

/* Animation for search functionality */
.category-card.hidden {
  opacity: 0.3;
  transform: scale(0.95);
  pointer-events: none;
}

/* Smooth transitions for all interactive elements */
.modern-megamenu * {
  transition: all 0.2s ease;
}
