/* ========== DROPDOWN COMPONENT ========== */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    /* Narrower */
    max-width: 220px;
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    /* Items will have shadow or just flat? Search has no shadow on container */
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    z-index: 1003;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.active {
    display: flex;
    animation: dropdown-slide-in 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dropdown-menu.closing {
    animation: dropdown-slide-out 0.2s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes dropdown-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dropdown-slide-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 4px;
}

.dropdown-item:first-child {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.dropdown-item:last-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.dropdown-item:only-child {
    border-radius: 16px;
}

.dropdown-item:hover {
    background-color: var(--md-sys-color-surface-container-highest);
}

.dropdown-item.active {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.dropdown-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dropdown-item-text {
    flex: 1;
}

.dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1002;
    display: none;
}

.dropdown-backdrop.active {
    display: block;
}