/* ===== Enhanced Dropdown Menu ===== */

/* Modern Dropdown Arrow */
.dropdown > .nav-link i {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.7rem;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
}

/* Animated Arrow Container */
.dropdown > .nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dropdown > .nav-link::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.4s ease;
}

.dropdown:hover > .nav-link::before {
    width: 100%;
}

/* Rotate arrow on hover */
.dropdown:hover > .nav-link i {
    transform: rotate(180deg);
    color: var(--primary-orange);
}

/* Enhanced Dropdown Menu Container */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    min-width: 300px;
    padding: 20px 0;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(220, 20, 60, 0.2),
                0 0 0 1px rgba(220, 20, 60, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-top: 25px;
    overflow: hidden;
}

/* Dropdown menu glow effect */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top, rgba(220, 20, 60, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Show dropdown */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Dropdown Items */
.dropdown-menu li {
    padding: 0;
    position: relative;
    overflow: hidden;
}

.dropdown-menu li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient-primary);
    transform: translateX(-4px);
    transition: transform 0.3s ease;
}

.dropdown-menu li:hover::before {
    transform: translateX(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 14px 30px;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    gap: 15px;
}

/* Icon before each menu item */
.dropdown-menu a::before {
    content: '→';
    font-size: 1.2rem;
    color: var(--primary-orange);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.dropdown-menu a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Ripple effect background */
.dropdown-menu a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 20, 60, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.dropdown-menu a:hover::after {
    width: 300px;
    height: 300px;
}

.dropdown-menu a:hover {
    background: rgba(220, 20, 60, 0.05);
    color: var(--primary-orange);
    padding-left: 40px;
    transform: translateX(5px);
}

/* Staggered animation for menu items */
.dropdown:hover .dropdown-menu li {
    animation: slideInLeft 0.4s ease forwards;
    opacity: 0;
}

.dropdown:hover .dropdown-menu li:nth-child(1) { animation-delay: 0.05s; }
.dropdown:hover .dropdown-menu li:nth-child(2) { animation-delay: 0.1s; }
.dropdown:hover .dropdown-menu li:nth-child(3) { animation-delay: 0.15s; }
.dropdown:hover .dropdown-menu li:nth-child(4) { animation-delay: 0.2s; }
.dropdown:hover .dropdown-menu li:nth-child(5) { animation-delay: 0.25s; }
.dropdown:hover .dropdown-menu li:nth-child(6) { animation-delay: 0.3s; }

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

/* Divider between items */
.dropdown-menu li + li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(220, 20, 60, 0.2) 50%, 
        transparent 100%);
}

/* Service count badge */
.dropdown-menu a[data-count]::after {
    content: attr(data-count);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gradient-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropdown-menu a:hover[data-count]::after {
    opacity: 1;
}

/* Glow effect on hover */
.dropdown:hover .dropdown-menu {
    box-shadow: 0 15px 50px rgba(220, 20, 60, 0.3),
                0 0 0 1px rgba(220, 20, 60, 0.2),
                0 0 30px rgba(255, 107, 53, 0.1);
}

/* Mobile Dropdown Enhancement */
@media (max-width: 991px) {
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        margin-top: 10px;
        display: none;
        min-width: 100%;
        background: rgba(42, 42, 42, 0.95);
        border-radius: 10px;
        padding: 15px 0;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            max-height: 0;
        }
        to {
            opacity: 1;
            max-height: 500px;
        }
    }
    
    .dropdown > .nav-link i {
        margin-left: auto;
    }
    
    .dropdown.active > .nav-link i {
        transform: rotate(180deg);
    }
    
    .dropdown-menu a {
        padding: 12px 25px;
    }
    
    .dropdown-menu a::before {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Tooltip on hover */
.dropdown-menu a[data-tooltip] {
    position: relative;
}

.dropdown-menu a[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    background: var(--gradient-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    animation: tooltipFade 0.3s ease forwards;
}

@keyframes tooltipFade {
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(calc(100% + 10px));
    }
}

/* Accessibility improvements */
.dropdown-menu a:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .dropdown-menu,
    .dropdown-menu li,
    .dropdown > .nav-link i,
    .dropdown-menu a {
        animation: none !important;
        transition: none !important;
    }
}