/* ===============================================
   PREMIUM DROPDOWN DESIGN
   Professional, Beautiful, Top-Notch
   For Both Desktop & Mobile
   =============================================== */

/* ================= DESKTOP DROPDOWN (>768px) ================= */
@media (min-width: 769px) {
    
    /* Main dropdown container */
    .dropdown {
        position: relative;
    }

    /* Services link with indicator */
    .dropdown > a {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    /* Add elegant down arrow */
    .dropdown > a::after {
        content: "";
        display: inline-block;
        width: 0;
        height: 0;
        border-left: 4px solid transparent;
        border-right: 4px solid transparent;
        border-top: 5px solid currentColor;
        transition: transform 0.3s ease, border-top-color 0.3s ease;
        opacity: 0.7;
    }

    /* Rotate arrow on hover */
    .dropdown:hover > a::after {
        transform: rotate(180deg);
        opacity: 1;
    }

    /* Premium dropdown menu */
    .dropdown-menu {
        position: absolute;
        top: calc(100% + 15px);
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        background: #ffffff;
        min-width: 280px;
        border-radius: 12px;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.15),
            0 0 0 1px rgba(0, 0, 0, 0.05);
        padding: 12px 0;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        list-style: none;
        overflow: hidden;
    }

    /* Arrow pointer at top */
    .dropdown-menu::before {
        content: "";
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
        width: 12px;
        height: 12px;
        background: #ffffff;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        border-left: 1px solid rgba(0, 0, 0, 0.05);
        z-index: -1;
    }

    /* Show dropdown on hover */
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    /* Dropdown items styling */
    .dropdown-menu li {
        padding: 0;
        margin: 0;
        position: relative;
    }

    .dropdown-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px;
        color: #333;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.95rem;
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    /* Icon before each item */
    .dropdown-menu a::before {
        content: "";
        width: 6px;
        height: 6px;
        background: #ff8c42;
        border-radius: 50%;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

    /* Hover background effect */
    .dropdown-menu a::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 100%;
        background: linear-gradient(90deg, rgba(255, 140, 66, 0.08) 0%, rgba(255, 140, 66, 0.03) 100%);
        transition: width 0.3s ease;
        z-index: -1;
    }

    /* Hover state */
    .dropdown-menu a:hover {
        color: #ff8c42;
        padding-left: 28px;
        background: rgba(255, 140, 66, 0.03);
    }

    .dropdown-menu a:hover::before {
        transform: scale(1.5);
        background: #ff6b1a;
        box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.2);
    }

    .dropdown-menu a:hover::after {
        width: 100%;
    }

    /* Active/current page indicator */
    .dropdown-menu a.active {
        color: #ff8c42;
        background: rgba(255, 140, 66, 0.05);
        font-weight: 600;
    }

    .dropdown-menu a.active::before {
        background: #ff8c42;
        box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
    }

    /* Divider between items (optional) */
    .dropdown-menu li:not(:last-child) {
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    }

    /* Icon integration (if using Font Awesome) */
    .dropdown-menu a i {
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ff8c42;
        font-size: 0.9rem;
        transition: transform 0.3s ease;
    }

    .dropdown-menu a:hover i {
        transform: translateX(3px);
    }

    /* Stagger animation for items */
    .dropdown:hover .dropdown-menu li {
        animation: slideInUp 0.3s ease forwards;
    }

    .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; }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Premium glass effect (optional) */
    .dropdown-menu.glass {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    /* Dark theme variant (optional) */
    .dropdown-menu.dark {
        background: #1a1a1a;
        color: #ffffff;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu.dark a {
        color: #e0e0e0;
    }

    .dropdown-menu.dark a:hover {
        color: #ff8c42;
        background: rgba(255, 140, 66, 0.1);
    }
}

/* ================= MOBILE DROPDOWN (≤768px) ================= */
@media (max-width: 768px) {
    
    /* Dropdown container */
    .dropdown {
        position: relative;
    }

    /* Services link with elegant indicator */
    .dropdown > a {
        position: relative;
        padding-right: 50px !important;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Beautiful chevron icon */
    .dropdown > a::before {
        content: "";
        position: absolute;
        right: 20px;
        top: 50%;
        width: 10px;
        height: 10px;
        border-right: 2px solid #666;
        border-bottom: 2px solid #666;
        transform: translateY(-50%) rotate(45deg);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.7;
    }

    /* Rotate chevron when expanded */
    .dropdown.active > a::before {
        transform: translateY(-30%) rotate(-135deg);
        border-color: #ff8c42;
        opacity: 1;
    }

    /* Highlight Services when expanded */
    .dropdown.active > a {
        color: #ff8c42 !important;
        background: rgba(255, 140, 66, 0.05);
        font-weight: 600;
    }

    /* Premium dropdown panel */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        border-left: 3px solid transparent;
    }

    /* Expand dropdown */
    .dropdown.active .dropdown-menu {
        max-height: 600px;
        border-left-color: #ff8c42;
        box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.03);
    }

    /* Dropdown items */
    .dropdown-menu li {
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        transform: translateX(-10px);
        opacity: 0;
        transition: all 0.3s ease;
    }

    .dropdown.active .dropdown-menu li {
        transform: translateX(0);
        opacity: 1;
    }

    /* Stagger animation */
    .dropdown.active .dropdown-menu li:nth-child(1) { transition-delay: 0.05s; }
    .dropdown.active .dropdown-menu li:nth-child(2) { transition-delay: 0.1s; }
    .dropdown.active .dropdown-menu li:nth-child(3) { transition-delay: 0.15s; }
    .dropdown.active .dropdown-menu li:nth-child(4) { transition-delay: 0.2s; }

    .dropdown-menu li:last-child {
        border-bottom: none;
    }

    /* Beautiful service items */
    .dropdown-menu a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px 16px 40px !important;
        background: transparent;
        color: #555 !important;
        font-weight: 500;
        font-size: 0.95rem;
        position: relative;
        transition: all 0.3s ease;
    }

    /* Elegant arrow icon */
    .dropdown-menu a::before {
        content: "→";
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.1rem;
        color: #ff8c42;
        font-weight: bold;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.7;
    }

    /* Gradient background on hover */
    .dropdown-menu a::after {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        width: 0;
        height: 100%;
        background: linear-gradient(90deg, rgba(255, 140, 66, 0.12) 0%, rgba(255, 140, 66, 0.04) 100%);
        transition: width 0.3s ease;
        z-index: -1;
    }

    /* Active/tap state */
    .dropdown-menu a:active,
    .dropdown-menu a:hover {
        background: rgba(255, 140, 66, 0.08) !important;
        color: #ff8c42 !important;
        padding-left: 45px !important;
        transform: translateX(2px);
    }

    .dropdown-menu a:active::before,
    .dropdown-menu a:hover::before {
        left: 18px;
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
        color: #ff6b1a;
    }

    .dropdown-menu a:active::after,
    .dropdown-menu a:hover::after {
        width: 100%;
    }

    /* Touch feedback */
    .dropdown-menu a {
        -webkit-tap-highlight-color: rgba(255, 140, 66, 0.1);
    }

    /* Active page indicator */
    .dropdown-menu a.active {
        background: rgba(255, 140, 66, 0.1) !important;
        color: #ff8c42 !important;
        font-weight: 600;
        border-left: 3px solid #ff8c42;
        padding-left: 37px !important;
    }

    .dropdown-menu a.active::before {
        color: #ff8c42;
        opacity: 1;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: translateY(-50%) scale(1); }
        50% { transform: translateY(-50%) scale(1.1); }
    }

    /* Ripple effect on tap (advanced) */
    .dropdown-menu a {
        overflow: hidden;
    }

    .dropdown-menu a .ripple {
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 140, 66, 0.3);
        transform: scale(0);
        animation: ripple 0.6s ease-out;
        pointer-events: none;
    }

    @keyframes ripple {
        to {
            transform: scale(4);
            opacity: 0;
        }
    }
}

/* ================= PREMIUM ENHANCEMENTS ================= */

/* Smooth scrolling when dropdown items clicked */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.dropdown-menu a:focus {
    outline: 2px solid #ff8c42;
    outline-offset: 2px;
    background: rgba(255, 140, 66, 0.1);
}

/* Preload hint for better performance */
.dropdown-menu {
    will-change: opacity, transform;
}

/* ================= TABLET OPTIMIZATION (768px - 991px) ================= */
@media (min-width: 769px) and (max-width: 991px) {
    .dropdown-menu {
        min-width: 240px;
        font-size: 0.9rem;
    }

    .dropdown-menu a {
        padding: 12px 18px;
    }
}

/* ================= PRINT STYLES ================= */
@media print {
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
    }
}