/**
 * Mega Menu Styles
 * Visual mega-menu for events navigation with categories and icons
 */

.mega-menu {
  position: relative;
  display: inline-block;
}

.mega-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.mega-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.mega-menu-trigger:focus-visible {
  outline: 2px solid #fde047;
  outline-offset: 2px;
}

.mega-menu-icon {
  font-size: 1.2em;
}

.mega-menu-arrow {
  transition: transform 0.2s ease;
}

.mega-menu-trigger[aria-expanded="true"] .mega-menu-arrow {
  transform: rotate(180deg);
}

/* Panel */
.mega-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 600px;
  max-width: 900px;
  background: rgba(12, 74, 110, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  padding: 20px;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.mega-menu-panel[hidden] {
  display: none !important;
}

.mega-menu-panel:not([hidden]) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-height: 500px;
  overflow-y: auto;
}

/* Category Sections */
.mega-menu-category {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mega-menu-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px 0;
  font-size: 1.1em;
  font-weight: 600;
  color: #fff;
}

.mega-menu-category-icon {
  font-size: 1.3em;
}

.mega-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Menu Items */
.mega-menu-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.mega-menu-item:hover,
.mega-menu-item:focus {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateX(4px);
}

.mega-menu-item:focus-visible {
  outline: 2px solid #fde047;
  outline-offset: 2px;
}

.mega-menu-item-icon {
  font-size: 1.4em;
  flex-shrink: 0;
}

.mega-menu-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mega-menu-item-title {
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-menu-item-desc {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer */
.mega-menu-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  text-align: center;
}

.mega-menu-all-link {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mega-menu-all-link:hover {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

/* Scrollbar Styling */
.mega-menu-grid::-webkit-scrollbar {
  width: 8px;
}

.mega-menu-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.mega-menu-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.mega-menu-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .mega-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    padding: 16px;
    overflow-y: auto;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .mega-menu-category {
    margin-bottom: 16px;
  }

  .mega-menu-item {
    padding: 14px 16px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .mega-menu-panel,
  .mega-menu-trigger,
  .mega-menu-item,
  .mega-menu-all-link {
    transition: none;
  }

  .mega-menu-arrow {
    transition: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .mega-menu-trigger {
    border: 2px solid #fff;
  }

  .mega-menu-panel {
    border: 2px solid #fff;
  }

  .mega-menu-item {
    border: 1px solid rgba(255, 255, 255, 0.5);
  }
}
