/**
 * LisansJet Mega Menu - Fusion Design System
 * Premium Glassmorphism Styles for GrapesJS Theme Builder
 */

/* ========================================
   MEGA MENU CONTAINER
   ======================================== */

.lj-mega-menu-trigger,
.mega-menu-container,
.lj-mega-menu {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Mega Menu Dropdown Positioning - CRITICAL */
.mega-menu-container {
  position: fixed;
  top: 80px; /* Header height */
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1040;
  padding: 0 20px;
  transform-origin: top center;
  animation: megaMenuSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Demo banner offset */
:root {
  --demo-banner-height: 0px;
}

.mega-menu-container {
  top: calc(80px + var(--demo-banner-height, 0px));
}

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

/* Mega Menu İç Container */
.mega-menu-inner {
  padding: 1.5rem;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 249, 247, 0.95) 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(243, 147, 33, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Dark mode */
[data-theme="dark"] .mega-menu-inner {
  background: linear-gradient(135deg, rgba(26, 29, 35, 0.98) 0%, rgba(11, 17, 32, 0.95) 100%);
  box-shadow: 0 25px 80px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(243, 147, 33, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Mega Menu Grid */
.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 992px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .mega-menu-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   KATEGORI KARTLARI
   ======================================== */

.mega-menu-category-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(250, 249, 247, 0.5) 100%);
  border: 1px solid rgba(243, 147, 33, 0.1);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.mega-menu-category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(243, 147, 33, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.mega-menu-category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px rgba(243, 147, 33, 0.2), 0 0 0 1px rgba(243, 147, 33, 0.2);
  border-color: rgba(243, 147, 33, 0.3);
}

.mega-menu-category-card:hover::before {
  opacity: 1;
}

[data-theme="dark"] .mega-menu-category-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .mega-menu-category-card:hover {
  background: linear-gradient(135deg, rgba(243, 147, 33, 0.1) 0%, rgba(243, 147, 33, 0.05) 100%);
  border-color: rgba(243, 147, 33, 0.4);
  box-shadow: 0 20px 50px -15px rgba(243, 147, 33, 0.3), 0 0 30px rgba(243, 147, 33, 0.1);
}

/* Shimmer Animation for Cards */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.mega-menu-category-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(243, 147, 33, 0.03) 50%, transparent 100%);
  background-size: 200% 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mega-menu-category-card:hover::after {
  opacity: 1;
  animation: shimmer 2s ease-in-out infinite;
}

/* ========================================
   KATEGORI BAŞLIK ALANI
   ======================================== */

.mega-menu-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(243, 147, 33, 0.15);
}

.mega-menu-category-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: linear-gradient(135deg, #f39321 0%, #e67e22 100%);
  color: white;
  box-shadow: 0 8px 20px -8px rgba(243, 147, 33, 0.5);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.mega-menu-category-card:hover .mega-menu-category-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 12px 30px -8px rgba(243, 147, 33, 0.6);
}

.mega-menu-category-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1a1d23;
  margin: 0;
  letter-spacing: -0.02em;
  flex: 1;
}

[data-theme="dark"] .mega-menu-category-title {
  color: #fff;
}

/* ========================================
   KATEGORI BADGE'LERİ
   ======================================== */

.mega-menu-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: auto;
}

.mega-menu-category-badge.new {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(16, 185, 129, 0.5);
}

.mega-menu-category-badge.popular {
  background: linear-gradient(135deg, #f39321 0%, #e67e22 100%);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(243, 147, 33, 0.5);
}

.mega-menu-category-badge.hot {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(239, 68, 68, 0.5);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   KATEGORİ LİNKLERİ
   ======================================== */

.mega-menu-links-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1rem;
  margin: 0 -0.5rem;
  border-radius: 10px;
  text-decoration: none;
  color: #4b5563;
  transition: all 0.25s ease;
  position: relative;
}

.mega-menu-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  width: 3px;
  height: 70%;
  background: linear-gradient(180deg, #f39321, #e67e22);
  border-radius: 0 3px 3px 0;
  transition: transform 0.25s ease;
}

.mega-menu-link:hover {
  background: linear-gradient(90deg, rgba(243, 147, 33, 0.1) 0%, transparent 100%);
  color: #f39321;
  padding-left: 1.25rem;
}

.mega-menu-link:hover::before {
  transform: translateY(-50%) scaleX(1);
}

[data-theme="dark"] .mega-menu-link {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .mega-menu-link:hover {
  background: linear-gradient(90deg, rgba(243, 147, 33, 0.15) 0%, transparent 100%);
  color: #f39321;
}

.mega-menu-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 147, 33, 0.1);
  color: #f39321;
  font-size: 0.875rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.mega-menu-link:hover .mega-menu-link-icon {
  background: linear-gradient(135deg, #f39321 0%, #e67e22 100%);
  color: white;
  transform: scale(1.1);
}

.mega-menu-link-text {
  flex: 1;
}

.mega-menu-link-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  line-height: 1.3;
}

.mega-menu-link-count {
  font-size: 0.75rem;
  color: #9ca3af;
  display: block;
  margin-top: 2px;
}

[data-theme="dark"] .mega-menu-link-count {
  color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   PROMO BANNER
   ======================================== */

.mega-menu-promo {
  background: linear-gradient(135deg, rgba(243, 147, 33, 0.1) 0%, rgba(243, 147, 33, 0.05) 100%);
  border: 1px dashed rgba(243, 147, 33, 0.3);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 1rem;
}

.mega-menu-promo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f39321 0%, #e67e22 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.mega-menu-promo-text {
  font-size: 0.85rem;
  color: #4b5563;
  line-height: 1.4;
}

.mega-menu-promo-text strong {
  color: #f39321;
}

[data-theme="dark"] .mega-menu-promo {
  background: linear-gradient(135deg, rgba(243, 147, 33, 0.15) 0%, rgba(243, 147, 33, 0.05) 100%);
  border-color: rgba(243, 147, 33, 0.4);
}

[data-theme="dark"] .mega-menu-promo-text {
  color: rgba(255, 255, 255, 0.9);
}

/* ========================================
   MEGA MENU FOOTER
   ======================================== */

.mega-menu-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(243, 147, 33, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mega-menu-view-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #f39321 0%, #e67e22 100%);
  color: white !important;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 50px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px -8px rgba(243, 147, 33, 0.5);
}

.mega-menu-view-all:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(243, 147, 33, 0.6);
  color: white !important;
}

.mega-menu-view-all i {
  transition: transform 0.3s ease;
}

.mega-menu-view-all:hover i {
  transform: translateX(4px);
}

/* ========================================
   GRAPESJS EDITOR İÇİN ÖZEL STİLLER
   ======================================== */

/* Editor içinde component seçildiğinde */
.gjs-selected .mega-menu-category-card {
  outline: 2px solid #f39321;
  outline-offset: 2px;
}

/* Editor içinde hover state'i */
.gjs-hovered .mega-menu-category-card {
  outline: 1px dashed rgba(243, 147, 33, 0.5);
  outline-offset: 2px;
}

/* Responsive Preview */
@media (max-width: 768px) {
  .mega-menu-inner {
    padding: 1rem;
  }

  .mega-menu-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .mega-menu-category-card {
    padding: 1rem;
  }

  .mega-menu-category-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .mega-menu-category-title {
    font-size: 1rem;
  }
}
