/* ===================================
   HEADER STYLES WITH DROPDOWN MENU
   =================================== */

/* Dropdown Container */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Toggle Button */
.dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.dropdown-icon {
    transition: transform 0.3s ease;
}

.nav-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.nav-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Dropdown Items */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dropdown-item:hover::before {
    opacity: 1;
}

.dropdown-item:hover {
    color: #fff;
    transform: translateX(4px);
}

.dropdown-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: #fff;
}

.dropdown-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 0 2px 2px 0;
}

.dropdown-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Dropdown Item Icon */
.dropdown-icon-emoji {
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Dropdown Item Content */
.dropdown-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    position: relative;
    z-index: 1;
}

.dropdown-item-title {
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.dropdown-item-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

.dropdown-item:hover .dropdown-item-desc {
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 0.375rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===================================
   RESPONSIVE STYLES
   =================================== */

@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(20px);
        padding: 5rem 2rem 2rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    }

    .nav.active {
        right: 0;
    }

    .nav-link {
        padding: 1rem 1.25rem;
        border-radius: 12px;
        width: 100%;
        text-align: left;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-radius: 12px;
    }

    .dropdown-menu {
        position: static !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        margin: 0 !important;
        min-width: auto;
        width: 100% !important;
        max-height: 0;
        overflow: hidden;
        padding: 0 !important;
        transition: all 0.3s ease;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 0.25rem 0 !important;
    }

    .dropdown-item {
        padding: 0.875rem 1rem 0.875rem 2.5rem !important;
        margin: 0.125rem 0 !important;
        transform: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
    }

    .dropdown-item:hover {
        transform: none !important;
    }

    /* Mobile menu overlay */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}

@media (max-width: 640px) {
    .dropdown-item {
        padding: 0.75rem 0.875rem;
    }

    .dropdown-item:hover {
        transform: none;
    }

    .dropdown-icon-emoji {
        font-size: 1.25rem;
    }

    .dropdown-item-title {
        font-size: 0.875rem;
    }

    .dropdown-item-desc {
        font-size: 0.6875rem;
    }

    .nav {
        width: 280px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */

/* Stagger animation for dropdown items */
.nav-dropdown.active .dropdown-item {
    animation: slideInDown 0.3s ease forwards;
}

.nav-dropdown.active .dropdown-item:nth-child(1) {
    animation-delay: 0.05s;
}

.nav-dropdown.active .dropdown-item:nth-child(2) {
    animation-delay: 0.1s;
}

.nav-dropdown.active .dropdown-item:nth-child(3) {
    animation-delay: 0.15s;
}

.nav-dropdown.active .dropdown-item:nth-child(4) {
    animation-delay: 0.2s;
}

.nav-dropdown.active .dropdown-item:nth-child(5) {
    animation-delay: 0.25s;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover effect enhancement */
.dropdown-item {
    background-size: 200% 200%;
    background-position: 0% 50%;
}

.dropdown-item:hover {
    background-position: 100% 50%;
}