/* ========================================
   Wattbalkon Modern Dropdown Menu System
   Linear-inspired, smooth animations
   ======================================== */

/* Dropdown Trigger - Modernized */
.lp-dd-t {
  position: relative;
  padding: 10px 16px;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
}

.lp-dd-t:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--tx) !important;
  transform: translateY(-1px);
}

.lp-dd-t svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--t2);
}

.lp-dd:hover .lp-dd-t svg {
  transform: rotate(180deg);
  color: var(--ac);
}

/* Dropdown Menu - Premium Glass Effect */
.lp-dd-m {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  max-width: 320px;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 8px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.3),
    0 10px 30px -5px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top left;
}

.lp-dd-m.lp-dd-m-r {
  left: auto;
  right: 0;
  transform-origin: top right;
}

/* Smooth reveal on hover */
.lp-dd:hover .lp-dd-m {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Dropdown Items */
.lp-dd-m a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 2px;
  border-radius: 10px;
  color: var(--t2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  overflow: hidden;
}

/* Hover effect with animated background */
.lp-dd-m a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  opacity: 0;
  transform: translateX(-100%);
  transition: all 0.3s ease;
  z-index: -1;
}

.lp-dd-m a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.lp-dd-m a:hover {
  color: var(--tx);
  background: rgba(255, 255, 255, 0.03);
  transform: translateX(4px);
}

/* Optional: Add icon indicator */
.lp-dd-m a::after {
  content: '→';
  position: absolute;
  right: 14px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.25s ease;
  color: var(--ac);
  font-size: 0.75rem;
}

.lp-dd-m a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Category-specific icons (optional) */
.lp-dd-m a[href*="balkonkraftwerk"]::before {
  content: '⚡';
  margin-right: 0;
}

.lp-dd-m a[href*="photovoltaik"]::before {
  content: '☀️';
  margin-right: 0;
}

.lp-dd-m a[href*="tests"]::before,
.lp-dd-m a[href*="vergleiche"]::before {
  content: '🔬';
  margin-right: 0;
}

.lp-dd-m a[href*="speicher"]::before {
  content: '🔋';
  margin-right: 0;
}

.lp-dd-m a[href*="ratgeber"]::before {
  content: '📚';
  margin-right: 0;
}

.lp-dd-m a[href*="foerderung"]::before,
.lp-dd-m a[href*="förderung"]::before {
  content: '💰';
  margin-right: 0;
}

/* Current page indicator */
.lp-dd-m a.current-menu-item {
  color: var(--ac) !important;
  background: rgba(245, 158, 11, 0.08);
  font-weight: 600;
}

.lp-dd-m a.current-menu-item::after {
  content: '✓';
  opacity: 1;
  transform: translateX(0);
}

/* Mobile Menu (lp-mm) - Already good, just tweaks */
.lp-mm-link {
  transition: all 0.2s ease;
}

.lp-mm-link:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.03);
}

.lp-mm-sub .lp-mm-link {
  padding-left: 32px;
}

/* Animation for menu sections */
.lp-mm-sec {
  animation: slideIn 0.3s ease forwards;
  opacity: 0;
}

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

/* Stagger animation for menu links */
.lp-mm-link {
  opacity: 0;
  animation: fadeInSlide 0.3s ease forwards;
}

.lp-mm-link:nth-child(1) { animation-delay: 0.05s; }
.lp-mm-link:nth-child(2) { animation-delay: 0.1s; }
.lp-mm-link:nth-child(3) { animation-delay: 0.15s; }
.lp-mm-link:nth-child(4) { animation-delay: 0.2s; }
.lp-mm-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Focus states for accessibility */
.lp-dd-t:focus-visible,
.lp-dd-m a:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Performance: Hardware acceleration */
.lp-dd-t,
.lp-dd-m,
.lp-mm-link {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .lp-dd-t,
  .lp-dd-m,
  .lp-dd-m a,
  .lp-mm-link,
  .lp-dd-t svg {
    transition: none;
    animation: none;
  }

  .lp-dd:hover .lp-dd-t svg {
    transform: none;
  }

  .lp-dd:hover .lp-dd-m {
    transform: none;
  }

  .lp-dd-m a:hover {
    transform: none;
  }
}